-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[test] New test mode to execute all tests with C++ interop enabled. #59120
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
Conversation
@swift-ci please smoke test |
Nice work, thanks for posting this @drodriguez |
Btw, @drodriguez, any idea why 11 C++ Interoperability tests fail on the Android CI? Seems like it's looking in the wrong place, ie the host linux headers, wonder if you've looked into it:
I have fixes ready for two other tests that were failing recently on the Android CI that I will submit, but I see 18 more tests that are failing today. Also, could you get my pull #59001 in? I asked Karoy, but it looks like he's off github this week. |
LGTM, @zoecarver @hyp what do you think? |
test/lit.cfg
Outdated
@@ -708,6 +708,10 @@ elif swift_test_mode == 'only_executable': | |||
config.limit_to_features.add("executable_test") | |||
elif swift_test_mode == 'only_non_executable': | |||
config.available_features.add("nonexecutable_test") | |||
elif swift_test_mode == 'with_cxx_interop': | |||
config.available_features.add("with_cxx_interop") | |||
config.swift_frontend_test_options += ' -enable-cxx-interop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use -enable-expiremental-cxx-interop
here and below? I'm trying to get rid of enable-cxx-interop
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about lit, but this lgtm. Thanks, Daniel!
Probably going to merge this one after @zoecarver provides feedback. @buttaface can you surface issues with Android CI in the forums or at the next C++-Interop meeting? I think the next one is for covering Windows C++-Interop, so might be a good place to surface cross-platform issues generally. |
Feel free to merge and fix the "experimental" thing as a nfc after if you don't want to re-run the tests or whatever. |
It seems that it is using the system headers instead of the NDK headers. This probably might work in Termux and similar setups, but cannot work cross-compiling from a Linux machine to Android. I do not know exactly how to fix it or what's going on, but I would start looking at those tests, which replacement they use (
Done. |
To improve the reliability of the C++ interop, a new test mode is added to the existing ones. The new mode enables the usage of `--enable-experimental-cxx-interop` in every test invocation of the frontend and the driver. The ideal situation would be that with and without the C++ interop the test should not fail. Currently around 283 tests seems to still fail.
b63d4c8
to
ae1f707
Compare
@swift-ci please smoke test and merge |
While Termux doesn't have that problem, the same test then fails with errors like these, taken from other failing C++ Interop tests on the Android CI:
The first one I'm familiar with, Android's Bionic libc only defines
Yeah, was going to do that, was just hoping you had done it already. 😉 Anyway, those tests will hit these other Interop errors once that header path is fixed. @plotfi, sure, I just started looking at them, though these foreign-reference tests have been failing on the Android CI since they were added late last year, so I will try a few things then file a github issue with what I find. |
…59216) In #59120 I did not realize that I was filtering tests that required executable or non-executable features, so many tests were being skipped. This change should recover both sets of tests and it allows us to test C++ interop in a lot more cases. Sadly this raises the number of failing tests with C++ interop to 425.
To improve the reliability of the C++ interop, a new test mode is added
to the existing ones. The new mode enables the usage of
--enable-cxx-interop
in every test invocation of the frontend and thedriver.
This can be used after a
build-script
or similar had been successful, and then one can doninja -C <path/to/build/dir> -- check-swift-validation-with_cxx_interop
to execute all tests with C++ interop enabled.The ideal situation would be that with and without the C++ interop the
test should not fail. Currently around 283 tests seems to still fail.