From 4678037901a4ace40f5523aa8d61a70937ce0eb8 Mon Sep 17 00:00:00 2001 From: Thomas Ibanez Date: Wed, 11 Dec 2024 15:31:42 +0100 Subject: [PATCH 1/8] uncomment test part --- .github/workflows/cmake.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 6e099158..81d01bc0 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -65,10 +65,10 @@ jobs: # Execute the build. You can specify a specific target with "--target " run: cmake --build . --config $BUILD_TYPE - #- name: Test - # working-directory: ${{runner.workspace}}/build - # shell: bash + - name: Test + working-directory: ${{runner.workspace}}/build + shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - # run: ctest -C $BUILD_TYPE + run: ctest -C $BUILD_TYPE From f9d81df01df7c0f9e8adf4ce5779b954e15bfba1 Mon Sep 17 00:00:00 2001 From: Thomas Ibanez Date: Wed, 11 Dec 2024 15:44:42 +0100 Subject: [PATCH 2/8] enable_testing() --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02ee6fc3..358b7855 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20") set(CMAKE_CXX_STANDARD 20) include(cmake/fetch_dependencies.cmake) - +enable_testing() set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) From f35f20c586d3632115ae29cb1bbb639c16f1a1e1 Mon Sep 17 00:00:00 2001 From: Thomas Ibanez Date: Wed, 11 Dec 2024 15:57:26 +0100 Subject: [PATCH 3/8] output on failure --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 81d01bc0..43a32e9d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -70,5 +70,5 @@ jobs: shell: bash # Execute tests defined by the CMake configuration. # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C $BUILD_TYPE + run: ctest -C $BUILD_TYPE --rerun-failed --output-on-failure From a5a8d4b381038f5aed919e923bcb8db4dce42850 Mon Sep 17 00:00:00 2001 From: Thomas Ibanez Date: Wed, 11 Dec 2024 16:21:00 +0100 Subject: [PATCH 4/8] list files for debugging --- ICE/IO/test/CMakeLists.txt | 4 +--- ICE/IO/test/MeshLoaderTest.cpp | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ICE/IO/test/CMakeLists.txt b/ICE/IO/test/CMakeLists.txt index c7b5c2c3..98df48c0 100644 --- a/ICE/IO/test/CMakeLists.txt +++ b/ICE/IO/test/CMakeLists.txt @@ -31,6 +31,4 @@ target_link_libraries(MeshLoaderTestSuite gtest_main io) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/cube.obj DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - - +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/cube.obj DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) \ No newline at end of file diff --git a/ICE/IO/test/MeshLoaderTest.cpp b/ICE/IO/test/MeshLoaderTest.cpp index fa627107..3012b500 100644 --- a/ICE/IO/test/MeshLoaderTest.cpp +++ b/ICE/IO/test/MeshLoaderTest.cpp @@ -1,11 +1,13 @@ +#include #include #include "MeshLoader.h" -#include using namespace ICE; TEST(MeshLoaderTest, LoadFromObj) { + for (const auto &entry : std::filesystem::directory_iterator(".")) + std::cout << entry.path() << std::endl; auto gr_f = std::make_shared(); auto mesh = MeshLoader(gr_f).load({"cube.obj"}); EXPECT_EQ(mesh->getVertices().size(), 24); From cde21583c2dd17112360145c73122274a9324445 Mon Sep 17 00:00:00 2001 From: Thomas Ibanez Date: Wed, 11 Dec 2024 16:41:25 +0100 Subject: [PATCH 5/8] replace file copy to post build command --- ICE/IO/test/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ICE/IO/test/CMakeLists.txt b/ICE/IO/test/CMakeLists.txt index 98df48c0..7645a855 100644 --- a/ICE/IO/test/CMakeLists.txt +++ b/ICE/IO/test/CMakeLists.txt @@ -31,4 +31,9 @@ target_link_libraries(MeshLoaderTestSuite gtest_main io) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/cube.obj DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) \ No newline at end of file +add_custom_command( + TARGET MeshLoaderTestSuite POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/cube.obj" + "${CMAKE_CURRENT_BINARY_DIR}" +) \ No newline at end of file From ba369a755591897a16d42265fbda71679d18a78f Mon Sep 17 00:00:00 2001 From: ProtectedVariable Date: Wed, 11 Dec 2024 21:47:47 +0100 Subject: [PATCH 6/8] debug --- ICE/IO/test/CMakeLists.txt | 6 +++++- ICE/IO/test/MeshLoaderTest.cpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ICE/IO/test/CMakeLists.txt b/ICE/IO/test/CMakeLists.txt index 7645a855..343f1612 100644 --- a/ICE/IO/test/CMakeLists.txt +++ b/ICE/IO/test/CMakeLists.txt @@ -36,4 +36,8 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cube.obj" "${CMAKE_CURRENT_BINARY_DIR}" -) \ No newline at end of file +) +message(INFO ${CMAKE_CURRENT_SOURCE_DIR}) +message(INFO ${CMAKE_CURRENT_BINARY_DIR}) + + diff --git a/ICE/IO/test/MeshLoaderTest.cpp b/ICE/IO/test/MeshLoaderTest.cpp index 3012b500..a7a8d858 100644 --- a/ICE/IO/test/MeshLoaderTest.cpp +++ b/ICE/IO/test/MeshLoaderTest.cpp @@ -6,6 +6,7 @@ using namespace ICE; TEST(MeshLoaderTest, LoadFromObj) { + std::cout << std::filesystem::current_path() << std::endl; for (const auto &entry : std::filesystem::directory_iterator(".")) std::cout << entry.path() << std::endl; auto gr_f = std::make_shared(); From 210047ca247c1d193a56f0dcd8c2dc5787d092a6 Mon Sep 17 00:00:00 2001 From: ProtectedVariable Date: Wed, 11 Dec 2024 22:11:19 +0100 Subject: [PATCH 7/8] try with generator expr --- ICE/IO/test/CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ICE/IO/test/CMakeLists.txt b/ICE/IO/test/CMakeLists.txt index 343f1612..7a439130 100644 --- a/ICE/IO/test/CMakeLists.txt +++ b/ICE/IO/test/CMakeLists.txt @@ -35,9 +35,6 @@ add_custom_command( TARGET MeshLoaderTestSuite POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cube.obj" - "${CMAKE_CURRENT_BINARY_DIR}" + $ ) -message(INFO ${CMAKE_CURRENT_SOURCE_DIR}) -message(INFO ${CMAKE_CURRENT_BINARY_DIR}) - From 1ee1aeb3455acf04900953736d760c885e242b4d Mon Sep 17 00:00:00 2001 From: ProtectedVariable Date: Wed, 11 Dec 2024 22:27:13 +0100 Subject: [PATCH 8/8] cleanup --- ICE/IO/test/MeshLoaderTest.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/ICE/IO/test/MeshLoaderTest.cpp b/ICE/IO/test/MeshLoaderTest.cpp index a7a8d858..5fe47926 100644 --- a/ICE/IO/test/MeshLoaderTest.cpp +++ b/ICE/IO/test/MeshLoaderTest.cpp @@ -6,9 +6,6 @@ using namespace ICE; TEST(MeshLoaderTest, LoadFromObj) { - std::cout << std::filesystem::current_path() << std::endl; - for (const auto &entry : std::filesystem::directory_iterator(".")) - std::cout << entry.path() << std::endl; auto gr_f = std::make_shared(); auto mesh = MeshLoader(gr_f).load({"cube.obj"}); EXPECT_EQ(mesh->getVertices().size(), 24);