Initial commit
This commit is contained in:
@@ -11,6 +11,7 @@ compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
CMakeUserPresets.json
|
||||
build/
|
||||
|
||||
# ---> Emacs
|
||||
# -*- mode: gitignore; -*-
|
||||
@@ -97,3 +98,4 @@ flycheck_*.el
|
||||
*.out
|
||||
*.app
|
||||
|
||||
.cache
|
||||
@@ -0,0 +1,25 @@
|
||||
cmake_minimum_required(VERSION 4.3.4)
|
||||
project(Sabalty)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
option(BUILD_TESTING "Build tests" OFF)
|
||||
if(BUILD_TESTING)
|
||||
enable_testing()
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
Catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
|
||||
GIT_TAG v3.15.3
|
||||
)
|
||||
FetchContent_MakeAvailable(Catch2)
|
||||
|
||||
include(CTest)
|
||||
include(Catch)
|
||||
endif()
|
||||
|
||||
add_subdirectory(Server)
|
||||
add_subdirectory(Protocol)
|
||||
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(tests)
|
||||
@@ -0,0 +1,10 @@
|
||||
add_library(Protocol STATIC)
|
||||
|
||||
target_sources(Protocol
|
||||
PRIVATE
|
||||
protocol.cxx
|
||||
PUBLIC
|
||||
FILE_SET HEADERS
|
||||
BASE_DIRS include
|
||||
FILES include/protocol/protocol.hxx
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
add_executable(Protocol_tests
|
||||
test_protocol.cxx
|
||||
)
|
||||
|
||||
target_link_libraries(Protocol_tests
|
||||
PRIVATE
|
||||
Protocol
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
|
||||
catch_discover_tests(Protocol_tests)
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <protocol/protocol.hxx>
|
||||
|
||||
TEST_CASE("something", "[stun]") {
|
||||
SECTION("true") { REQUIRE(true); }
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(Stun)
|
||||
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(tests)
|
||||
@@ -0,0 +1,10 @@
|
||||
add_library(Stun STATIC)
|
||||
|
||||
target_sources(Stun
|
||||
PRIVATE
|
||||
stun.cxx
|
||||
PUBLIC
|
||||
FILE_SET HEADERS
|
||||
BASE_DIRS include
|
||||
FILES include/stun/stun.hxx
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
namespace stun {
|
||||
|
||||
int add_numbers(int, int);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
#include <stun/stun.hxx>
|
||||
|
||||
int stun::add_numbers(int x, int y) { return (x + y); }
|
||||
@@ -0,0 +1,11 @@
|
||||
add_executable(Stun_tests
|
||||
test_stun.cxx
|
||||
)
|
||||
|
||||
target_link_libraries(Stun_tests
|
||||
PRIVATE
|
||||
Stun
|
||||
Catch2::Catch2WithMain
|
||||
)
|
||||
|
||||
catch_discover_tests(Stun_tests)
|
||||
@@ -0,0 +1,6 @@
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <stun/stun.hxx>
|
||||
|
||||
TEST_CASE("add_numbers works", "[stun]") {
|
||||
SECTION("adding 1 to 2") { REQUIRE(stun::add_numbers(1, 2) == 3); }
|
||||
}
|
||||
Reference in New Issue
Block a user