@@ -10,7 +10,8 @@ env.PrependENVPath("PATH", os.getenv("PATH"))
1010
1111opts = env .SetupOptions ()
1212
13- opts .Add (BoolVariable ("run_ovdl_tests" , "Build and run the openvic dataloader tests" , env .is_standalone ))
13+ opts .Add (BoolVariable ("build_ovdl_tests" , "Build and run the openvic dataloader tests" , env .is_standalone ))
14+ opts .Add (BoolVariable ("run_ovdl_tests" , "Run the openvic dataloader tests" , False ))
1415opts .Add (
1516 BoolVariable (
1617 "build_ovdl_library" ,
@@ -68,6 +69,9 @@ library_name = "libopenvic-dataloader{}{}".format(suffix, env["LIBSUFFIX"])
6869default_args = []
6970
7071if env ["run_ovdl_tests" ]:
72+ env ["build_ovdl_tests" ] = True
73+
74+ if env ["build_ovdl_tests" ]:
7175 env ["build_ovdl_library" ] = True
7276
7377if env ["build_ovdl_library" ]:
@@ -100,8 +104,11 @@ if env["build_ovdl_headless"]:
100104 )
101105 default_args += [headless_program ]
102106
103- if env ["run_ovdl_tests" ]:
104- SConscript ("tests/SCsub" , "env" )
107+ if env ["build_ovdl_tests" ]:
108+ tests_env = SConscript ("tests/SCsub" , "env" )
109+
110+ if env ["run_ovdl_tests" ]:
111+ tests_env .RunUnitTest ()
105112
106113# Add compiledb if the option is set
107114if env .get ("compiledb" , False ):
0 commit comments