Skip to content

Commit 62b82e3

Browse files
committed
Skip building tests by default
1 parent 8a0ffd5 commit 62b82e3

File tree

3 files changed

+375
-368
lines changed

3 files changed

+375
-368
lines changed

.evergreen/compile.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ case "$OS" in
4949
;;
5050
esac
5151

52+
5253
cd build
53-
"${cmake_binary}" -G "$GENERATOR" "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" -DMONGOCXX_ENABLE_SLOW_TESTS=ON -DENABLE_UNINSTALL=ON "$@" ..
54+
"${cmake_binary}" -G "$GENERATOR" "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" -DENABLE_TESTS=ON -DMONGOCXX_ENABLE_SLOW_TESTS=ON -DENABLE_UNINSTALL=ON "$@" ..
5455
"${cmake_binary}" --build . --config $BUILD_TYPE -- $CMAKE_BUILD_OPTS
5556
"${cmake_binary}" --build . --config $BUILD_TYPE --target install -- $CMAKE_BUILD_OPTS
5657
"${cmake_binary}" --build . --config $BUILD_TYPE --target $CMAKE_EXAMPLES_TARGET -- $CMAKE_BUILD_OPTS

src/bsoncxx/test/CMakeLists.txt

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
include_directories(
16-
${MONGO_CXX_DRIVER_SOURCE_DIR}/src/third_party/catch/include
17-
)
15+
if (${ENABLE_TESTS})
1816

19-
file (GLOB src_bsoncxx_test_DIST_cpps RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
17+
include_directories(
18+
${MONGO_CXX_DRIVER_SOURCE_DIR}/src/third_party/catch/include
19+
)
2020

21-
add_executable(test_bson
22-
${THIRD_PARTY_SOURCE_DIR}/catch/main.cpp
23-
${src_bsoncxx_test_DIST_cpps}
24-
)
21+
file (GLOB src_bsoncxx_test_DIST_cpps RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
2522

26-
target_link_libraries(test_bson bsoncxx_testing ${libbson_target})
27-
target_include_directories(test_bson PRIVATE ${libbson_include_directories})
28-
target_compile_definitions(test_bson PRIVATE ${libbson_definitions})
23+
add_executable(test_bson
24+
${THIRD_PARTY_SOURCE_DIR}/catch/main.cpp
25+
${src_bsoncxx_test_DIST_cpps}
26+
)
2927

30-
add_test(bson test_bson)
28+
target_link_libraries(test_bson bsoncxx_testing ${libbson_target})
29+
target_include_directories(test_bson PRIVATE ${libbson_include_directories})
30+
target_compile_definitions(test_bson PRIVATE ${libbson_definitions})
3131

32-
set_dist_list (src_bsoncxx_test_DIST
33-
CMakeLists.txt
34-
${src_bsoncxx_test_DIST_cpps}
35-
)
32+
add_test(bson test_bson)
33+
34+
set_dist_list (src_bsoncxx_test_DIST
35+
CMakeLists.txt
36+
${src_bsoncxx_test_DIST_cpps}
37+
)
38+
39+
endif()

0 commit comments

Comments
 (0)