aboutsummaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2024-06-15 15:40:31 +0200
committer Spartan322 <Megacake1234@gmail.com>2024-06-22 13:57:49 +0200
commit1a694a8b26a441b12547057d6e0be61a111cced3 (patch)
tree51ca6d5948e92be37b9ee6674cb96801d2cd03f8 /SConstruct
parent8b623bf4087aa360842ad31145d4ab6946cee9aa (diff)
Add unit testsadd/unit-testing
Make github action tests run explicit Fix dropping annotation list for Errors Fix potential empty get_errors crashes Fix incorrect csv error behavior Add use_sep for `LineObject` and `std::vector<LineObject>` Remove constexpr of load_from_buffer and load_from_string for parsers Add snitch-org/snitch@d6632123cc8d13bdbc5cd60fd6741b9e0f635e82 Make versioned submodules ignore dirty Add tests/bin/* to gitignore
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct9
1 files changed, 8 insertions, 1 deletions
diff --git a/SConstruct b/SConstruct
index 23b2d9d..05547c5 100644
--- a/SConstruct
+++ b/SConstruct
@@ -14,7 +14,8 @@ env.PrependENVPath("PATH", os.getenv("PATH"))
opts = env.SetupOptions()
-opts.Add(BoolVariable(key="build_ovdl_library", help="Build the openvic dataloader library.", default=env.get("build_ovdl_library", not env.is_standalone)))
+opts.Add(BoolVariable("run_ovdl_tests", "Build and run the openvic dataloader tests", env.is_standalone))
+opts.Add(BoolVariable("build_ovdl_library", "Build the openvic dataloader library.", env.get("build_ovdl_library", not env.is_standalone)))
opts.Add(BoolVariable("build_ovdl_headless", "Build the openvic dataloader headless executable", env.is_standalone))
env.FinalizeOptions()
@@ -56,6 +57,9 @@ library_name = "libopenvic-dataloader{}{}".format(suffix, env["LIBSUFFIX"])
default_args = []
+if env["run_ovdl_tests"]:
+ env["build_ovdl_library"] = True
+
if env["build_ovdl_library"]:
library = env.StaticLibrary(target=os.path.join(BINDIR, library_name), source=sources)
default_args += [library]
@@ -86,6 +90,9 @@ if env["build_ovdl_headless"]:
)
default_args += [headless_program]
+if env["run_ovdl_tests"]:
+ SConscript("tests/SCsub", "env")
+
# Add compiledb if the option is set
if env.get("compiledb", False):
default_args += ["compiledb"]