tests: Move test programs paths to related test scripts
authorAyaz Akram <yazakram@ucdavis.edu>
Thu, 24 Jan 2019 06:13:29 +0000 (22:13 -0800)
committerAyaz Akram <yazakram@ucdavis.edu>
Wed, 13 Feb 2019 01:52:35 +0000 (01:52 +0000)
This change is needed to make sure that the DownloadedProgram fixture
does not fail, in case the test binaries are not stored in test-progs/
(e.g. in the case of cpu tests)

Change-Id: Icf96f2537b038502e78da560c7ccebc44984b509
Signed-off-by: Ayaz Akram <yazakram@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/15856
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Rutuja Govind Oza <roza@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

tests/gem5/fixture.py
tests/gem5/hello_se/test_hello_se.py
tests/gem5/m5_util/test_exit.py

index a50d73cff816bcc7125ff43d3db344679b88a9c3..df834ef75ba0cdaa789875264be3c4322bcf665f 100644 (file)
@@ -220,11 +220,9 @@ class DownloadedProgram(Fixture):
         super(DownloadedProgram, self).__init__("download-" + program,
                                                 build_once=True, **kwargs)
 
-        self.program_dir = joinpath('test-progs', path)
+        self.program_dir = path
         self.path = joinpath(self.program_dir, program)
-
         self.url = self.urlbase + self.path
-
     def _download(self):
         import urllib
         log.test_log.debug("Downloading " + self.url + " to " + self.path)
index 03100643a3e3017c9e6103b5912d43f7f8525254..50179620702b3c0123bcfb945d935f628e06e14e 100644 (file)
@@ -39,7 +39,7 @@ test_progs = {
 for isa in test_progs:
     for binary in test_progs[isa]:
         import os
-        path = os.path.join('hello', 'bin', isa, 'linux')
+        path = os.path.join('test-progs', 'hello', 'bin', isa, 'linux')
         hello_program = DownloadedProgram(path, binary)
 
         ref_path = joinpath(getcwd(), 'ref')
index f5292b139be7afccf0d9ae7a65077e30faee02ab..a766db4201ddea7b7de4db2ccb859b6d802ea6be 100644 (file)
@@ -37,7 +37,8 @@ m5_exit_regex = re.compile(
 r'Exiting @ tick \d* because m5_exit instruction encountered'
 )
 
-test_program = DownloadedProgram('m5-exit/bin/x86/linux/', 'm5_exit')
+test_program = DownloadedProgram('test-progs/m5-exit/bin/x86/linux/',\
+        'm5_exit')
 
 a = verifier.MatchRegex(m5_exit_regex)
 gem5_verify_config(