Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Add PYTHONPATH to tests in CMake. Ignore cmake-build-relwithdebinfo. Verbose self-driving tests. #1611

Merged
merged 5 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ cmake_build
.cmake_build
cmake-build-debug
cmake-build-release
cmake-build-relwithdebinfo

# Generated documentation
apidoc/doc
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ add_custom_target(jumbotests
USES_TERMINAL)
add_custom_target(self_driving_e2e_test # For now, this target is specifically used for self-driving pipeline
ctest
--extra-verbose # Print out the test output as it runs.
--resource-spec-file ${BUILD_SUPPORT_DATA_DIR}/ctest_resource_specs.json # For controlling conflicting tests.
${UNITTEST_OUTPUT_ON_FAILURE} # Whether to print output when a test fails.
-j ${NOISEPAGE_TEST_PARALLELISM} # Maximum number of parallel jobs.
Expand Down Expand Up @@ -938,7 +939,10 @@ function(add_noisepage_test
# TODO(WAN): The "modern" gtest_discover_test has a ton of files. Favoring legacy add_test for now...
add_test(${TEST_NAME} ${BUILD_SUPPORT_DIR}/run-test.sh ${CMAKE_BINARY_DIR} test ${TEST_OUTPUT_DIR}/${TEST_NAME})
# Label each test with TEST_LABEL so that ctest can run all the tests under the TEST_LABEL label later.
set_tests_properties(${TEST_NAME} PROPERTIES LABELS "${TEST_LABEL};${TEST_NAME}")
set_tests_properties(${TEST_NAME} PROPERTIES
LABELS "${TEST_LABEL};${TEST_NAME}" # Label the test.
ENVIRONMENT "PYTHONPATH=${PROJECT_SOURCE_DIR}" # Set the PYTHONPATH to project root for self-driving.
)
# Add TEST_NAME as a dependency to TEST_LABEL. Note that TEST_LABEL must be a valid target!
add_dependencies(${TEST_LABEL} ${TEST_NAME})
endfunction()
Expand Down