Commit Graph

6 Commits

Author SHA1 Message Date
Michael Gottesman
af25b6764c [swift-stage2] Point the API migrator at the correct directory when building/testing against a host toolchain.
This involved adding a new substitution called %api_diff_data_dir that when
building against a host toolchain, looks in the host toolchain (next to swiftc)
rather than in the resource dir. The reason why I need to do this is this allows
me to perform a stdlib stage2 build without needing to build swift itself.

The only interesting changes here are that I had to add %api_diff_data_dir to
a bunch of normal/expected tests and also add %api_diff_data_dir's length to the
offsets in rdar31892850.swift.
2021-08-12 11:50:04 -07:00
3405691582
88167e74d1 [test] diff --strip-trailing-cr is non-standard.
This flag is a GNU extension, and would cause misleading test failures
on other platforms where this extension is not available. However, the
necessity to switch line endings is only required on Windows when
testing. We could use sed to canonicalize line endings before comparing,
but that may cause higher amounts of filesystem traffic on Windows which
would slow down testing.

Instead, move the substitution for diff in SourceKit's lit.local.cfg up
to the top level, and conditionalize the substitution which has the flag
on Windows, but not on other platforms (where it should not be required).
2020-09-13 13:50:15 -04:00
Saleem Abdulrasool
f12f0ccd01 test: adjust Migrator tests (NFCI)
This adjusts the test diffing to ignore the whitespace changes across
different platforms.  `raw_fd_ostream` will write out `OF_Text` files
with the platform's line endings, which may differ from the source
file's.
2020-01-13 18:45:45 -08:00
Xi Ge
fedf531b2a migrator/test: remove -swift-version=3 flag from the test. 2018-07-23 16:09:07 -07:00
Slava Pestov
5d2752f7d2 Run tests with -swift-version 4 by default
Some test now fail, so add an explicit -swift-version 3.
2018-06-19 23:24:19 -07:00
Rintaro Ishizaki
ec3a3df023 [Migrator] Use RewriteBuffer::InsertText() for applying insertion
Apparently, ReplaceText() on the same location replaces the replaced
text. Using InsertText() fixes the problem.

rdar://problem/39518867
2018-04-26 19:40:38 +09:00