From 97e216ff09fbbfc6bf7a015c16836d36c982a3b5 Mon Sep 17 00:00:00 2001 From: Mark Koh Date: Mon, 19 Aug 2024 08:16:41 -0600 Subject: [PATCH] Add build dir for cmake --- .github/workflows/all.yml | 8 ++------ .gitignore | 3 ++- CONTRIBUTING.md | 5 +---- cpp/CMakeLists.txt | 3 ++- cpp/build/.gitkeep | 0 cpp/test/CMakeLists.txt | 4 ++++ 6 files changed, 11 insertions(+), 12 deletions(-) create mode 100644 cpp/build/.gitkeep diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index 0d941b7a..28dc7285 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -249,12 +249,8 @@ jobs: - name: Install CMake (Ubuntu) if: matrix.os == 'ubuntu-latest' run: sudo apt-get install -y cmake - - name: Configure CMake - run: cmake . - - name: Build with CMake - run: make - - name: Run Tests (if any) - run: cat Makefile + - name: Run tests + run: make test build-python-wheels: needs: [run-python-tests, run-python-tests-with-address-sanitizer] diff --git a/.gitignore b/.gitignore index 329081d5..9ef598ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.egg-info/ -build/ +*/build/* +# !build/.gitkeep dist/ tmp/ __pycache__/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c06e7e97..2ef187e9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,8 +67,7 @@ To build the C++ library with `cmake`, use the following commands: ```shell cd cpp git submodule update --init --recursive -cmake . -make +make build ``` ## Testing @@ -114,8 +113,6 @@ To run the C++ tests, use the following commands: ```shell cd cpp git submodule update --init --recursive -cmake . -make make test ``` diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 7a4607bf..4208d3eb 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -16,6 +16,8 @@ if (MSVC) string(REGEX REPLACE "/RTC1" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() +enable_testing() + add_subdirectory(include) add_subdirectory(src) add_subdirectory(test) @@ -37,4 +39,3 @@ add_custom_target(format COMMENT "Running C++ formatter" ) -enable_testing() diff --git a/cpp/build/.gitkeep b/cpp/build/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index c5598640..adde8751 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -15,3 +15,7 @@ target_link_libraries(VoyagerTests # Add the tests add_test(NAME VoyagerTests COMMAND VoyagerTests) + +# Discover tests using Doctest +include(${CMAKE_SOURCE_DIR}/include/doctest/scripts/cmake/doctest.cmake) +doctest_discover_tests(VoyagerTests)