From 1999ed26016b988b616da3ca451b66de30fee2c5 Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Tue, 25 Oct 2016 09:35:46 +0200 Subject: [PATCH] Testing: use return value to check if controllib tests failed --- .../controllib_test/controllib_test_main.cpp | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/modules/controllib_test/controllib_test_main.cpp b/src/modules/controllib_test/controllib_test_main.cpp index b363b76af8..033c59b804 100644 --- a/src/modules/controllib_test/controllib_test_main.cpp +++ b/src/modules/controllib_test/controllib_test_main.cpp @@ -69,25 +69,26 @@ int blockDelayTest(); int basicBlocksTest() { - blockLimitTest(); - blockLimitSymTest(); - blockLowPassTest(); - blockHighPassTest(); - blockLowPass2Test(); - blockIntegralTest(); - blockIntegralTrapTest(); - blockDerivativeTest(); - blockPTest(); - blockPITest(); - blockPDTest(); - blockPIDTest(); - blockOutputTest(); - //blockRandUniformTest(); + bool failed = false; + failed = failed || blockLimitTest() < 0; + failed = failed || blockLimitSymTest() < 0; + failed = failed || blockLowPassTest() < 0; + failed = failed || blockHighPassTest() < 0; + failed = failed || blockLowPass2Test() < 0; + failed = failed || blockIntegralTest() < 0; + failed = failed || blockIntegralTrapTest() < 0; + failed = failed || blockDerivativeTest() < 0; + failed = failed || blockPTest() < 0; + failed = failed || blockPITest() < 0; + failed = failed || blockPDTest() < 0; + failed = failed || blockPIDTest() < 0; + failed = failed || blockOutputTest() < 0; // known failures - // blockRandGaussTest(); - blockStatsTest(); - blockDelayTest(); - return 0; + //failed = failed || blockRandUniformTest() < 0; + //failed = failed || blockRandGaussTest() < 0; + failed = failed || blockStatsTest() < 0; + failed = failed || blockDelayTest() < 0; + return failed ? -1 : 0; } int blockLimitTest()