From 053e3cdfdc479e76c8516efd585f9909b249713a Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Thu, 12 Mar 2015 19:00:07 +0100 Subject: Fail build if test are enabled but can not be built The fix point parameter test used to display a warning if it could not be run. Transform it to an errors if the tests are explicitly activated through the BUILD_TESTING option. BUILD_TESTING is declared by ctest. Signed-off-by: Kevin Rocard --- test/test-fixed-point-parameter/CMakeLists.txt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/test-fixed-point-parameter/CMakeLists.txt b/test/test-fixed-point-parameter/CMakeLists.txt index 44410b0..b9c8af3 100644 --- a/test/test-fixed-point-parameter/CMakeLists.txt +++ b/test/test-fixed-point-parameter/CMakeLists.txt @@ -26,12 +26,10 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -find_program(python2 python2) +if (BUILD_TESTING) + find_program(python2 python2) -if(python2) add_test(NAME fix_point_parameter WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${python2} Main.py) -else(python2) - message(WARNING "Disabling fix point parameter test as python2 is not installed.") -endif(python2) +endif() -- cgit v1.1