forked from Z3Prover/z3
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic Catch2 tests structure for noodler
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
find_package(Catch2 3 REQUIRED) | ||
|
||
# These tests can use the Catch2-provided main | ||
z3_add_component(noodler | ||
EXCLUDE_FROM_ALL | ||
NOT_LIBZ3_COMPONENT # Don't put this component inside libz3 | ||
SOURCES | ||
inclusion-graph-node.cc | ||
COMPONENT_DEPENDENCIES | ||
smt | ||
) | ||
|
||
add_executable(test-noodler | ||
main.cc | ||
) | ||
target_link_libraries(test-noodler PRIVATE Catch2::Catch2WithMain) | ||
z3_add_install_tactic_rule(noodler) | ||
z3_add_memory_initializer_rule(noodler) | ||
z3_add_gparams_register_modules_rule(noodler) | ||
target_compile_definitions(test-noodler PRIVATE ${Z3_COMPONENT_CXX_DEFINES}) | ||
target_compile_options(test-noodler PRIVATE ${Z3_COMPONENT_CXX_FLAGS}) | ||
target_link_libraries(test-noodler PRIVATE noodler) | ||
target_include_directories(test-noodler PRIVATE ${Z3_COMPONENT_EXTRA_INCLUDE_DIRS}) | ||
z3_append_linker_flag_list_to_target(test-noodler ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS}) | ||
z3_add_component_dependencies_to_target(test-noodler noodler) | ||
|
||
|
||
# These tests need their own main | ||
#add_executable(custom-main-tests test.cpp test-main.cpp) | ||
#target_link_libraries(custom-main-tests PRIVATE Catch2::Catch2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <iostream> | ||
|
||
#include <catch2/catch_test_macros.hpp> | ||
|
||
#include <smt/theory_str_noodler/inclusion_graph_node.h> | ||
|
||
using namespace smt::noodler; | ||
|
||
TEST_CASE( "Inclusion graph node", "[noodler]" ) { | ||
auto predicate{ Predicate(PredicateType::Equation) }; | ||
CHECK(predicate.get_type() == PredicateType::Equation); | ||
|
||
constexpr auto term_name{ "x_1" }; | ||
auto term{ BasicTerm(term_name, BasicTermType::Variable) }; | ||
CHECK(term.get_name() == term_name); | ||
} |
Empty file.