[webkit-changes] [WebKit/WebKit] 039785: Add a test bundle and test plan to TestWebKitAPI.app
aestes
noreply at github.com
Thu Sep 19 17:25:01 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 039785ca5e47fa0ed7e2ea0a79b04f3a7f34afb9
https://github.com/WebKit/WebKit/commit/039785ca5e47fa0ed7e2ea0a79b04f3a7f34afb9
Author: Andy Estes <aestes at apple.com>
Date: 2024-09-19 (Thu, 19 Sep 2024)
Changed paths:
M Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
M Tools/TestWebKitAPI/Configurations/TestWebKitAPIApp.xcconfig
M Tools/TestWebKitAPI/Configurations/TestWebKitAPIBase.xcconfig
A Tools/TestWebKitAPI/Configurations/TestWebKitAPIBundle.xcconfig
A Tools/TestWebKitAPI/TestBundle/GoogleTests.mm
A Tools/TestWebKitAPI/TestBundle/TestWebKitAPI.xctestplan
A Tools/TestWebKitAPI/TestBundleLoader.h
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/xcshareddata/xcschemes/TestWebKitAPIApp.xcscheme
M Tools/TestWebKitAPI/ios/app/main.mm
Log Message:
-----------
Add a test bundle and test plan to TestWebKitAPI.app
https://bugs.webkit.org/show_bug.cgi?id=279993
rdar://136302457
Reviewed by Jer Noble.
Added an xctest bundle (and test plan) to TestWebKitAPI.app that runs our suite of gtest-based API
tests. This is enabled by GoogleTests.mm, which queries the set of gtest test cases and wraps each
in a subclass of XCTestCase at runtime. GoogleTest.mm was authored by Matthew Stevens [1] with
modifications to match our code style guidelines and change how/when test cases are registered
(more below).
[1] https://github.com/mattstevens/xcode-googletest
* Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
* Tools/TestWebKitAPI/Configurations/TestWebKitAPIApp.xcconfig:
* Tools/TestWebKitAPI/Configurations/TestWebKitAPIBase.xcconfig:
Dynamically linked gtest.framework in TestWebKitAPI.app and TestWebKitAPIBundle.xctest so that
global variables set by gtest in the app are seen by the bundle. Continued to statically link
libgtest in TestWebKitAPI to avoid regressing launch time (since TestWebKitAPI is launched once
per test on the bots).
* Tools/TestWebKitAPI/Configurations/TestWebKitAPIBundle.xcconfig: Added.
* Tools/TestWebKitAPI/TestBundle/GoogleTests.mm:
Added. Changed GoogleTestLoader to conform to TestBundleLoader and removed the +load override.
* Tools/TestWebKitAPI/TestBundle/TestWebKitAPI.xctestplan: Added.
* Tools/TestWebKitAPI/TestBundleLoader.h: Added.
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/xcshareddata/xcschemes/TestWebKitAPIApp.xcscheme: Added.
* Tools/TestWebKitAPI/ios/app/main.mm:
(registerTestClasses):
Added a helper that loads TestWebKitAPIBundle.xctest and calls +registerTestClasses on its
principal class.
(main):
Called registerTestClasses. Registration is done here rather than in +[GoogleTestLoader load]
because gtest's global variables in TestWebKitAPI.app are initialized after GoogleTestLoader in
TestWebKitAPIBundle is loaded, so +load is called too early to register test classes.
Canonical link: https://commits.webkit.org/283962@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list