Skip to content
Snippets Groups Projects
Verified Commit 320bbc1b authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: pipeline

parent d51a68ec
Branches
Tags
No related merge requests found
...@@ -23,8 +23,7 @@ if(NOT clang_tidy) ...@@ -23,8 +23,7 @@ if(NOT clang_tidy)
message(STATUS "clang-tidy: Not found") message(STATUS "clang-tidy: Not found")
else() else()
message(STATUS "clang-tidy: ${clang_tidy}") message(STATUS "clang-tidy: ${clang_tidy}")
set(CMAKE_C_CLANG_TIDY "${clang_tidy}" "--header-filter=." "--checks=*" "--warnings-as-errors=*") set(CMAKE_C_CLANG_TIDY "${clang_tidy}" "--header-filter=." "--checks=*,-llvm-include-order,-llvmlibc-restrict-system-libc-headers" "--warnings-as-errors=*")
set(CMAKE_CXX_CLANG_TIDY "${clang_tidy}" "--header-filter=." "--checks=*" "--warnings-as-errors=*")
endif() endif()
add_subdirectory(src) add_subdirectory(src)
......
#ifndef CONNECTION_H
#define CONNECTION_H
/** /**
* @file connection.h * @file connection.h
* @author Timm Fitschen * @author Timm Fitschen
...@@ -12,3 +14,4 @@ ...@@ -12,3 +14,4 @@
* @return 0 if everything is ok. * @return 0 if everything is ok.
*/ */
int configure_connection(char host[], int port); int configure_connection(char host[], int port);
#endif
#ifndef LIBCAOSDBCONFIG_H
#define LIBCAOSDBCONFIG_H
// clang-format off // clang-format off
#define LIBCAOSDB_VERSION_MAJOR @libcaosdb_VERSION_MAJOR@ #define LIBCAOSDB_VERSION_MAJOR @libcaosdb_VERSION_MAJOR@
#define LIBCAOSDB_VERSION_MINOR @libcaosdb_VERSION_MINOR@ #define LIBCAOSDB_VERSION_MINOR @libcaosdb_VERSION_MINOR@
#define LIBCAOSDB_VERSION_PATCH @libcaosdb_VERSION_PATCH@ #define LIBCAOSDB_VERSION_PATCH @libcaosdb_VERSION_PATCH@
// clang-format on // clang-format on
#endif
...@@ -9,6 +9,7 @@ int main(void) { ...@@ -9,6 +9,7 @@ int main(void) {
LIBCAOSDB_VERSION_MINOR, LIBCAOSDB_VERSION_PATCH); LIBCAOSDB_VERSION_MINOR, LIBCAOSDB_VERSION_PATCH);
printf("We don't miss the H of caos.\n"); printf("We don't miss the H of caos.\n");
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers, readability-magic-numbers)
configure_connection("localhost", 8080); configure_connection("localhost", 8080);
return 0; return 0;
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
#include <stdio.h> #include <stdio.h>
int configure_connection(char host[], int port) { int configure_connection(char host[], int port) {
// NOLINTNEXTLINE(cppcoreguidelines-avoid-magic-numbers, readability-magic-numbers)
if (port > 666 && port < 668) { if (port > 666 && port < 668) {
printf("667 - One step ahead of the Devil!"); printf("667 - One step ahead of the Devil!");
} }
printf("Configure connection: %s:%d\n", host, port); printf("Configure connection: %s:%d\n", host, port);
return 0; return 0;
......
#include <setjmp.h> #include "connection.h"
#include <stdarg.h> #include <setjmp.h> // IWYU pragma: keep
#include <stdarg.h> // IWYU pragma: keep
#include <stddef.h> #include <stddef.h>
#include <cmocka.h> #include <cmocka.h>
#include "connection.h"
// NOLINTNEXTLINE(misc-unused-parameters)
static void test_configure_connection(void **state) { static void test_configure_connection(void **state) {
assert_int_equal(0, configure_connection("localhost", 8080)); assert_int_equal(0, configure_connection("localhost", 8080));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment