|
| 1 | +# Copyright 2020 The Bazel Authors. All rights reserved. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +"""Tests for `swift_library.generated_header`.""" |
| 16 | + |
| 17 | +load( |
| 18 | + "//test/rules:provider_test.bzl", |
| 19 | + "provider_test", |
| 20 | +) |
| 21 | + |
| 22 | +def runtime_deps_test_suite(name, tags = []): |
| 23 | + """Test suite for `swift_binary` runtime deps. |
| 24 | +
|
| 25 | + Args: |
| 26 | + name: The base name to be used in targets created by this macro. |
| 27 | + tags: Additional tags to apply to each test. |
| 28 | + """ |
| 29 | + all_tags = [name] + tags |
| 30 | + |
| 31 | + provider_test( |
| 32 | + name = "{}_swift_binary_runtime_deps".format(name), |
| 33 | + expected_files = [ |
| 34 | + "test/fixtures/runtime_deps/transitive_data.txt", |
| 35 | + "*", |
| 36 | + ], |
| 37 | + field = "default_runfiles.files", |
| 38 | + provider = "DefaultInfo", |
| 39 | + tags = all_tags, |
| 40 | + target_under_test = "//test/fixtures/runtime_deps", |
| 41 | + ) |
| 42 | + |
| 43 | + native.test_suite( |
| 44 | + name = name, |
| 45 | + tags = all_tags, |
| 46 | + ) |
0 commit comments