aboutsummaryrefslogtreecommitdiff
path: root/tests/SConscript
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-09-14 11:58:05 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commit3b6cdbb91f3810e13097a98a7bbf24771f6dc61f (patch)
treebebb06587b669fd879c033ec48444136037ae369 /tests/SConscript
parent16934a511ccd37a28000a9fabb3e6e5fc6f51ec9 (diff)
downloadComputeLibrary-3b6cdbb91f3810e13097a98a7bbf24771f6dc61f.tar.gz
COMPMID-1587: Automatically build examples from the 3rdparty/examples folder
Change-Id: I472125bf567f998ed0fee6d84456ad61f57cf217 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/148447 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: bsgcomp <bsgcomp@arm.com>
Diffstat (limited to 'tests/SConscript')
-rw-r--r--tests/SConscript49
1 files changed, 25 insertions, 24 deletions
diff --git a/tests/SConscript b/tests/SConscript
index 669e811a13..1fed6ca0db 100644
--- a/tests/SConscript
+++ b/tests/SConscript
@@ -184,33 +184,34 @@ if test_env['validation_tests']:
#FIXME: Remove before release!
if test_env['benchmark_examples']:
files_benchmark_examples = test_env.Object('benchmark_examples/RunExample.cpp')
+ graph_utils = test_env.Object(source="../utils/GraphUtils.cpp", target="GraphUtils")
+ graph_params = test_env.Object(source="../utils/CommonGraphOptions.cpp", target="CommonGraphOptions")
arm_compute_benchmark_examples = []
- if test_env['neon']:
- for file in Glob("../examples/neon_*.cpp"):
- example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0])
- arm_compute_benchmark_examples += [ test_env.Program(example, [ test_env.Object(source=file, target=example) ] + files_benchmark_examples) ]
- if test_env['opencl']:
- cl_examples = []
- files = Glob("../examples/cl_*.cpp")
+ for examples_folder in [ "../examples", "../3rdparty/examples"]:
if test_env['neon']:
- files += Glob("../examples/neoncl_*.cpp")
- for file in files:
- example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0])
- cl_examples += [ test_env.Program(example, [ test_env.Object(source=file, target=example) ] + files_benchmark_examples, LIBS = test_env["LIBS"]) ]
- arm_compute_benchmark_examples += cl_examples
+ for file in Glob("%s/neon_*.cpp" % examples_folder):
+ example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0])
+ arm_compute_benchmark_examples += [ test_env.Program(example, [ test_env.Object(source=file, target=example) ] + files_benchmark_examples) ]
+ if test_env['opencl']:
+ cl_examples = []
+ files = Glob("%s/cl_*.cpp" % examples_folder)
+ if test_env['neon']:
+ files += Glob("%s/neoncl_*.cpp" % examples_folder)
+ for file in files:
+ example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0])
+ cl_examples += [ test_env.Program(example, [ test_env.Object(source=file, target=example) ] + files_benchmark_examples, LIBS = test_env["LIBS"]) ]
+ arm_compute_benchmark_examples += cl_examples
- # Graph examples
- graph_utils = test_env.Object(source="../utils/GraphUtils.cpp", target="GraphUtils")
- graph_params = test_env.Object(source="../utils/CommonGraphOptions.cpp", target="CommonGraphOptions")
- for file in Glob("../examples/graph_*.cpp"):
- example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0])
- if env['os'] in ['android', 'bare_metal'] or env['standalone']:
- prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils, graph_params]+ files_benchmark_examples, LIBS = test_env["LIBS"], LINKFLAGS=test_env["LINKFLAGS"]+['-Wl,--whole-archive',arm_compute_lib,'-Wl,--no-whole-archive'])
- arm_compute_benchmark_examples += [ prog ]
- else:
- #-Wl,--allow-shlib-undefined: Ignore dependencies of dependencies
- prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils, graph_params]+ files_benchmark_examples, LIBS = test_env["LIBS"] + ["arm_compute_graph"], LINKFLAGS=test_env["LINKFLAGS"]+['-Wl,--allow-shlib-undefined'] )
- arm_compute_benchmark_examples += [ prog ]
+ # Graph examples
+ for file in Glob("%s/graph_*.cpp" % examples_folder ):
+ example = "benchmark_" + os.path.basename(os.path.splitext(str(file))[0])
+ if env['os'] in ['android', 'bare_metal'] or env['standalone']:
+ prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils, graph_params]+ files_benchmark_examples, LIBS = test_env["LIBS"], LINKFLAGS=test_env["LINKFLAGS"]+['-Wl,--whole-archive',arm_compute_lib,'-Wl,--no-whole-archive'])
+ arm_compute_benchmark_examples += [ prog ]
+ else:
+ #-Wl,--allow-shlib-undefined: Ignore dependencies of dependencies
+ prog = test_env.Program(example, [ test_env.Object(source=file, target=example), graph_utils, graph_params]+ files_benchmark_examples, LIBS = test_env["LIBS"] + ["arm_compute_graph"], LINKFLAGS=test_env["LINKFLAGS"]+['-Wl,--allow-shlib-undefined'] )
+ arm_compute_benchmark_examples += [ prog ]
Depends(arm_compute_benchmark_examples, arm_compute_test_framework)
Depends(arm_compute_benchmark_examples, arm_compute_lib)
Default(arm_compute_benchmark_examples)