From: Giacomo Travaglini Date: Fri, 17 Jan 2020 14:09:18 +0000 (+0000) Subject: tests: hello_se using host tag X-Git-Tag: v19.0.0.0~22 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=25cf751b1039f6b8d620492785526969c6e38a34;p=gem5.git tests: hello_se using host tag This patch is rewriting hello_se to distinguish between statically and dynamically linked hello worlds. Change-Id: I03c1add1d1ca568d150f4bacd89b2838a6d27035 Signed-off-by: Giacomo Travaglini Reviewed-by: Ciro Santilli Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24528 Tested-by: kokoro Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce --- diff --git a/tests/gem5/hello_se/test_hello_se.py b/tests/gem5/hello_se/test_hello_se.py index 74d7fb1a6..39c152910 100644 --- a/tests/gem5/hello_se/test_hello_se.py +++ b/tests/gem5/hello_se/test_hello_se.py @@ -43,8 +43,8 @@ Test file for the util m5 exit assembly instruction. ''' from testlib import * -test_progs = { - 'x86': ('hello64-static', 'hello64-dynamic', 'hello32-static'), +static_progs = { + 'x86': ('hello64-static', 'hello32-static'), 'arm': ('hello64-static', 'hello32-static'), 'alpha': ('hello',), 'mips': ('hello',), @@ -52,6 +52,10 @@ test_progs = { 'sparc': ('hello',) } +dynamic_progs = { + 'x86': ('hello64-dynamic',) +} + if config.bin_path: base_path = config.bin_path else: @@ -59,24 +63,32 @@ else: 'bin') urlbase = 'http://dist.gem5.org/dist/current/test-progs/hello/bin/' -for isa in test_progs: - for binary in test_progs[isa]: - import os - url = urlbase + isa + '/linux/' + binary - path = joinpath(base_path, isa, 'linux') - hello_program = DownloadedProgram(url, path, binary) +ref_path = joinpath(getcwd(), 'ref') +verifiers = ( + verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')), +) + +def verify_config(isa, binary, hosts): + url = urlbase + isa + '/linux/' + binary + path = joinpath(base_path, isa, 'linux') + hello_program = DownloadedProgram(url, path, binary) - ref_path = joinpath(getcwd(), 'ref') + gem5_verify_config( + name='test-'+binary, + fixtures=(hello_program,), + verifiers=verifiers, + config=joinpath(config.base_dir, 'configs', 'example','se.py'), + config_args=['--cmd', joinpath(path, binary)], + valid_isas=(isa.upper(),), + valid_hosts=hosts, + ) - verifiers = ( - verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')), - ) +# Run statically linked hello worlds +for isa in static_progs: + for binary in static_progs[isa]: + verify_config(isa, binary, constants.supported_hosts) - gem5_verify_config( - name='test-'+binary, - fixtures=(hello_program,), - verifiers=verifiers, - config=joinpath(config.base_dir, 'configs', 'example','se.py'), - config_args=['--cmd', joinpath(path, binary)], - valid_isas=(isa.upper(),), - ) +# Run dynamically linked hello worlds +for isa in dynamic_progs: + for binary in dynamic_progs[isa]: + verify_config(isa, binary, constants.target_host[isa.upper()])