From ea1c95085113d7804a93d3b4995bc114e185063f Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Thu, 9 Nov 2017 11:49:18 +0000 Subject: COMPMID-556: Allow building only specific validation tests using the option variable test_filter. This is particularly useful when building the tests for running them on Fast models because it reduces considerably the execution time on the MODELS mainly due to the fact that there are fewer test suites in the executable. Usage example: PATH=$PATH:/work/local_tools/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/ scons arch=arm64-v8a neon=1 opencl=0 openvx=0 opencv=0 Werror=0 validation_tests=1 benchmark_tests=0 debug=0 Werror=0 asserts=1 examples=0 cppthreads=0 openmp=0 standalone=1 test_filter=GEMMLowp.* -j9 Will build only the NEON GEMMLowp tests as a standalone binary. Change-Id: I5cfb242d32276408e42da68c17455ea375902156 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/95052 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- tests/SConscript | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tests/SConscript') diff --git a/tests/SConscript b/tests/SConscript index 9c9897ea0e..37c96d2f22 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -30,7 +30,8 @@ SConscript('./framework/SConscript', duplicate=0) # vars is imported from arm_compute: variables = [ BoolVariable("validation_tests", "Build validation test programs", True), - BoolVariable("benchmark_tests", "Build benchmark test programs", True) + BoolVariable("benchmark_tests", "Build benchmark test programs", True), + ("test_filter", "Pattern to specify the tests' filenames to be compiled", "*.cpp") ] # We need a separate set of Variables for the Help message (Otherwise the global variables will get displayed twice) @@ -89,22 +90,24 @@ files_validation += Glob('validation/UNIT/*.cpp') if env['opencl']: Import('opencl') + filter_pattern = test_env['test_filter'] test_env.Append(CPPDEFINES=['ARM_COMPUTE_CL']) test_env.Append(LIBS = ["OpenCL"]) - files_benchmark += Glob('benchmark/CL/*/*.cpp') - files_benchmark += Glob('benchmark/CL/*.cpp') + files_benchmark += Glob('benchmark/CL/*/' + filter_pattern) + files_benchmark += Glob('benchmark/CL/' + filter_pattern) - files_validation += Glob('validation/CL/*/*.cpp') - files_validation += Glob('validation/CL/*.cpp') + files_validation += Glob('validation/CL/*/' + filter_pattern) + files_validation += Glob('validation/CL/' + filter_pattern) if env['neon']: - files_benchmark += Glob('benchmark/NEON/*/*.cpp') - files_benchmark += Glob('benchmark/NEON/*.cpp') + filter_pattern = test_env['test_filter'] + files_benchmark += Glob('benchmark/NEON/*/' + filter_pattern) + files_benchmark += Glob('benchmark/NEON/' + filter_pattern) - files_validation += Glob('validation/NEON/*/*.cpp') - files_validation += Glob('validation/NEON/*.cpp') + files_validation += Glob('validation/NEON/*/' + filter_pattern) + files_validation += Glob('validation/NEON/' + filter_pattern) if env['os'] == 'android': test_env.Append(LIBS = ["log"]) -- cgit v1.2.1