Repository: DGtal-team/DGtal (language: python)

Issue:
Reactivate unit-test on windows
Commented at this point in the GitHub scripts. Only the build is performed.

(Find executable issue)


Discussion / hints:
I suppose that it is related to the window \ interpretation in path ? 
If I remember correctly, it was due to duplicate objects generated by VS. 
we should probably have a look to that on a dedicated PR

Fix patch:
diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml
index 9b2f6ed0af..9c091408b1 100644
--- a/.github/workflows/build-master.yml
+++ b/.github/workflows/build-master.yml
@@ -94,6 +94,14 @@ jobs:
            echo ctest -C ${{ matrix.BUILD_TYPE }}  --output-on-failure -E $TESTBLACKLIST
            ctest -C $${{ matrix.BUILD_TYPE }}  --output-on-failure -E $TESTBLACKLIST
 
+     - name: Test
+       working-directory: ${{runner.workspace}}/build
+       if: matrix.os == 'windows-latest' 
+       shell: bash
+       run: |
+           echo ctest -C ${{ matrix.BUILD_TYPE }}  --output-on-failure -E $TESTBLACKLIST
+           ctest -C ${{ matrix.BUILD_TYPE }} --output-on-failure -E $TESTBLACKLIST  
+
 
      - name: DGtalTools (linux only, we check this PR against DGtalTools master)
        if: matrix.os == 'ubuntu-latest'
diff --git a/.github/workflows/buildAndDocumentation-PR.yml b/.github/workflows/buildAndDocumentation-PR.yml
index 58a828c844..cee894547a 100644
--- a/.github/workflows/buildAndDocumentation-PR.yml
+++ b/.github/workflows/buildAndDocumentation-PR.yml
@@ -94,6 +94,14 @@ jobs:
            echo ctest -C ${{ matrix.BUILD_TYPE }}  --output-on-failure -E $TESTBLACKLIST
            ctest -C $${{ matrix.BUILD_TYPE }}  --output-on-failure -E $TESTBLACKLIST
 
+     - name: Test
+       working-directory: ${{runner.workspace}}/build
+       if: matrix.os == 'windows-latest' 
+       shell: bash
+       run: |
+           echo ctest -C ${{ matrix.BUILD_TYPE }}  --output-on-failure -E $TESTBLACKLIST
+           ctest -C ${{ matrix.BUILD_TYPE }} --output-on-failure -E $TESTBLACKLIST  
+
 
      - name: DGtalTools (linux only, we check this PR against DGtalTools master)
        if: matrix.os == 'ubuntu-latest'
diff --git a/ChangeLog.md b/ChangeLog.md
index 039eb86f23..bcfe263b7d 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -39,6 +39,8 @@
 
 ## Bug fixes
 - *General*
+  - Activate and fix CTest tests on windows system. (Bertrand Kerautret,
+    [#1706](https://github.com/DGtal-team/DGtal/pull/1706))
   - For now, removing Cairo deps install on windows (6hours long build 
     with conan in the windows debug mode). (David Coeurjolly, 
     [#1705](https://github.com/DGtal-team/DGtal/pull/1705))


Test patch:
diff --git a/tests/TestFunctions.cmake b/tests/TestFunctions.cmake
index 2d5ad20cd6..31f2a81ee3 100644
--- a/tests/TestFunctions.cmake
+++ b/tests/TestFunctions.cmake
@@ -8,7 +8,7 @@ function(DGtal_add_test test_file) #optional_avoid_add_test
     target_include_directories(${test_file} PRIVATE ${PROJECT_SOURCE_DIR}/tests/)
     target_include_directories(${test_file} PRIVATE ${PROJECT_BINARY_DIR}/tests/)
     if(NOT ${ARGC} GREATER 1)
-      add_test(${test_file} ${test_file})
+      add_test(NAME ${test_file} COMMAND ${test_file})
     endif()
   endif()
 endfunction()