]> git.leonardobizzoni.com Git - LBPL/commitdiff
Testing setup master
authorLeonardoBizzoni <leo2002714@gmail.com>
Sun, 15 Sep 2024 17:49:24 +0000 (19:49 +0200)
committerLeonardoBizzoni <leo2002714@gmail.com>
Sun, 15 Sep 2024 17:49:24 +0000 (19:49 +0200)
.envrc [new file with mode: 0644]
CMakeLists.txt
shell.nix

diff --git a/.envrc b/.envrc
new file mode 100644 (file)
index 0000000..1d953f4
--- /dev/null
+++ b/.envrc
@@ -0,0 +1 @@
+use nix
index d53e11553a02107cc92cb6c87af1116fef0bfbf1..09c82047479665c95aa1f2d938a0a8dc2b091c75 100755 (executable)
@@ -19,6 +19,12 @@ add_executable(${PROJECT_NAME} ${SRC})
 set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
 target_compile_definitions(${PROJECT_NAME} PRIVATE ROOTDIR="${CMAKE_SOURCE_DIR}")
 
+# Setup testing environment
+find_package(Catch2 3 REQUIRED)
+file(GLOB_RECURSE TEST_SRC "test/*.cpp" "test/*.hpp")
+add_executable(${PROJECT_NAME}-tests ${TEST_SRC})
+target_link_libraries(${PROJECT_NAME}-tests PRIVATE Catch2::Catch2WithMain)
+
 # Set output directories
 set_target_properties(${PROJECT_NAME} PROPERTIES
                       RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}"
index fe2e96dc7a854911417f03dc5c7b9ddfb5b937ca..77a5843b711e42d58ceee41dfe4b62566aa5c42b 100644 (file)
--- a/shell.nix
+++ b/shell.nix
@@ -5,6 +5,7 @@ pkgs.mkShell {
     man-pages
     man-pages-posix
 
+    catch2_3
     gnumake
     cmake
     seer