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 <anthony.barbier@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
diff --git a/tests/SConscript b/tests/SConscript
index 9c9897e..37c96d2 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -30,7 +30,8 @@
 # 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 @@
 
 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"])