From 385bbc863e9974ec55928f4c3d49407cab4081fd Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 22 Oct 2020 20:00:49 -0700 Subject: [PATCH] util: Add a --no-test-xml option to the m5 util's scons. This forces the test XML output files to be omitted from the build. This lets you run scons build/ to build everything without running any tests, and can be used to verify that everything builds correctly even if the tests don't run/pass. Change-Id: I280ffe4e76b2249912f9a51a414f4058a3643229 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27755 Tested-by: kokoro Reviewed-by: Gabe Black Reviewed-by: Bobby R. Bruce Maintainer: Gabe Black Maintainer: Bobby R. Bruce --- util/m5/README.md | 1 + util/m5/SConstruct | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/util/m5/README.md b/util/m5/README.md index f1d9bece3..cfa2fbd8f 100644 --- a/util/m5/README.md +++ b/util/m5/README.md @@ -175,6 +175,7 @@ some other prefix corresponding to that host. ### SCons command line flags --debug-build: Compile with the -g option, and -O0. +--no-test-xml: Exclude the test result XML files from the build. ## External dependency detection diff --git a/util/m5/SConstruct b/util/m5/SConstruct index 3a96103ae..64bb543e4 100644 --- a/util/m5/SConstruct +++ b/util/m5/SConstruct @@ -44,6 +44,8 @@ def abspath(d): AddOption('--debug-build', dest='debug_build', action='store_true', help='Build with debug info, and disable optimizations.') +AddOption('--no-test-xml', dest='no_tests', action='store_true', + help='Omit test output xml files from the build.') # Universal settings. if GetOption('debug_build'): @@ -85,7 +87,8 @@ def GTest(env, name, *srcs, **kwargs): need_qemu_to_run = 'HAVE_QEMU' in env; # If we can run this test... - if not need_qemu_to_run or env['HAVE_QEMU']: + if (not need_qemu_to_run or env['HAVE_QEMU']) \ + and not GetOption('no_tests'): # An XML file which holds the results of the test. xml = Dir('test').Dir('result').File('%s.xml' % name) # The basic command line for the test. -- 2.30.2