Skip to content

Reorganize test assertions #66

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 2 commits into from
Mar 7, 2016

Conversation

briancroom
Copy link
Contributor

I've gone ahead and taken a first pass at rearranging the assertions in our existing functional tests, as discussed.

@modocache already has more ideas of ways that this could potentially be made even better, but this seemed like nice low-hanging fruit until such time as new functionality is added to the xctest_checker.

I made a couple of other minor changes to the assertions here as well. In particular, I reduced the number of tests that explicitly check for correct line numbers in assertion failure, because the specific line numbers are prone to change as the project evolves, and it's wasteful to test the same behavior repeatedly. I also made a slight simplification to the file path in lines checking assertion failures. What previous was:

// CHECK: .*/Tests/Functional/SingleFailingTestCase/main.swift:22: error: SingleFailingTestCase.test_fails : XCTAssertTrue failed -

is now

// CHECK: .*/SingleFailingTestCase/main.swift:22: error: SingleFailingTestCase.test_fails : XCTAssertTrue failed -

I don't think that including the extra path components improved the quality of the assertion in any way, while it does increase the amount of noise, making it harder to determine what parts of the line are most relevant.

They are now located adjacent to the code which causes the output to be produced
@mike-ferris
Copy link

@swift-ci please test

@modocache
Copy link
Contributor

Awesome! Thanks for updating __FUNCTION__, too.

@mike-ferris
Copy link

@swift-ci Please test

modocache added a commit that referenced this pull request Mar 7, 2016
@modocache modocache merged commit afc816c into swiftlang:master Mar 7, 2016
@modocache
Copy link
Contributor

Again, the OS X check is broken until xcodebuild uses the latest Swift toolchain. (Still, I'm hesitant to disable the OS X path in the Swift build script, since I believe this xcodebuild problem will be fixed in the CI infra.)

This seems good to merge, so I pulled the trigger!

@briancroom briancroom deleted the reorganize-test-assertions branch March 8, 2016 03:17
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.

3 participants