@@ -54,6 +54,49 @@ def watchos_framework_test_suite(name):
5454 tags = [name ],
5555 )
5656
57+ # Tests that the bundled .framework contains the expected files.
58+ archive_contents_test (
59+ name = "{}_contains_expected_files" .format (name ),
60+ build_type = "simulator" ,
61+ target_under_test = "//test/starlark_tests/targets_under_test/watchos/frameworks:fmwk" ,
62+ contains = [
63+ "$BUNDLE_ROOT/fmwk" ,
64+ "$BUNDLE_ROOT/Info.plist" ,
65+ ],
66+ tags = [name ],
67+ )
68+
69+ # Tests that the correct rpath was added at link-time to the framework's binary.
70+ # The rpath should match the framework bundle name.
71+ archive_contents_test (
72+ name = "{}_binary_has_correct_rpath" .format (name ),
73+ build_type = "simulator" ,
74+ target_under_test = "//test/starlark_tests/targets_under_test/watchos/frameworks:fmwk" ,
75+ contains = [
76+ "$BUNDLE_ROOT/fmwk" ,
77+ "$BUNDLE_ROOT/Info.plist" ,
78+ ],
79+ binary_test_file = "$BUNDLE_ROOT/fmwk" ,
80+ macho_load_commands_contain = [
81+ "name @rpath/fmwk.framework/fmwk (offset 24)" ,
82+ "path @executable_path/Frameworks (offset 12)" ,
83+ "path @loader_path/Frameworks (offset 12)" ,
84+ ],
85+ tags = [name ],
86+ )
87+
88+ # Tests that a watchos_framework builds fine without any version info
89+ # since it isn't required.
90+ infoplist_contents_test (
91+ name = "{}_plist_test_with_no_version" .format (name ),
92+ target_under_test = "//test/starlark_tests/targets_under_test/watchos/frameworks:fmwk_with_no_version" ,
93+ not_expected_keys = [
94+ "CFBundleVersion" ,
95+ "CFBundleShortVersionString" ,
96+ ],
97+ tags = [name ],
98+ )
99+
57100 archive_contents_test (
58101 name = "{}_exported_symbols_list_test" .format (name ),
59102 build_type = "simulator" ,
0 commit comments