diff --git a/README.adoc b/README.adoc index 7167199..f837070 100644 --- a/README.adoc +++ b/README.adoc @@ -11963,10 +11963,16 @@ TODO: why is the `--dtb` required despite `fs_bigLITTLE.py` having a DTB generat Tested on: https://github.com/cirosantilli/linux-kernel-module-cheat/commit/18c1c823feda65f8b54cd38e261c282eee01ed9f[18c1c823feda65f8b54cd38e261c282eee01ed9f] -=== gem5 unit tests +=== gem5 in-tree tests https://stackoverflow.com/questions/52279971/how-to-run-the-gem5-unit-tests +All those tests could in theory be added to this repo instead of to gem5, and this is actually the superior setup as it is cross emulator. + +But can the people from the project be convinced of that? + +==== gem5 unit tests + These are just very small GTest tests that test a single class in isolation, they don't run any executables. Build the unit tests and run them: @@ -12009,7 +12015,7 @@ 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`. -=== gem5 regression tests +==== gem5 regression tests https://stackoverflow.com/questions/52279971/how-to-run-the-gem5-unit-tests @@ -12028,6 +12034,18 @@ After the first run has downloaded the test binaries for you, you can speed up t Note however that `--skip-build` is required at least once per branch to download the test binaries, because the test interface is bad. +List available instead of running them: + +.... +./gem5-regression --gem5-worktree master --arch aarch64 --cmd list +.... + +You can then pick one suite from the list (not tests) and run just it e.g. with: + +.... +./gem5-regression --arch aarch64 -- --uid SuiteUID:tests/gem5/cpu_tests/test.py:cpu_test_AtomicSimpleCPU_Bubblesort-ARM-opt +.... + === gem5 simulate() limit reached This error happens when the following instruction limits are reached: diff --git a/gem5-regression b/gem5-regression index 8477235..f3930ba 100755 --- a/gem5-regression +++ b/gem5-regression @@ -15,6 +15,13 @@ class Main(common.LkmcCliFunction): Run gem5 regression tests. https://cirosantilli.com/linux-kernel-module-cheat#gem5-regression-tests ''' + ) + self.add_argument( + '--cmd', + default='run', + help=''' +List tests instead of running them. +''', ) self.add_argument( 'extra_args', @@ -23,16 +30,23 @@ https://cirosantilli.com/linux-kernel-module-cheat#gem5-regression-tests ) def timed_main(self): - return self.sh.run_cmd([ - os.path.join(self.env['gem5_source_dir'], 'tests', 'main.py'), LF, - 'run', LF, + if self.env['cmd'] == 'run': + extra_args = [ '--base-dir', self.env['gem5_source_dir'], LF, '--build-dir', self.env['gem5_build_build_dir'], LF, - '--isa', self.env['gem5_arch'], LF, - '--variant', self.env['gem5_build_type'], LF, '-j', str(self.env['nproc']), LF, '-t', str(self.env['nproc']), LF, + ] + else: + extra_args = [] + return self.sh.run_cmd( + [ + os.path.join(self.env['gem5_source_dir'], 'tests', 'main.py'), LF, + self.env['cmd'], LF, + '--isa', self.env['gem5_arch'], LF, + '--variant', self.env['gem5_build_type'], LF, ] + + extra_args + self.sh.add_newlines(self.env['extra_args']), cwd=os.path.join(self.env['gem5_source_dir'], 'tests'), raise_on_failure=False,