diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-01-28 15:54:20 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-01-30 16:35:49 +0000 |
commit | 6a342648ae50beb8457871862f14fc9baef6b74f (patch) | |
tree | 56cc4e0c3e4743e0234ad05f385e2a332e15f1bb /tests | |
parent | 4d79d4bc141d34269294d9f2c457a5675183a565 (diff) | |
download | ComputeLibrary-6a342648ae50beb8457871862f14fc9baef6b74f.tar.gz |
COMPMID-3023: Conditionally build test framework when needed.
Alters build system to build test framework only when at least one test
suite is needed.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I97cfe55b7727210249478e321a9fd150b84f898f
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2653
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giuseppe Rossini <giuseppe.rossini@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SConscript | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/SConscript b/tests/SConscript index a6668e1f98..5c95c551f4 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -26,8 +26,6 @@ Import('env') Import('vars') Import('install_bin') -SConscript('./framework/SConscript', duplicate=0) - # vars is imported from arm_compute: variables = [ BoolVariable("benchmark_examples", "Build benchmark examples programs", True), @@ -45,18 +43,31 @@ for v in variables: new_options.Add(v) vars.Add(v) -# Disable floating-point expression contraction (e.g. fused multiply-add operations) -env.Append(CXXFLAGS = ['-ffp-contract=off']) - # Clone the environment to make sure we're not polluting the arm_compute one: test_env = env.Clone() vars.Update(test_env) Help(new_options.GenerateHelpText(test_env)) +# Check if we need to build the test framework +build_test_framework = False +for opt in new_options.keys(): + option_value = test_env[opt] + if type(option_value) is bool and option_value: + build_test_framework = True + break + +if not build_test_framework: + Return() +else: + SConscript('./framework/SConscript', duplicate=0) + Import("arm_compute_test_framework") test_env.Append(LIBS = arm_compute_test_framework) +# Disable floating-point expression contraction (e.g. fused multiply-add operations) +test_env.Append(CXXFLAGS = ['-ffp-contract=off']) + # Remove -Wnoexcept from tests if 'g++' in test_env['CXX'] and '-Wnoexcept' in test_env['CXXFLAGS']: test_env['CXXFLAGS'].remove("-Wnoexcept") |