Skip to content

Commit

Permalink
added CI platforms
Browse files Browse the repository at this point in the history
	Fix clang buil
	skipped doctest stage for disabled
  • Loading branch information
NMuleo committed Nov 6, 2024
1 parent 8594618 commit 83165fa
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,27 @@ jobs:
matrix:
platform:
- { name: Ubuntu GCC, os: ubuntu-latest, publish: true, compiler: g++, arch: "64", build: "ubuntu64-libstdc++-static", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS='--coverage' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu GCC disabled, os: ubuntu-latest, publish: true, compiler: g++, arch: "64", build: "ubuntu64-libstdc++-static", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS='--coverage' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev -DSNITCH_ENABLE=OFF"}
- { name: Ubuntu GCC noexcept, os: ubuntu-latest, publish: false, compiler: g++, arch: "64", build: "ubuntu64-libstdc++-static-noexcept", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_FLAGS='-fno-exceptions' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu GCC notime, os: ubuntu-latest, publish: false, compiler: g++, arch: "64", build: "ubuntu64-libstdc++-static-notime", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DSNITCH_WITH_TIMINGS=0 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu GCC nounity, os: ubuntu-latest, publish: false, compiler: g++, arch: "64", build: "ubuntu64-libstdc++-static-nounity", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DSNITCH_UNITY_BUILD=0 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu GCC header-only, os: ubuntu-latest, publish: true, compiler: g++, arch: "64", build: "header-only", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DSNITCH_HEADER_ONLY=1 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu GCC shared, os: ubuntu-latest, publish: false, compiler: g++, arch: "64", build: "ubuntu64-libstdc++-shared", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=g++ -DBUILD_SHARED_LIBS=1 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu Clang, os: ubuntu-latest, publish: true, compiler: clang++, arch: "64", build: "ubuntu64-libc++-static", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu Clang noexcept, os: ubuntu-latest, publish: false, compiler: clang++, arch: "64", build: "ubuntu64-libc++-static-noexcept", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++ -fno-exceptions' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Ubuntu Clang disabled, os: ubuntu-latest, publish: true, compiler: clang++, arch: "64", build: "ubuntu64-libc++-static", cmakepp: "", flags: "-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS='-stdlib=libc++' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev -DSNITCH_ENABLE=OFF"}
- { name: Windows 32, os: windows-latest, publish: true, compiler: vs2019, arch: "32", build: "win32-vs2019-static", cmakepp: "", flags: "-A Win32 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Windows 32 disable, os: windows-latest, publish: true, compiler: vs2019, arch: "32", build: "win32-vs2019-static", cmakepp: "", flags: "-A Win32 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev -DSNITCH_ENABLE=OFF"}
- { name: Windows 64, os: windows-latest, publish: true, compiler: vs2019, arch: "64", build: "win64-vs2019-static", cmakepp: "", flags: "-A x64 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Windows 64 noexcept, os: windows-latest, publish: false, compiler: vs2019, arch: "64", build: "win64-vs2019-static-noexcept", cmakepp: "", flags: "-A x64 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Windows 64 shared, os: windows-latest, publish: false, compiler: vs2019, arch: "64", build: "win64-vs2019-shared", cmakepp: "", flags: "-A x64 -DBUILD_SHARED_LIBS=1 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: Windows 64 disable, os: windows-latest, publish: true, compiler: vs2019, arch: "64", build: "win64-vs2019-static", cmakepp: "", flags: "-A x64 --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev -DSNITCH_ENABLE=OFF"}
- { name: MacOS, os: macos-latest, publish: true, compiler: clang++, arch: "64", build: "osx-libc++-static", cmakepp: "", flags: "--warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: MacOS noexcept, os: macos-latest, publish: false, compiler: clang++, arch: "64", build: "osx-libc++-static-noexcept", cmakepp: "", flags: "-DCMAKE_CXX_FLAGS='-fno-exceptions' --warn-uninitialized -Wdev -Wno-deprecated -Werror=dev"}
- { name: MacOS disable, os: macos-latest, publish: true, compiler: clang++, arch: "64", build: "osx-libc++-static", cmakepp: "", flags: "--warn-uninitialized -Wdev -Wno-deprecated -Werror=dev -DSNITCH_ENABLE=OFF"}
- { name: WebAssembly, os: ubuntu-latest, publish: true, compiler: em++, arch: "32", build: "wasm32", cmakepp: "emcmake", flags: "-DCMAKE_CXX_FLAGS='-s DISABLE_EXCEPTION_CATCHING=0' -DCMAKE_CROSSCOMPILING_EMULATOR=node"}
- { name: WebAssembly noexcept, os: ubuntu-latest, publish: false, compiler: em++, arch: "32", build: "wasm32-noexcept", cmakepp: "emcmake", flags: "-DCMAKE_CXX_FLAGS='-fno-exceptions' -DCMAKE_CROSSCOMPILING_EMULATOR=node"}
- { name: WebAssembly disable, os: ubuntu-latest, publish: true, compiler: em++, arch: "32", build: "wasm32", cmakepp: "emcmake", flags: "-DCMAKE_CXX_FLAGS='-s DISABLE_EXCEPTION_CATCHING=0' -DCMAKE_CROSSCOMPILING_EMULATOR=node -DSNITCH_ENABLE=OFF"}
build-type:
- Release
- Debug
Expand Down Expand Up @@ -161,19 +167,20 @@ jobs:
- name: Test (with doctest)
# A bug in Node.js/V8 prevents these tests from running in Debug config for WebAssembly.
# https://bugs.chromium.org/p/v8/issues/detail?id=13961
if: ${{!(matrix.platform.compiler == 'em++' && matrix.build-type == 'Debug')}}
if: ${{!(matrix.platform.compiler == 'em++' && matrix.build-type == 'Debug') && !contains(matrix.platform.flags, '-DSNITCH_ENABLE=OFF')}}
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{matrix.build-type}} --target snitch_runtime_tests_run

- name: Test (with snitch)
if: ${{!contains(matrix.platform.flags, '-DSNITCH_ENABLE=OFF')}}
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{matrix.build-type}} --target snitch_runtime_tests_self_run

- name: Approval tests (with doctest)
# Approval tests only run on "default" library configuration, which happens to be the published one
if: matrix.platform.publish
if: ${{matrix.platform.publish && !contains(matrix.platform.flags, '-DSNITCH_ENABLE=OFF')}}
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{matrix.build-type}} --target snitch_approval_tests_run
Expand Down
7 changes: 6 additions & 1 deletion tests/runtime_tests/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,12 @@ TEST_CASE("require throws matches", "[test macros]") {
}

namespace {
[[nodiscard]] int nodiscard_function() {
#if SNITCH_ENABLE
[[nodiscard]]
#else
[[maybe_unused]]
#endif
int nodiscard_function() {
return 1;
}
} // namespace
Expand Down
3 changes: 3 additions & 0 deletions tests/runtime_tests/function_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
namespace {
std::size_t test_object_instances = 0u;
bool function_called = false;
#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
int return_value = 0u;

struct test_object {
Expand Down
12 changes: 12 additions & 0 deletions tests/runtime_tests/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,28 @@ bool configure_called = false;
bool report_called = false;
bool finish_called = false;

#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
void init(snitch::registry&) noexcept {
init_called = true;
}
#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
bool configure(snitch::registry&, std::string_view, std::string_view) noexcept {
configure_called = true;
return configure_result;
}
#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
void report(const snitch::registry&, const snitch::event::data&) noexcept {
report_called = true;
}
#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
void finish(snitch::registry&) noexcept {
finish_called = true;
}
Expand Down
6 changes: 6 additions & 0 deletions tests/runtime_tests/string_utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ struct frob {
void knob() {}
};

#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
void foo() {}

using function_ptr_type = void (*)();
Expand Down Expand Up @@ -1043,6 +1046,9 @@ constexpr filter_result EE = {.included = false, .implicit = false};
constexpr filter_result II = {.included = true, .implicit = true};
constexpr filter_result IE = {.included = false, .implicit = true};

#if !SNITCH_ENABLE
[[maybe_unused]]
#endif
bool operator==(const filter_result& first, const filter_result& second) noexcept {
return first.included == second.included && first.implicit == second.implicit;
}
Expand Down

0 comments on commit 83165fa

Please sign in to comment.