Link against SixtyFPS in the C++ unit tests

This commit is contained in:
Simon Hausmann 2021-03-16 16:50:54 +01:00
parent ca93d12cf8
commit cff1e7751d
2 changed files with 14 additions and 7 deletions

View file

@ -135,6 +135,6 @@ if(BUILD_TESTING)
FetchContent_MakeAvailable(Catch2)
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)
endif()

View file

@ -11,12 +11,19 @@ LICENSE END */
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
SCENARIO("SixtyFPS can be shipped")
{
GIVEN("a boolean")
{
bool okay = true;
#include <sixtyfps.h>
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");
}
}