mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Add skeleton for C++ API tests
This commit is contained in:
parent
3391aa0312
commit
ec1775f9ae
3 changed files with 36 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(SixtyFPS LANGUAGES CXX)
|
project(SixtyFPS LANGUAGES CXX)
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
add_subdirectory(api/sixtyfps-cpp/)
|
add_subdirectory(api/sixtyfps-cpp/)
|
||||||
add_subdirectory(examples/printerdemo/cpp/)
|
add_subdirectory(examples/printerdemo/cpp/)
|
||||||
|
|
|
@ -125,3 +125,16 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/README.md")
|
||||||
set(CPACK_STRIP_FILES ON)
|
set(CPACK_STRIP_FILES ON)
|
||||||
include(CPack)
|
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()
|
||||||
|
|
22
api/sixtyfps-cpp/tests/tests.cpp
Normal file
22
api/sixtyfps-cpp/tests/tests.cpp
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue