Skip to content

Commit

Permalink
Merge pull request #16 from cschreib/update
Browse files Browse the repository at this point in the history
Refactor tests
  • Loading branch information
cschreib authored Oct 16, 2022
2 parents c82b3cd + f82e691 commit 3b90166
Show file tree
Hide file tree
Showing 43 changed files with 5,075 additions and 5,009 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
fail-fast: false
matrix:
platform:
- { name: Ubuntu GCC, os: ubuntu-latest, compiler: g++, arch: "64", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS=--coverage"}
- { name: Ubuntu Clang, os: ubuntu-latest, compiler: clang++, arch: "64", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS=-stdlib=libc++"}
- { name: Ubuntu GCC, os: ubuntu-latest, compiler: g++, arch: "64", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS='--coverage'"}
- { name: Ubuntu Clang, os: ubuntu-latest, compiler: clang++, arch: "64", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++'"}
- { name: Windows 32, os: windows-latest, compiler: vs2019, arch: "32", cmakepp: "", flags: "-A Win32"}
- { name: Windows 64, os: windows-latest, compiler: vs2019, arch: "64", cmakepp: "", flags: "-A x64"}
- { name: MacOS, os: macos-latest, compiler: clang++, arch: "64", cmakepp: "", flags: ""}
- { name: WebAssembly, os: ubuntu-latest, compiler: em++, arch: "32", cmakepp: "emcmake", flags: "-DCMAKE_CXX_FLAGS=\"-s DISABLE_EXCEPTION_CATCHING=0\" -DCMAKE_CROSSCOMPILING_EMULATOR=node"}
- { name: WebAssembly, os: ubuntu-latest, compiler: em++, arch: "32", cmakepp: "emcmake", flags: "-DCMAKE_CXX_FLAGS='-s DISABLE_EXCEPTION_CATCHING=0' -DCMAKE_CROSSCOMPILING_EMULATOR=node"}
build-type:
- Release
- Debug
Expand Down Expand Up @@ -51,6 +51,14 @@ jobs:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

# GCC 9 has a bug which prevents compilation of the testing framework, so switch to GCC 10.
- name: Setup GCC
if: matrix.platform.compiler == 'g++'
run: |
sudo apt install g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
sudo update-alternatives --set gcc /usr/bin/gcc-10
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build

Expand All @@ -67,11 +75,11 @@ jobs:
- name: Test
shell: bash
working-directory: ${{github.workspace}}/build
run: ctest --output-on-failure
run: cmake --build . --config ${{matrix.build-type}} --target oup_runtime_tests_run

- name: Compute Code Coverage
if: runner.os == 'Linux' && matrix.platform.compiler == 'g++' && matrix.build-type == 'Debug'
run: |
gcov ${{github.workspace}}/build/tests/CMakeFiles/oup_tests.dir/runtime_tests.cpp.gcda
gcov ${{github.workspace}}/build/tests/CMakeFiles/oup_runtime_tests.dir/*.gcda
ls | grep '.gcov' | grep -v observable_unique_ptr | xargs -d"\n" rm
bash <(curl -s https://codecov.io/bash)
Loading

0 comments on commit 3b90166

Please sign in to comment.