summaryrefslogtreecommitdiff
path: root/tests/SCsub
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-07-26 15:53:01 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-07-26 16:03:11 +0200
commita3a980eb0d026d1086b65d5c33f2ec7dd63ff742 (patch)
treeff9a2cc0cb8c043b00225153cb54c244df0a8b13 /tests/SCsub
parentdf6f867806cd450f757a023e5e78adbf80246bc2 (diff)
SCons: Build tests/ and main/ in cloned environments
Allows switching `tests=yes`/`no` and rebuilding only tests and main, instead of the whole engine. Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
Diffstat (limited to 'tests/SCsub')
-rw-r--r--tests/SCsub10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/SCsub b/tests/SCsub
index cb1d35b12f..9c32eb8ec3 100644
--- a/tests/SCsub
+++ b/tests/SCsub
@@ -3,7 +3,13 @@
Import("env")
env.tests_sources = []
-env.add_source_files(env.tests_sources, "*.cpp")
-lib = env.add_library("tests", env.tests_sources)
+env_tests = env.Clone()
+
+# Enable test framework and inform it of configuration method.
+env_tests.Append(CPPDEFINES=["DOCTEST_CONFIG_IMPLEMENT"])
+
+env_tests.add_source_files(env.tests_sources, "*.cpp")
+
+lib = env_tests.add_library("tests", env.tests_sources)
env.Prepend(LIBS=[lib])