From 908387347dd5ba2a49b5beb53c9ae449fc745b9c Mon Sep 17 00:00:00 2001 From: Alexandre Rostovtsev Date: Thu, 25 Apr 2024 17:15:11 -0400 Subject: [PATCH] Add license blurb to bzl_library_test.bzl and move blurb-less test data files to testdata subdir (#503) Required by internal license checker. --- tests/bzl_library/BUILD | 14 +++++++------- tests/bzl_library/bzl_library_test.bzl | 14 ++++++++++++++ tests/bzl_library/{ => testdata}/a.bzl | 0 tests/bzl_library/{ => testdata}/b.bzl | 0 tests/bzl_library/{ => testdata}/c.bzl | 4 ++-- 5 files changed, 23 insertions(+), 9 deletions(-) rename tests/bzl_library/{ => testdata}/a.bzl (100%) rename tests/bzl_library/{ => testdata}/b.bzl (100%) rename tests/bzl_library/{ => testdata}/c.bzl (50%) diff --git a/tests/bzl_library/BUILD b/tests/bzl_library/BUILD index 6f8ae5c..72a4b9c 100644 --- a/tests/bzl_library/BUILD +++ b/tests/bzl_library/BUILD @@ -3,17 +3,17 @@ load(":bzl_library_test.bzl", "bzl_library_test") filegroup( name = "a", - srcs = ["a.bzl"], + srcs = ["testdata/a.bzl"], ) bzl_library( name = "b", - srcs = ["b.bzl"], + srcs = ["testdata/b.bzl"], ) bzl_library( name = "c", - srcs = ["c.bzl"], + srcs = ["testdata/c.bzl"], deps = [ ":a", ":b", @@ -22,11 +22,11 @@ bzl_library( bzl_library_test( name = "bzl_library_test", - expected_srcs = ["c.bzl"], + expected_srcs = ["testdata/c.bzl"], expected_transitive_srcs = [ - "a.bzl", - "b.bzl", - "c.bzl", + "testdata/a.bzl", + "testdata/b.bzl", + "testdata/c.bzl", ], target_under_test = ":c", ) diff --git a/tests/bzl_library/bzl_library_test.bzl b/tests/bzl_library/bzl_library_test.bzl index 1e01a29..64d06dc 100644 --- a/tests/bzl_library/bzl_library_test.bzl +++ b/tests/bzl_library/bzl_library_test.bzl @@ -1,3 +1,17 @@ +# Copyright 2024 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """Unit tests for bzl_library""" load("//:bzl_library.bzl", "StarlarkLibraryInfo") diff --git a/tests/bzl_library/a.bzl b/tests/bzl_library/testdata/a.bzl similarity index 100% rename from tests/bzl_library/a.bzl rename to tests/bzl_library/testdata/a.bzl diff --git a/tests/bzl_library/b.bzl b/tests/bzl_library/testdata/b.bzl similarity index 100% rename from tests/bzl_library/b.bzl rename to tests/bzl_library/testdata/b.bzl diff --git a/tests/bzl_library/c.bzl b/tests/bzl_library/testdata/c.bzl similarity index 50% rename from tests/bzl_library/c.bzl rename to tests/bzl_library/testdata/c.bzl index 1380ece..c1fbba7 100644 --- a/tests/bzl_library/c.bzl +++ b/tests/bzl_library/testdata/c.bzl @@ -1,6 +1,6 @@ """c.bzl, standin' on the shoulder of giants""" -load(":a.bzl", "A") -load(":b.bzl", "B") +load(":testdata/a.bzl", "A") +load(":testdata/b.bzl", "B") C = A + B