mirror of
https://github.com/Tilo-K/tstd.git
synced 2026-01-11 07:11:00 +00:00
wip
This commit is contained in:
@@ -4,12 +4,18 @@ project(tstd C)
|
|||||||
set(CMAKE_C_STANDARD 23)
|
set(CMAKE_C_STANDARD 23)
|
||||||
|
|
||||||
add_library(tstd STATIC library.c
|
add_library(tstd STATIC library.c
|
||||||
string.h
|
include/string.h
|
||||||
string.c)
|
string.c)
|
||||||
|
|
||||||
|
|
||||||
add_executable(test_tstd test/test_main.c)
|
add_executable(test_tstd test/test_main.c)
|
||||||
target_link_libraries(test_tstd tstd)
|
target_link_libraries(test_tstd tstd)
|
||||||
|
|
||||||
|
target_include_directories(tstd
|
||||||
|
PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
|
$<INSTALL_INTERFACE:include>
|
||||||
|
)
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_test(NAME tstd_tests COMMAND test_tstd)
|
add_test(NAME tstd_tests COMMAND test_tstd)
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "library.h"
|
#include "include/library.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
4
string.c
4
string.c
@@ -1,4 +1,6 @@
|
|||||||
#include "string.h"
|
#include "include/string.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
size_t str_count_occurrences(const char* str, const char c) {
|
size_t str_count_occurrences(const char* str, const char c) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "../string.h"
|
#include "../include/string.h"
|
||||||
|
|
||||||
int test_count_occurrences() {
|
int test_count_occurrences() {
|
||||||
const char* test_str = "11abababb111";
|
const char* test_str = "11abababb111";
|
||||||
|
|||||||
Reference in New Issue
Block a user