blob: 4232e4b8da02b3aa21403b03ded85e744a83c806 [file] [log] [blame]
# Copyright 2022 The Chromium Authors. All rights resAerved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/apple/swift_source_set.gni")
import("//build/config/ios/ios_test_runner_xcuitest.gni")
import("//build/config/ios/rules.gni")
config("swift_interop_tests_modulemap") {
swiftflags = [
"-I" + rebase_path("include/", root_build_dir),
"-Xcc=-fmodule-map-file=" +
rebase_path("include/module.modulemap", root_build_dir),
]
}
source_set("objc_interop_tests") {
testonly = true
configs += [ "//build/config/ios:xctest_config" ]
sources = [ "objc_xctest.mm" ]
deps = [ "//base" ]
frameworks = [ "Foundation.framework" ]
}
source_set("swift_interop_tests_support_files") {
testonly = true
sources = [
"classes/outlined_impl.cc",
"include/enum.h",
"include/inlined_class.h",
"include/namespace.h",
"include/object_passing.h",
"include/outlined_class.h",
"include/pointer_returner.h",
"include/polymorphism.h",
"include/shared_ptr.h",
"include/string_helper.h",
"include/struct.h",
"include/unique_ptr.h",
"pointer/pointer_returner.cc",
"pointer/shared_ptr.cc",
"pointer/unique_ptr.cc",
"string/string_helper.cc",
]
deps = [ "//base" ]
}
swift_source_set("swift_interop_tests") {
testonly = true
configs += [
":swift_interop_tests_modulemap",
"//build/config/ios:enable_swift_cxx_interop",
]
bridge_header = "swift_bridge.h"
sources = [
"classes/inlined_xctest.swift",
"classes/outlined_xctest.swift",
"classes/polymorphism_xctest.swift",
"enum/enum_xctest.swift",
"namespace/namespace_xctest.swift",
"pointer/object_passing_xctest.swift",
"pointer/pointer_xctest.swift",
"pointer/shared_ptr_xctest.swift",
"pointer/unique_ptr_xctest.swift",
"string/string_xctest.swift",
"struct/struct_xctest.swift",
]
frameworks = [ "UIKit.framework" ]
deps = [
"//base",
"//build/config/ios:xctest",
]
}
ios_app_bundle("ios_swift_interop_xcuitests") {
testonly = true
info_plist = "host-Info.plist"
sources = [ "test_host.mm" ]
frameworks = [
"UIKit.framework",
"Foundation.framework",
]
}
ios_test_runner_xcuitest("ios_swift_interop_xcuitests_module") {
xcode_test_application_name = "ios_swift_interop_xcuitests"
deps = [
":objc_interop_tests",
":swift_interop_tests",
":swift_interop_tests_support_files",
]
data_deps = [ ":ios_swift_interop_xcuitests" ]
}