gem5-regression 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python3
  2. from shell_helpers import LF
  3. import os
  4. import pathlib
  5. import subprocess
  6. import common
  7. from shell_helpers import LF
  8. class Main(common.LkmcCliFunction):
  9. def __init__(self):
  10. super().__init__(
  11. description='''\
  12. Run gem5 regression tests.
  13. https://cirosantilli.com/linux-kernel-module-cheat#gem5-regression-tests
  14. '''
  15. )
  16. self.add_argument(
  17. 'extra_args',
  18. metavar='extra-args',
  19. nargs='*',
  20. )
  21. def timed_main(self):
  22. return self.sh.run_cmd([
  23. os.path.join(self.env['gem5_source_dir'], 'tests', 'main.py'), LF,
  24. 'run', LF,
  25. '--base-dir', self.env['gem5_source_dir'], LF,
  26. '--build-dir', self.env['gem5_build_build_dir'], LF,
  27. '--isa', self.env['gem5_arch'], LF,
  28. '--variant', self.env['gem5_build_type'], LF,
  29. '-j', str(self.env['nproc']), LF,
  30. '-t', str(self.env['nproc']), LF,
  31. ],
  32. cwd=os.path.join(self.env['gem5_source_dir'], 'tests'),
  33. )
  34. if __name__ == '__main__':
  35. Main().cli()