diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..3676697 --- /dev/null +++ b/test.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +# remove old build if any +if [ -f "app/gyt" ]; then + rm -rf app/gyt +fi + +# Print the selected build type +echo "Selected build type: $BUILD_TYPE" +echo "Building the project... This will take a while to install dependencies for the first time." + +# Run CMake with the selected build type +cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DBUILD_TESTS=ON -G Ninja + +# Build the project +ninja + +# Tests +ctest + +# symlink - so I can run it like gyt [arguments....] +sudo rm /usr/local/bin/gyt +sudo ln -s "$(pwd)/app/gyt" /usr/local/bin/gyt diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 32de245..54f1805 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(tests tests.cpp repository_t.cpp) target_include_directories(tests PUBLIC ../ext) -target_link_libraries(tests PUBLIC repository) +target_link_libraries(tests PUBLIC boost_libraries repository) # allow user to run tests with `make test` or `ctest` include(../cmake/Catch.cmake)