diff --git a/tests/test-utils.cc b/tests/test-utils.cc index 9f29987..476be64 100644 --- a/tests/test-utils.cc +++ b/tests/test-utils.cc @@ -16,7 +16,7 @@ * along with Spek. If not, see . */ -#include +#include "spek-utils.h" #include "test.h" @@ -43,5 +43,5 @@ static void test_vercmp() void test_utils() { - test_vercmp(); + run(test_vercmp, "vercmp"); } diff --git a/tests/test.cc b/tests/test.cc index 4396d07..2b4d67b 100644 --- a/tests/test.cc +++ b/tests/test.cc @@ -37,6 +37,12 @@ int main() } } +void run(std::function func, const std::string& message) +{ + std::cerr << message << std::endl; + func(); +} + void test(const std::string& message, bool condition) { g_total++; diff --git a/tests/test.h b/tests/test.h index fa31ac9..d168b12 100644 --- a/tests/test.h +++ b/tests/test.h @@ -19,8 +19,10 @@ #ifndef TEST_H_ #define TEST_H_ +#include #include +void run(std::function func, const std::string& message); void test(const std::string& message, bool condition); template void test(const std::string& message, const T& expected, const T& actual)