mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Link against SixtyFPS in the C++ unit tests
This commit is contained in:
parent
ca93d12cf8
commit
cff1e7751d
2 changed files with 14 additions and 7 deletions
|
@ -135,6 +135,6 @@ if(BUILD_TESTING)
|
||||||
FetchContent_MakeAvailable(Catch2)
|
FetchContent_MakeAvailable(Catch2)
|
||||||
|
|
||||||
add_executable(api_tests tests/tests.cpp)
|
add_executable(api_tests tests/tests.cpp)
|
||||||
target_link_libraries(api_tests PRIVATE Catch2::Catch2)
|
target_link_libraries(api_tests PRIVATE SixtyFPS Catch2::Catch2)
|
||||||
add_test(api_tests api_tests)
|
add_test(api_tests api_tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -11,12 +11,19 @@ LICENSE END */
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN
|
||||||
#include "catch2/catch.hpp"
|
#include "catch2/catch.hpp"
|
||||||
|
|
||||||
SCENARIO("SixtyFPS can be shipped")
|
#include <sixtyfps.h>
|
||||||
{
|
|
||||||
GIVEN("a boolean")
|
|
||||||
{
|
|
||||||
bool okay = true;
|
|
||||||
|
|
||||||
REQUIRE(okay);
|
SCENARIO("SharedString API")
|
||||||
|
{
|
||||||
|
sixtyfps::SharedString str;
|
||||||
|
|
||||||
|
REQUIRE(str.empty());
|
||||||
|
|
||||||
|
SECTION("Construct from string_view")
|
||||||
|
{
|
||||||
|
std::string foo("Foo");
|
||||||
|
std::string_view foo_view(foo);
|
||||||
|
str = foo_view;
|
||||||
|
REQUIRE(str == "Foo");
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue