Skip to content

Commit 2f4cf41

Browse files
committed
issue doxygen#11722 Test 009_bug fails
Made the test so that extra empty lines etc. due to a change in xml writing library doesn't influence the tests.
1 parent 82da90c commit 2f4cf41

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

testing/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# run all tests sequentially (keep for backward compatibility)
22
add_custom_target(tests
33
COMMENT "Running doxygen tests..."
4-
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
4+
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
55
DEPENDS doxygen ${update_doxmlparser_dependency}
66
)
77

@@ -15,6 +15,6 @@ foreach(TEST_FILE ${TEST_FILES})
1515
string(REGEX REPLACE "^.*/([0-9][0-9][0-9]*).*$" "\\1" TEST_ID "${TEST_FILE}")
1616
# add a test target for each test
1717
add_test(NAME ${TEST_NAME}
18-
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
18+
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
1919
)
2020
endforeach()

testing/runtests.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,21 @@ def compare_ok(self,got_file,expected_file,name):
8585
elif not os.path.isfile(expected_file):
8686
return (True,'%s absent' % expected_file)
8787
else:
88-
diff = xpopen('diff -b -w -u %s %s' % (got_file,expected_file))
88+
got_file_tmp = got_file + "_tmp"
89+
with xopen(got_file,'r') as f:
90+
with xopen(got_file_tmp,"w") as out_file:
91+
lines = f.read().replace("<","\n<").replace(">",">\n").splitlines()
92+
filtered = [ line for line in lines if line.strip() ]
93+
out_file.write('\n'.join(filtered))
94+
expected_file_tmp = got_file + "_tmp1"
95+
with xopen(expected_file,'r') as f:
96+
with xopen(expected_file_tmp,"w") as out_file:
97+
lines = f.read().replace("<","\n<").replace(">",">\n").splitlines()
98+
filtered = [ line for line in lines if line.strip() ]
99+
out_file.write('\n'.join(filtered))
100+
diff = xpopen('diff -b -w -u %s %s' % (got_file_tmp,expected_file_tmp))
101+
os.remove(got_file_tmp)
102+
os.remove(expected_file_tmp)
89103
if diff and not diff.startswith("No differences"):
90104
return (True,'Difference between generated output and reference:\n%s' % diff)
91105
return (False,'')

0 commit comments

Comments
 (0)