-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests to verify custom mnemonics set on `copy_file`, `copy_directory` and `run_binary`.
- Loading branch information
1 parent
65c8f18
commit 73b8807
Showing
7 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2019 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. | ||
|
||
"""Custom mnemonic tests for copy_directory.bzl""" | ||
|
||
load("//lib:unittest.bzl", "analysistest", "asserts") | ||
load("//rules:copy_directory.bzl", "copy_directory") | ||
|
||
def _copy_directory_mnemonic_test_impl(ctx): | ||
env = analysistest.begin(ctx) | ||
|
||
expected_mmemonic = "FooBar" | ||
actual_mnemonic = analysistest.target_actions(env)[0].mnemonic | ||
|
||
asserts.equals(env, expected_mmemonic, actual_mnemonic) | ||
|
||
return analysistest.end(env) | ||
|
||
copy_directory_mnemonic_test = analysistest.make(_copy_directory_mnemonic_test_impl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2019 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. | ||
|
||
"""Custom mnemonic tests for copy_file.bzl""" | ||
|
||
load("//lib:unittest.bzl", "analysistest", "asserts") | ||
load("//rules:copy_file.bzl", "copy_file") | ||
|
||
def _copy_file_mnemonic_test_impl(ctx): | ||
env = analysistest.begin(ctx) | ||
|
||
expected_mmemonic = "FooBar" | ||
actual_mnemonic = analysistest.target_actions(env)[0].mnemonic | ||
|
||
asserts.equals(env, expected_mmemonic, actual_mnemonic) | ||
|
||
return analysistest.end(env) | ||
|
||
copy_file_mnemonic_test = analysistest.make(_copy_file_mnemonic_test_impl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2019 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. | ||
|
||
#include <stdio.h> | ||
|
||
int main() { | ||
printf("Hello, world!"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2019 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. | ||
|
||
"""Custom mnemonic tests for run_binary.bzl""" | ||
|
||
load("//lib:unittest.bzl", "analysistest", "asserts") | ||
load("//rules:run_binary.bzl", "run_binary") | ||
|
||
def _run_binary_mnemonic_test_impl(ctx): | ||
env = analysistest.begin(ctx) | ||
|
||
expected_mmemonic = "FooBar" | ||
actual_mnemonic = analysistest.target_actions(env)[0].mnemonic | ||
|
||
asserts.equals(env, expected_mmemonic, actual_mnemonic) | ||
|
||
return analysistest.end(env) | ||
|
||
run_binary_mnemonic_test = analysistest.make(_run_binary_mnemonic_test_impl) |