build-gem5: --regression-test

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-25 00:00:04 +00:00
parent 72cd8f580d
commit 17dd3f76f0
2 changed files with 28 additions and 0 deletions

View File

@@ -10182,6 +10182,14 @@ This does not run the test however.
Note that the command and it's corresponding results don't need to show consecutively on stdout because tests are run in parallel. You just have to match them based on the class name `CircleBufTest` to the file `circlebuf.test.cpp`. Note that the command and it's corresponding results don't need to show consecutively on stdout because tests are run in parallel. You just have to match them based on the class name `CircleBufTest` to the file `circlebuf.test.cpp`.
Running the larger regression tests is exposed with:
....
./build-gem5 --regression-test quick/fs
....
but TODO: those require magic blobs on `M5_PATH` that we don't currently automate.
=== gem5 clang build === gem5 clang build
TODO test properly, benchmark vs GCC. TODO test properly, benchmark vs GCC.

View File

@@ -13,6 +13,15 @@ class Main(common.BuildCliFunction):
description='''\ description='''\
Build gem5. Build gem5.
https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-buildroot-setup https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-buildroot-setup
'''
)
self.add_argument(
'--regression-test',
action='append',
default=[],
help='''\
Build and run the given gem5 regression test.
https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-tests
''' '''
) )
self.add_argument( self.add_argument(
@@ -111,6 +120,17 @@ https://github.com/cirosantilli/linux-kernel-module-cheat-regression#gem5-unit-t
self.sh.cp(m5term_build, self.env['gem5_m5term']) self.sh.cp(m5term_build, self.env['gem5_m5term'])
if self.env['unit_test']: if self.env['unit_test']:
targets = [self.get_gem5_target_path(self.env, test) for test in self.env['unit_test']] targets = [self.get_gem5_target_path(self.env, test) for test in self.env['unit_test']]
elif self.env['regression_test']:
targets = [
os.path.join(
self.env['gem5_executable_dir'],
'tests',
self.env['gem5_build_type'],
test
)
for test
in self.env['regression_test']
]
elif self.env['unit_tests']: elif self.env['unit_tests']:
targets = [self.env['gem5_unit_test_target']] targets = [self.env['gem5_unit_test_target']]
else: else: