USe TTS for test harness

This commit is contained in:
Joel Falcou 2025-05-12 10:35:16 +02:00
parent 3caf08e4c1
commit 5f1d070547
3 changed files with 1944 additions and 5 deletions

View file

@ -6,4 +6,15 @@
include(${ROTGEN_SOURCE_DIR}/cmake/unit.cmake)
rotgen_setup_test_targets()
rotgen_glob_unit(PATTERN "basic/*.cpp" INTERFACE rotgen)
##======================================================================================================================
## Compiler options for Unit Tests
##======================================================================================================================
add_library(rotgen_test INTERFACE)
target_compile_features(rotgen_test INTERFACE cxx_std_20)
target_include_directories( rotgen_test INTERFACE ${PROJECT_SOURCE_DIR}/test)
target_link_libraries(rotgen_test INTERFACE rotgen)
##======================================================================================================================
## Unit Tests registration
##======================================================================================================================
rotgen_glob_unit(PATTERN "basic/*.cpp" INTERFACE rotgen_test)

View file

@ -1,8 +1,26 @@
#include <iostream>
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#define TTS_MAIN
#include <rotgen/matrix.hpp>
#include <sstream>
#include "tts.hpp"
int main()
TTS_CASE("Sample test")
{
rotgen::matrix<double,5,5> x;
std::cout << x << "\n";
}
std::ostringstream os;
os << x;
std::string ref = "0 0 0 0 0\n"
"0 0 0 0 0\n"
"0 0 0 0 0\n"
"0 0 0 0 0\n"
"0 0 0 0 0";
TTS_EQUAL(os.str(), ref);
};

1910
test/tts.hpp Normal file

File diff suppressed because it is too large Load diff