From: <ai...@us...> - 2012-11-01 10:07:19
|
Revision: 12265 http://plplot.svn.sourceforge.net/plplot/?rev=12265&view=rev Author: airwin Date: 2012-11-01 10:07:10 +0000 (Thu, 01 Nov 2012) Log Message: ----------- Modify the ndiff test script that is created by CMake to include extra filtering in the Windows case to get rid of cr part of line endings and remove redundant zeros from exponents to make results more comparable to the Unix test files. Test results on MinGW/MSYS/Wine failed in 12 or the 26 cases so instead of using cmp -s for the tests I used diff to see what those differences were from the Unix files. In all cases, the results were due to minor differences of floating-point noise in results from ndiff on this platform and on Linux. In virtually all cases when the floating-point noise was different between the two platforms, the Wine platform's noise was slightly larger. My working hypothesis to explain those results is that Wine is being slighty sloppy in how well it retains floating-point precision in calculations compared to Linux. A similar test on Microsoft Windows might confirm or deny that hypothesis. Modified Paths: -------------- trunk/cmake/external/ndiff/CMakeLists.txt Modified: trunk/cmake/external/ndiff/CMakeLists.txt =================================================================== --- trunk/cmake/external/ndiff/CMakeLists.txt 2012-10-31 19:59:49 UTC (rev 12264) +++ trunk/cmake/external/ndiff/CMakeLists.txt 2012-11-01 10:07:10 UTC (rev 12265) @@ -124,13 +124,31 @@ find_program(BASH_EXECUTABLE bash) find_program(CAT_EXECUTABLE cat) find_program(CMP_EXECUTABLE cmp) -if(BASH_EXECUTABLE AND CAT_EXECUTABLE AND CMP_EXECUTABLE) +find_program(DIFF_EXECUTABLE diff) +if(BASH_EXECUTABLE AND CAT_EXECUTABLE AND CMP_EXECUTABLE AND DIFF_EXECUTABLE) set(BUILD_TEST ON) -else(BASH_EXECUTABLE AND CAT_EXECUTABLE AND CMP_EXECUTABLE) - message(STATUS "WARNING: bash, cat, or cmp not available so disabling testing") -endif(BASH_EXECUTABLE AND CAT_EXECUTABLE AND CMP_EXECUTABLE) +else(BASH_EXECUTABLE AND CAT_EXECUTABLE AND CMP_EXECUTABLE AND DIFF_EXECUTABLE) + message(STATUS "WARNING: bash, cat, cmp, or diff not available so disabling testing") + set(BUILD_TEST OFF CACHE BOOL "Enable testing" FORCE) +endif(BASH_EXECUTABLE AND CAT_EXECUTABLE AND CMP_EXECUTABLE AND DIFF_EXECUTABLE) if(BUILD_TEST) + if(WIN32) + find_program(TR_EXECUTABLE tr) + find_program(SED_EXECUTABLE sed) + if(TR_EXECUTABLE AND SED_EXECUTABLE) + set(FILTER "| ${TR_EXECUTABLE} -d $'\\r' | sed -e's?\\([0-9]e[+-]*\\)0\\([0-9][0-9]\\)?\\1\\2?'") + #message(STATUS "DEBUG: FILTER = ${FILTER}") + else(TR_EXECUTABLE AND SED_EXECUTABLE) + message(STATUS "WARNING: tr or sed not available so disabling testing on a Windows platform") + set(BUILD_TEST OFF CACHE BOOL "Enable testing" FORCE) + endif(TR_EXECUTABLE AND SED_EXECUTABLE) + else(WIN32) + set(FILTER) + endif(WIN32) +endif(BUILD_TEST) + +if(BUILD_TEST) enable_testing() set(check_LIST) foreach(index RANGE 1 26) @@ -163,7 +181,9 @@ "${ndiff_LOC} --quick --logfile \$1.err --outfile \$1.out \$(${CAT_EXECUTABLE} ${TEST_DIR}/\$1.opt) ${TEST_DIR}/\$1.in1 ${TEST_DIR}/\$1.in2\n" ) file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/test_area/ndiff_check.sh - "${CMP_EXECUTABLE} -s \$1.err ${CHECK_DIR}/\$1.err && ${CMP_EXECUTABLE} -s \$1.out ${CHECK_DIR}/\$1.out\n" +# Use diff instead of cmp to give more details about the differences. +# "${CAT_EXECUTABLE} < \$1.err ${FILTER} | ${CMP_EXECUTABLE} -s - ${CHECK_DIR}/\$1.err && ${CAT_EXECUTABLE} < \$1.out ${FILTER} | ${CMP_EXECUTABLE} -s - ${CHECK_DIR}/\$1.out\n" + "${CAT_EXECUTABLE} < \$1.err ${FILTER} | ${DIFF_EXECUTABLE} - ${CHECK_DIR}/\$1.err && ${CAT_EXECUTABLE} < \$1.out ${FILTER} | ${DIFF_EXECUTABLE} - ${CHECK_DIR}/\$1.out\n" ) foreach(check ${check_LIST}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |