Skip to content

Commit

Permalink
use ctest to simplify command line and working-directory
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhomm committed Jul 8, 2023
1 parent 4e5f29f commit 11d54b0
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 27 deletions.
50 changes: 30 additions & 20 deletions .github/workflows/pull_request_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ jobs:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -I${EIGEN_PATH}" ../
make
- name: Test
- name: Tests
run: |
./build/test/EigenRand-test
- name: Run Accuracy
ctest -R test
working-directory: build
- name: Accuracy
run: |
./build/EigenRand-accuracy
ctest -R accuracy
working-directory: build

build_linux_avx512:
name: Build for linux AVX512
Expand Down Expand Up @@ -68,12 +70,14 @@ jobs:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -mavx512f -mfma -I${EIGEN_PATH}" ../
make
- name: Test
- name: Tests
run: |
./build/test/EigenRand-test
- name: Run Accuracy
ctest -R test
working-directory: build
- name: Accuracy
run: |
./build/EigenRand-accuracy
ctest -R accuracy
working-directory: build

build_macos:
name: Build for macOS
Expand All @@ -100,12 +104,14 @@ jobs:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -I${EIGEN_PATH}" ../
make
- name: Test
- name: Tests
run: |
./build/test/EigenRand-test
- name: Run Accuracy
ctest -R test
working-directory: build
- name: Accuracy
run: |
./build/EigenRand-accuracy
ctest -R accuracy
working-directory: build

build_windows:
name: Build for Windows
Expand Down Expand Up @@ -136,12 +142,14 @@ jobs:
cmakeAppendedArgs: -G"Visual Studio 16 2019" -Ax64 -DEIGENRAND_CXX_FLAGS="${{ matrix.arch }} /I${{ env.EIGEN_PATH }}"
buildWithCMakeArgs: --config Release
buildDirectory: build
- name: Test
- name: Tests
run: |
.\build\test\Release\EigenRand-test.exe
- name: Run Accuracy
ctest -R test
working-directory: build
- name: Accuracy
run: |
.\build\Release\EigenRand-accuracy.exe
ctest -R accuracy
working-directory: build

build_windows_avx512:
name: Build for Windows
Expand Down Expand Up @@ -171,12 +179,14 @@ jobs:
cmakeAppendedArgs: -G"Visual Studio 16 2019" -Ax64 -DEIGENRAND_CXX_FLAGS="${{ matrix.arch }} /I${{ env.EIGEN_PATH }}"
buildWithCMakeArgs: --config Release
buildDirectory: build
- name: Test
- name: Tests
run: |
.\build\test\Release\EigenRand-test.exe
- name: Run Accuracy
ctest -R test
working-directory: build
- name: Accuracy
run: |
.\build\Release\EigenRand-accuracy.exe
ctest -R accuracy
working-directory: build

reference:
name: Reference
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_test_non_x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ jobs:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DEIGENRAND_CXX_FLAGS="-${{ matrix.arch }} -I${EIGEN_PATH}" ../
make
./test/EigenRand-test
./EigenRand-accuracy 256
ctest -R test
ctest -R accuracy
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,10 @@ set(ITEMS
)
foreach(app ${ITEMS})
get_filename_component(app_name ${app} NAME_WE)
string(TOLOWER ${app_name} app_name_lower)
# string(TOLOWER ${PROJECT_NAME} project_name_lower)
add_executable(${project_name}-${app_name_lower} ${app})
target_link_libraries(${project_name}-${app_name_lower} PRIVATE eigenrand)
install(TARGETS ${project_name}-${app_name_lower} DESTINATION bin)
add_executable(${PROJECT_NAME}-${app_name} ${app})
target_link_libraries(${PROJECT_NAME}-${app_name} PRIVATE eigenrand)
install(TARGETS ${PROJECT_NAME}-${app_name} DESTINATION bin)
add_test(NAME ${PROJECT_NAME}-${app_name} COMMAND ${PROJECT_NAME}-${app_name})
endforeach()


Expand Down

0 comments on commit 11d54b0

Please sign in to comment.