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 <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24528
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
diff --git a/tests/gem5/hello_se/test_hello_se.py b/tests/gem5/hello_se/test_hello_se.py
index 74d7fb1..39c1529 100644
--- a/tests/gem5/hello_se/test_hello_se.py
+++ b/tests/gem5/hello_se/test_hello_se.py
@@ -43,8 +43,8 @@
'''
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 @@
'sparc': ('hello',)
}
+dynamic_progs = {
+ 'x86': ('hello64-dynamic',)
+}
+
if config.bin_path:
base_path = config.bin_path
else:
@@ -59,24 +63,32 @@
'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')),
+)
- ref_path = joinpath(getcwd(), 'ref')
+def verify_config(isa, binary, hosts):
+ url = urlbase + isa + '/linux/' + binary
+ path = joinpath(base_path, isa, 'linux')
+ hello_program = DownloadedProgram(url, path, binary)
- verifiers = (
- verifier.MatchStdoutNoPerf(joinpath(ref_path, 'simout')),
- )
+ 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,
+ )
- 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 statically linked hello worlds
+for isa in static_progs:
+ for binary in static_progs[isa]:
+ verify_config(isa, binary, constants.supported_hosts)
+
+# 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()])