tests: Use full path for DownloadedProgram
authorJason Lowe-Power <jason@lowepower.com>
Fri, 15 Mar 2019 16:23:51 +0000 (09:23 -0700)
committerJason Lowe-Power <jason@lowepower.com>
Thu, 21 Mar 2019 15:57:10 +0000 (15:57 +0000)
Change-Id: I1dceca80a425293d64f81b06ddff499363f18bc0
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17454
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
tests/gem5/fixture.py

index c4fd12f52a46195588ff0e8a46a631bc18b82c83..97aab46f50070eb6d6a90ab6f6edc4878314f183 100644 (file)
@@ -221,12 +221,23 @@ class DownloadedProgram(Fixture):
     urlbase = "http://gem5.org/dist/current/"
 
     def __init__(self, path, program, **kwargs):
+        """
+        path: string
+            The path to the directory containing the binary relative to
+            $GEM5_BASE/tests
+        program: string
+            The name of the binary file
+        """
         super(DownloadedProgram, self).__init__("download-" + program,
                                                 build_once=True, **kwargs)
 
         self.program_dir = path
-        self.path = joinpath(self.program_dir, program)
-        self.url = self.urlbase + self.path
+        relative_path = joinpath(self.program_dir, program)
+        self.url = self.urlbase + relative_path
+        self.path = os.path.realpath(
+                        joinpath(absdirpath(__file__), '../', relative_path)
+                    )
+
     def _download(self):
         import urllib
         import errno