Skip to content

Commit

Permalink
Merge pull request #191 from snitch-org/fix
Browse files Browse the repository at this point in the history
Fix build-time reporter toggles and tests
  • Loading branch information
cschreib authored Nov 3, 2024
2 parents 74bdd8e + 8229ea1 commit fe9249d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
if: matrix.build-type == 'Release' && matrix.platform.publish && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: snitch-build
name: snitch-${{matrix.platform.build}}
path: |
${{github.workspace}}/snitch-${{matrix.platform.build}}.zip
4 changes: 2 additions & 2 deletions include/snitch/snitch_config.hpp.config
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
#if !defined(SNITCH_WITH_TEAMCITY_REPORTER)
#cmakedefine01 SNITCH_WITH_TEAMCITY_REPORTER
#endif
#if !defined(SNITCH_WITH_CATCH2_REPORTER)
#cmakedefine01 SNITCH_WITH_CATCH2_REPORTER
#if !defined(SNITCH_WITH_CATCH2_XML_REPORTER)
#cmakedefine01 SNITCH_WITH_CATCH2_XML_REPORTER
#endif
#if !defined(SNITCH_WITH_MULTITHREADING)
#cmakedefine01 SNITCH_WITH_MULTITHREADING
Expand Down
6 changes: 5 additions & 1 deletion tests/approval_tests/reporter_catch2_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <stdexcept>

#if SNITCH_WITH_CATCH2_XML_REPORTER || SNITCH_WITH_ALL_REPORTERS

using namespace std::literals;
using snitch::matchers::contains_substring;

Expand All @@ -31,7 +33,7 @@ TEST_CASE("xml reporter", "[reporters]") {
framework.registry.add_reporter("xml", init, configure, report, finish);

constexpr const char* reporter_name = "xml";
#define REPORTER_PREFIX "reporter_catch2_xml_"
# define REPORTER_PREFIX "reporter_catch2_xml_"

const std::vector<std::regex> ignores = {
std::regex{R"|(durationInSeconds="([0-9.e+\-]{12})")|"},
Expand Down Expand Up @@ -77,3 +79,5 @@ TEST_CASE("xml reporter", "[reporters]") {
CHECK_FOR_DIFFERENCES(args, ignores, REPORTER_PREFIX "list_tests");
}
}

#endif
6 changes: 5 additions & 1 deletion tests/approval_tests/reporter_teamcity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <stdexcept>

#if SNITCH_WITH_TEAMCITY_REPORTER || SNITCH_WITH_ALL_REPORTERS

using namespace std::literals;
using snitch::matchers::contains_substring;

Expand All @@ -23,7 +25,7 @@ TEST_CASE("teamcity reporter", "[reporters]") {
&snitch::reporter::teamcity::report, {});

constexpr const char* reporter_name = "teamcity";
#define REPORTER_PREFIX "reporter_teamcity_"
# define REPORTER_PREFIX "reporter_teamcity_"

const std::vector<std::regex> ignores = {
std::regex{R"( duration='([0-9]+)')"},
Expand Down Expand Up @@ -62,3 +64,5 @@ TEST_CASE("teamcity reporter", "[reporters]") {
CHECK_FOR_DIFFERENCES(args, ignores, REPORTER_PREFIX "list_tests");
}
}

#endif

0 comments on commit fe9249d

Please sign in to comment.