File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -91,18 +91,18 @@ include_directories(
91
91
92
92
install (DIRECTORY include DESTINATION include )
93
93
94
+ if (BUILD_TESTS )
95
+ # Set JSONNET_BIN variable required for regression tests.
96
+ file (TO_NATIVE_PATH ${GLOBAL_OUTPUT_PATH} /jsonnet JSONNET_BIN )
97
+ endif ()
98
+
94
99
add_subdirectory (stdlib )
95
100
add_subdirectory (third_party/md5 )
96
101
add_subdirectory (core )
97
102
add_subdirectory (cmd )
98
103
add_subdirectory (test_suite )
99
104
100
105
if (BUILD_TESTS )
101
- # Set JSONNET_CMD variable required for regression tests.
102
- file (TO_NATIVE_PATH ${GLOBAL_OUTPUT_PATH} /jsonnet JSONNET_CMD )
103
- set (CTEST_ENVIRONMENT
104
- "JSONNET_CMD=${JSONNET_CMD} " )
105
-
106
106
# s`run_tests` target builds and runs all tests. The cmake-generated `test`
107
107
# target runs tests without building them.
108
108
add_custom_target (run_tests COMMAND ${CMAKE_CTEST_COMMAND}
@@ -111,3 +111,5 @@ if (BUILD_TESTS)
111
111
)
112
112
113
113
endif ()
114
+
115
+
Original file line number Diff line number Diff line change @@ -2,10 +2,16 @@ find_program(BASH bash)
2
2
if (BASH STREQUAL "BASH-NOTFOUND" )
3
3
message (WARNING "Bash not found, can't run regression tests." )
4
4
else ()
5
- # Note: this test relies on the JSONNET_CMD environment variable, which
5
+ # Note: this test relies on the JSONNET_BIN variable, which
6
6
# is set in the root CMakeLists.txt.
7
+ message ( "Testing with Jsonnet executable: ${JSONNET_BIN} " )
7
8
add_test (
8
9
NAME regression_test
9
10
COMMAND ${BASH} ${CMAKE_CURRENT_SOURCE_DIR} /run_tests.sh
10
11
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR} " )
11
- endif ()
12
+ set_tests_properties (
13
+ regression_test
14
+ PROPERTIES
15
+ ENVIRONMENT JSONNET_BIN=${JSONNET_BIN} )
16
+
17
+ endif ()
You can’t perform that action at this time.
0 commit comments