Skip to content

Commit 823f75e

Browse files
committed
build: Remove redundant test framework build in SCons
Test framework was being built even though it's not used. This patch changes the build system so that it's only built when the framework is used. Change-Id: Ia3fdc21180e85b3d131a5c6b352a2a5b379cd342 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
1 parent ed7cd0b commit 823f75e

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

tests/SConscript

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
33

4-
# Copyright (c) 2017-2025 Arm Limited.
4+
# Copyright (c) 2017-2026 Arm Limited.
55
#
66
# SPDX-License-Identifier: MIT
77
#
@@ -65,8 +65,9 @@ if not build_test_framework:
6565
else:
6666
SConscript('./framework/SConscript', duplicate=0)
6767

68-
Import("arm_compute_test_framework")
69-
test_env.Append(LIBS = arm_compute_test_framework)
68+
if test_env['validation_tests'] or test_env['benchmark_tests'] or test_env['benchmark_examples'] or test_env['profile']:
69+
Import("arm_compute_test_framework")
70+
test_env.Append(LIBS = arm_compute_test_framework)
7071

7172
# Disable floating-point expression contraction (e.g. fused multiply-add operations)
7273
if not 'windows' in env['os']:

tests/framework/SConscript

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
33

4-
# Copyright (c) 2017-2022, 2024 Arm Limited.
4+
# Copyright (c) 2017-2022, 2024, 2026 Arm Limited.
55
#
66
# SPDX-License-Identifier: MIT
77
#
@@ -95,7 +95,8 @@ if framework_env['HOST_OS'] == 'posix':
9595
#Set up directory for temp files. To prevent permission issue, the temp files are in the same directory with output files
9696
framework_env['TEMPFILEDIR'] = framework_env['build_dir']
9797

98-
arm_compute_test_framework = framework_env.StaticLibrary('arm_compute_test_framework', files)
98+
if framework_env['validation_tests'] or framework_env['benchmark_tests'] or framework_env['benchmark_examples'] or framework_env['profile']:
99+
arm_compute_test_framework = framework_env.StaticLibrary('arm_compute_test_framework', files)
99100

100-
Default(arm_compute_test_framework)
101-
Export('arm_compute_test_framework')
101+
Default(arm_compute_test_framework)
102+
Export('arm_compute_test_framework')

0 commit comments

Comments
 (0)