Skip to content

[Tests] Automatically substitute [[@LINE]] numbers #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2016

Conversation

modocache
Copy link
Contributor

Enhance xctest_checker such that it substitutes the string "[[@LINE]]" and "[[@LINE+<offset>]]" with the current line number of the source file when performing checks.

This allows us to add and remove arbitary lines in the functional test suite without manually updating line numbers in most cases. Line offsets will still need to be updated when the distance between the CHECK and the test failure changes.

To test the offsets out, use them in one of the asynchronous tests.

Enhance xctest_checker such that it substitutes the string "[[@line]]"
and "[[@line+<offset>]]" with the current line number of the source file
when performing checks.

This allows us to add and remove arbitary lines in the functional test
suite without manually updating line numbers in most cases. Line
offsets will still need to be updated when the distance between the
CHECK and the test failure changes.

To test the offsets out, use them in one of the asynchronous tests.
@modocache
Copy link
Contributor Author

@swift-ci please test

@modocache
Copy link
Contributor Author

Tests all pass! @briancroom, can you review and merge? 🙇

@briancroom
Copy link
Contributor

Excellent! Great regex'ing there @modocache. This work is much appreciated. Thanks!

@briancroom briancroom merged commit ccaff50 into swiftlang:master May 16, 2016
@modocache modocache deleted the line-offsets branch May 16, 2016 03:46
@modocache
Copy link
Contributor Author

Great, thanks!! I'll send out updates for the rest of the test suite's line numbers. This should make it easier to iterate on the tests. :)

modocache added a commit to modocache/swift-corelibs-xctest that referenced this pull request May 16, 2016
Use the line number offsets introduces in swiftlang#112
to make the functional test suite assertions less brittle. Now
contributors may add and remove arbitary lines in the functional test suite
without manually updating line numbers in most cases. Line offsets will still
need to be updated when the distance between the CHECK and the test failure
changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants