Add skeleton for C++ API tests

This commit is contained in:
Simon Hausmann 2021-03-16 16:30:54 +01:00
parent 3391aa0312
commit ec1775f9ae
3 changed files with 36 additions and 0 deletions

View file

@ -125,3 +125,16 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/README.md")
set(CPACK_STRIP_FILES ON)
include(CPack)
if(BUILD_TESTING)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.1
)
FetchContent_MakeAvailable(Catch2)
add_executable(api_tests tests/tests.cpp)
target_link_libraries(api_tests PRIVATE Catch2::Catch2)
add_test(api_tests api_tests)
endif()

View file

@ -0,0 +1,22 @@
/* LICENSE BEGIN
This file is part of the SixtyFPS Project -- https://sixtyfps.io
Copyright (c) 2020 Olivier Goffart <olivier.goffart@sixtyfps.io>
Copyright (c) 2020 Simon Hausmann <simon.hausmann@sixtyfps.io>
SPDX-License-Identifier: GPL-3.0-only
This file is also available under commercial licensing terms.
Please contact info@sixtyfps.io for more information.
LICENSE END */
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
SCENARIO("SixtyFPS can be shipped")
{
GIVEN("a boolean")
{
bool okay = true;
REQUIRE(okay);
}
}