From c12ab8fb5e21049323f8eceefe6fec57e413eb68 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Tue, 18 Nov 2014 18:18:49 +0100
Subject: [PATCH] Move up tester arguments for diff and numdiff.

---
 scripts/cmake/test/AddTest.cmake | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/scripts/cmake/test/AddTest.cmake b/scripts/cmake/test/AddTest.cmake
index 3107d2a9aaf..6be7638bbfe 100644
--- a/scripts/cmake/test/AddTest.cmake
+++ b/scripts/cmake/test/AddTest.cmake
@@ -101,26 +101,17 @@ function (AddTest)
 	endif()
 
 	if(AddTest_TESTER STREQUAL "diff")
-		message("DIFF ADDTESTDIFF_DATA ${AddTest_DIFF_DATA}")
-		foreach(FILE ${AddTest_DIFF_DATA})
-			get_filename_component(FILE_NAME ${FILE} NAME_WE)
-			get_filename_component(FILE_EXT ${FILE} EXT)
-			set(FILE_EXPECTED ${FILE_NAME}_expected${FILE_EXT})
-			set(TESTER_COMMAND ${TESTER_COMMAND} "${DIFF_TOOL_PATH} -sbB DATA{${AddTest_SOURCE_PATH}/${FILE_EXPECTED}} ${AddTest_BINARY_PATH}/${FILE}")
-			if(AddTest_DIFF_DATA_PARSED)
-				set(AddTest_DIFF_DATA_PARSED "${AddTest_DIFF_DATA_PARSED},${FILE_EXPECTED}")
-			else()
-				set(AddTest_DIFF_DATA_PARSED "${FILE_EXPECTED}")
-			endif()
-		endforeach()
-		string(REPLACE ";" " && " TESTER_COMMAND "${TESTER_COMMAND}")
-		set(AddTest_DIFF_DATA_PARSED "${AddTest_SOURCE_PATH}/${AddTest_DIFF_DATA_PARSED}")
+		set(TESTER_ARGS "-sbB")
 	elseif(AddTest_TESTER STREQUAL "numdiff")
+		set(TESTER_ARGS "--statistics --absolute-tolerance=1e-5 --relative-tolerance=1e-4")
+	endif()
+
+	if(AddTest_TESTER STREQUAL "diff" OR AddTest_TESTER STREQUAL "numdiff")
 		foreach(FILE ${AddTest_DIFF_DATA})
 			get_filename_component(FILE_NAME ${FILE} NAME_WE)
 			get_filename_component(FILE_EXT ${FILE} EXT)
 			set(FILE_EXPECTED ${FILE_NAME}_expected${FILE_EXT})
-			set(TESTER_COMMAND ${TESTER_COMMAND} "${NUMDIFF_TOOL_PATH} -a 1e-5 -r 1e-4 DATA{${AddTest_SOURCE_PATH}/${FILE_EXPECTED}} ${AddTest_BINARY_PATH}/${FILE}")
+			set(TESTER_COMMAND ${TESTER_COMMAND} "${NUMDIFF_TOOL_PATH} ${TESTER_ARGS} DATA{${AddTest_SOURCE_PATH}/${FILE_EXPECTED}} ${AddTest_BINARY_PATH}/${FILE}")
 			if(AddTest_DIFF_DATA_PARSED)
 				set(AddTest_DIFF_DATA_PARSED "${AddTest_DIFF_DATA_PARSED},${FILE_EXPECTED}")
 			else()
-- 
GitLab