Originally reported on Google Code with ID 53
When running the tests on Windows, _CompareExpectedAndActualSummaries always generates
failures as it detects differences in the paths embedded in the summary:
Unexpected summary diffs for tests\system_namespaces.cc:
+++
@@ -1,10 +1,10 @@
-tests/system_namespaces.cc should add these lines:
+tests\system_namespaces.cc should add these lines:
namespace notsys_ns { template <typename t> class TplClass; }
-tests/system_namespaces.cc should remove these lines:
+tests\system_namespaces.cc should remove these lines:
- #include "tests/system_namespaces-d3.h" // lines XX-XX
-The full include-list for tests/system_namespaces.cc:
+The full include-list for tests\system_namespaces.cc:
#include "tests/system_namespaces-d1.h" // for StdClass
#include "tests/system_namespaces-d2.h" // for SystemClass
namespace notsys_ns { template <typename t> class TplClass; }
---
I had thought to make PrintableDiffs canonicalise 'filename' on entry, but as the path
is preserved as specified on the command line, it's possible to fix this entirely within
iwyu_test_util.py.
A simpler fix is to do the following fixup on entry to TestIwyuOnRelativeFile:
cc_file = cc_file.replace("\\","/")
cpp_files_to_check = [file.replace("\\","/") for file in cpp_files_to_check]
I'm assuming that these calls to replace() will no-op on Linux, but I could guard that
code with 'if sys.platform == 'win32':' if that would be preferable.
</typename></typename>
Reported by paul.holden on 2011-07-16 17:50:21
- Attachment: fix_test_summary_diff_for_win32.patch
该提问来源于开源项目:include-what-you-use/include-what-you-use