diff --git a/.gitignore b/.gitignore index e257658..f4f9745 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ *.out *.app +bin/tests diff --git a/Makefile b/Makefile index e69de29..50b71df 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,11 @@ +CXX= clang++ +CXXFLAGS= --std=c++2a + +all: tests + +tests: bin/tests + ./bin/tests + +bin/tests: tests.cpp $(wildcard tests/*.cpp) + @mkdir -p $(@D) + $(CXX) $(CXXFLAGS) -Itests -Iinclude tests.cpp -o $@ \ No newline at end of file diff --git a/include/stored_array.hpp b/include/stored_array.hpp new file mode 100644 index 0000000..7b9637e --- /dev/null +++ b/include/stored_array.hpp @@ -0,0 +1 @@ +#pragma once \ No newline at end of file diff --git a/tests.cpp b/tests.cpp index e69de29..91b3af1 100644 --- a/tests.cpp +++ b/tests.cpp @@ -0,0 +1,27 @@ +#include "test_scaffold.cpp" +#include "meta_test.cpp" +#include + +int main() +{ + uint failed = 0; + uint runned = 0; + for(auto& test : tests) + { + ++runned; + int value; + try{ + value = test->run(); + if(value) + { + std::cout << test->name << " failed with "<< value << std::endl; + } + } catch (...) { + std::cout << test->name << " failed with an exception" << std::endl; + value = -1; + } + failed += (value != 0); + } + std::cout << "Runned "< +#include +#include + +struct test_scaffold{ + std::string name; + virtual int run() = 0; + virtual ~test_scaffold() = default; +}; + +std::vector> tests; + +struct append_test { + append_test(test_scaffold* ptr) { + tests.emplace_back(ptr); + } +}; \ No newline at end of file