Skip to content

Commit

Permalink
✅ Group Catch2 tests by file instead of by test case
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwa committed Dec 8, 2022
1 parent 6ce4940 commit 7c0a843
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ foreach (FILE IN LISTS FILENAMES)
target_compile_definitions(${TEST_NAME} INTERFACE CATCH_CONFIG_NO_POSIX_SIGNALS) # make catch2 ignore SIGTERMs sent to applications when timeouts are reached
target_link_libraries(${TEST_NAME} PRIVATE project_warnings project_options libfiction Catch2::Catch2WithMain)

# add_test(NAME ${NAME} COMMAND ${TEST_NAME})
catch_discover_tests(${TEST_NAME})
add_test(NAME ${NAME} COMMAND ${TEST_NAME}) # group tests by file
# catch_discover_tests(${TEST_NAME})
endforeach ()
11 changes: 9 additions & 2 deletions test/algorithms/physical_design/exact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Created by marcel on 08.10.21.
//

#if (FICTION_Z3_SOLVER)

#include <catch2/catch_test_macros.hpp>

#if (FICTION_Z3_SOLVER)

#include "utils/blueprints/network_blueprints.hpp"
#include "utils/equivalence_checking_utils.hpp"

Expand Down Expand Up @@ -593,4 +593,11 @@ TEST_CASE("Name conservation after exact physical design", "[exact]")
CHECK(layout->get_output_name(0) == "f");
}

#else // FICTION_Z3_SOLVER

TEST_CASE("Exact physical design", "[exact]")
{
CHECK(true); // workaround for empty test case
}

#endif // FICTION_Z3_SOLVER
11 changes: 9 additions & 2 deletions test/algorithms/physical_design/one_pass_synthesis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Created by marcel on 24.09.21.
//

#if (MUGEN)

#include <catch2/catch_test_macros.hpp>

#if (MUGEN)

#include "utils/blueprints/network_blueprints.hpp"
#include "utils/equivalence_checking_utils.hpp"

Expand Down Expand Up @@ -204,4 +204,11 @@ TEST_CASE("Name conservation after one-pass synthesis", "[one-pass]")
CHECK(layout->get_output_name(0) == "f");
}

#else // MUGEN

TEST_CASE("One-pass synthesis", "[one-pass]")
{
CHECK(true); // workaround for empty test case
}

#endif // MUGEN

0 comments on commit 7c0a843

Please sign in to comment.