forked from bazelbuild/rules_android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a dependency on rules_bazel_integration_test.
Also add a smoke test to confirm that it works properly. Part of bazelbuild#76. PiperOrigin-RevId: 563174586 Change-Id: Ic186af201f7c40aa3e42e9149b81fa13d662994b
- Loading branch information
Showing
5 changed files
with
144 additions
and
25 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
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 @@ | ||
load("@bazel_binaries//:defs.bzl", "bazel_binaries") | ||
load( | ||
"@rules_bazel_integration_test//bazel_integration_test:defs.bzl", | ||
"script_test", | ||
) | ||
|
||
package( | ||
default_applicable_licenses = ["//:license"], | ||
default_visibility = [ | ||
"//test:__subpackages__", | ||
], | ||
) | ||
|
||
script_test( | ||
name = "demo_test", | ||
srcs = ["demo_test.sh"], | ||
bazel_binaries = bazel_binaries, | ||
bazel_version = bazel_binaries.versions.current, | ||
deps = [ | ||
"//test/bashunit", | ||
"@bazel_tools//tools/bash/runfiles", | ||
], | ||
) | ||
|
||
test_suite( | ||
name = "integration_tests", | ||
tests = [ | ||
":demo_test", | ||
], | ||
) |
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,40 @@ | ||
#!/bin/bash | ||
# Copyright 2023 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. | ||
|
||
# Short demo of the rules_bazel_integration_test to ensure it works. | ||
|
||
# --- begin runfiles.bash initialization v2 --- | ||
# Copy-pasted from the Bazel Bash runfiles library v2. | ||
set -uo pipefail; f=bazel_tools/tools/bash/runfiles/runfiles.bash | ||
source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ | ||
source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \ | ||
source "$0.runfiles/$f" 2>/dev/null || \ | ||
source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ | ||
source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \ | ||
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e | ||
# --- end runfiles.bash initialization v2 --- | ||
|
||
source "$(rlocation build_bazel_rules_android/test/bashunit/unittest.bash)" || \ | ||
(echo >&2 "Failed to locate bashunit.sh" && exit 1) | ||
|
||
function test_bazel_exists() { | ||
touch WORKSPACE | ||
touch BUILD.bazel | ||
|
||
"${BIT_BAZEL_BINARY}" info >& $TEST_log | ||
expect_log "output_base: " | ||
} | ||
|
||
run_suite "Demo of rules_bazel_integration_test" |