diff --git a/UTests/FUTester.hpp b/UTests/FUTester.hpp index 9963c4bb5cd696c5798a1f1fb5a3ad339d50498c..4f3b2b1adf3ede358811892f567c833608de2ed9 100644 --- a/UTests/FUTester.hpp +++ b/UTests/FUTester.hpp @@ -11,8 +11,7 @@ #define TestClass(X)\ int main(void){\ X Controller;\ - Controller.Run();\ - return 0;\ + return Controller.Run();\ }\ @@ -141,8 +140,9 @@ protected: public : /** * Processing the test + * return application exit code (= nb of errors) */ - void Run(){ + int Run(){ tests.clear(); // register tests SetTests(); @@ -181,6 +181,8 @@ public : After(); std::cout <<"Test is over, " << (totalTests-failledTests) << " Passed, " << failledTests << " Failled\n"; + + return failledTests; } }; diff --git a/UTests/utestTest.cpp b/UTests/utestTest.cpp index 61b93a429e3793bd7cc6a392f57683ce64936d20..d5d82a4f969d009dc64c6a6b51e499379e754b7a 100644 --- a/UTests/utestTest.cpp +++ b/UTests/utestTest.cpp @@ -10,13 +10,13 @@ class MyTest : public FUTester<MyTest> { void TestOne(){ assert(true); - assert(false); + //or assert(false); make an error assert(1 == 1); } void TestTwo(){ equal(1 , 1); - different(1 , 1); + different(1 , 2); } void After(){