tests: Use full path for DownloadedProgram

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>
This commit is contained in:
Jason Lowe-Power
2019-03-15 09:23:51 -07:00
parent ee0e0ff6a0
commit 19eb23f12e

View 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