File doxygen-testsuite-failure-final-solution.patch of Package doxygen
Index: doxygen-1.15.0/testing/CMakeLists.txt
===================================================================
--- doxygen-1.15.0.orig/testing/CMakeLists.txt
+++ doxygen-1.15.0/testing/CMakeLists.txt
@@ -1,7 +1,7 @@
# run all tests sequentially (keep for backward compatibility)
add_custom_target(tests
COMMENT "Running doxygen tests..."
- COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --xmlxsd --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
+ COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --doxygen ${PROJECT_BINARY_DIR}/bin/doxygen --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
DEPENDS doxygen ${update_doxmlparser_dependency}
)
@@ -15,6 +15,6 @@ foreach(TEST_FILE ${TEST_FILES})
string(REGEX REPLACE "^.*/([0-9][0-9][0-9]*).*$" "\\1" TEST_ID "${TEST_FILE}")
# add a test target for each test
add_test(NAME ${TEST_NAME}
- COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --xmlxsd --doxygen $<TARGET_FILE:doxygen> --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
+ COMMAND ${Python_EXECUTABLE} ${PROJECT_SOURCE_DIR}/testing/runtests.py --id ${TEST_ID} --doxygen $<TARGET_FILE:doxygen> --inputdir ${PROJECT_SOURCE_DIR}/testing --outputdir ${PROJECT_BINARY_DIR}/testing
)
endforeach()
Index: doxygen-1.15.0/testing/runtests.py
===================================================================
--- doxygen-1.15.0.orig/testing/runtests.py
+++ doxygen-1.15.0/testing/runtests.py
@@ -88,7 +88,21 @@ class Tester:
elif not os.path.isfile(expected_file):
return (True,'%s absent' % expected_file)
else:
- diff = xpopen('diff -b -w -u %s %s' % (got_file,expected_file))
+ got_file_tmp = got_file + "_tmp"
+ with xopen(got_file,'r') as f:
+ with xopen(got_file_tmp,"w") as out_file:
+ lines = f.read().replace("<","\n<").replace(">",">\n").splitlines()
+ filtered = [ line for line in lines if line.strip() ]
+ out_file.write('\n'.join(filtered))
+ expected_file_tmp = got_file + "_tmp1"
+ with xopen(expected_file,'r') as f:
+ with xopen(expected_file_tmp,"w") as out_file:
+ lines = f.read().replace("<","\n<").replace(">",">\n").splitlines()
+ filtered = [ line for line in lines if line.strip() ]
+ out_file.write('\n'.join(filtered))
+ diff = xpopen('diff -b -w -u %s %s' % (got_file_tmp,expected_file_tmp))
+ os.remove(got_file_tmp)
+ os.remove(expected_file_tmp)
if diff and not diff.startswith("No differences"):
return (True,'Difference between generated output and reference:\n%s' % diff)
return (False,'')