-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from tipi-build/feature/testing
Test suite for goldilock
- Loading branch information
Showing
26 changed files
with
2,172 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /EHsc /std:c++17" CACHE STRING "CXX_FLAGS" FORCE) | ||
set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ Standard (toolchain)" FORCE) | ||
set(CMAKE_CXX_STANDARD_REQUIRED YES CACHE BOOL "C++ Standard required" FORCE) | ||
set(CMAKE_CXX_EXTENSIONS NO CACHE BOOL "C++ Standard extensions" FORCE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
include_guard() | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/compiler/clang.cmake) | ||
include(${CMAKE_CURRENT_LIST_DIR}/flags/cxx17.cmake) | ||
|
||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-fsanitize=address>) | ||
add_link_options( | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-fsanitize=address> | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-static-libsan>) | ||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-uninitialized>) | ||
|
||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-string-concatenation>) | ||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-shift-overflow>) | ||
add_compile_options( | ||
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-misleading-indentation>) | ||
|
||
|
||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include_guard() | ||
|
||
include(${CMAKE_CURRENT_LIST_DIR}/flags/vs-cxx17.cmake) | ||
add_compile_definitions( | ||
# Prevents Windows.h from adding unnecessary includes | ||
WIN32_LEAN_AND_MEAN | ||
# Prevents Windows.h from defining min/max as macros | ||
NOMINMAX | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2024 Yannic Staudt, tipi technologies Ltd and the goldilock contributors | ||
// SPDX-License-Identifier: GPL-2.0-only OR Proprietary | ||
#pragma once | ||
|
||
#include <random> | ||
#include <chrono> | ||
|
||
namespace tipi::goldilock::random { | ||
|
||
template<typename Rep> | ||
inline Rep random_in_range(Rep lower, Rep upper) { | ||
static_assert(std::is_integral<Rep>::value, "Integral required."); | ||
|
||
static std::random_device rd; | ||
static std::mt19937 gen(rd()); | ||
std::uniform_int_distribution<Rep> dist(lower, upper); | ||
return dist(gen); | ||
} | ||
|
||
template<typename Rep, typename Period> | ||
inline std::chrono::duration<Rep, Period> random_sleep_duration(std::chrono::duration<Rep, Period> min, std::chrono::duration<Rep, Period> max) { | ||
std::chrono::duration<Rep, Period> result(random_in_range(min.count(), max.count())); | ||
return result; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
Oops, something went wrong.