Add groundwork to easily all-enable bazel-mode
This will make it easy to change a "false" boolean to "true" to push
`--bazel-mode` by default for all users.
Users may disable bazel-by-default with BUILD_BROKEN_DISABLE_BAZEL, and
bazel is disabled by default on Darwin hosts (due to lack of test
coverage).
Bug: 254628592
Bug: 254084584
Test: Presubmits
Test: Presubmits for aosp/2263623
Change-Id: Iec712119e06ca8ec93028207d88277f879184cc2
diff --git a/tests/bootstrap_test.sh b/tests/bootstrap_test.sh
index 2331eb1..ba5ba8b 100755
--- a/tests/bootstrap_test.sh
+++ b/tests/bootstrap_test.sh
@@ -547,7 +547,6 @@
function test_bp2build_generates_marker_file {
setup
- create_mock_bazel
run_soong bp2build
diff --git a/tests/bp2build_bazel_test.sh b/tests/bp2build_bazel_test.sh
index ad21d7d..679ac55 100755
--- a/tests/bp2build_bazel_test.sh
+++ b/tests/bp2build_bazel_test.sh
@@ -50,7 +50,6 @@
function test_different_relative_outdir {
setup
- create_mock_bazel
mkdir -p a
touch a/g.txt
@@ -73,7 +72,6 @@
function test_different_absolute_outdir {
setup
- create_mock_bazel
mkdir -p a
touch a/g.txt
@@ -96,7 +94,6 @@
function test_bp2build_generates_all_buildfiles {
setup
- create_mock_bazel
mkdir -p foo/convertible_soong_module
cat > foo/convertible_soong_module/Android.bp <<'EOF'
@@ -167,7 +164,6 @@
function test_cc_correctness {
setup
- create_mock_bazel
mkdir -p a
cat > a/Android.bp <<EOF
diff --git a/tests/lib.sh b/tests/lib.sh
index 006186a..e40f0ad 100644
--- a/tests/lib.sh
+++ b/tests/lib.sh
@@ -82,10 +82,10 @@
}
function create_mock_soong {
+ create_mock_bazel
copy_directory build/blueprint
copy_directory build/soong
copy_directory build/make/tools/rbcrun
- copy_directory prebuilts/bazel/common/proto
symlink_directory prebuilts/sdk
symlink_directory prebuilts/go
diff --git a/tests/mixed_mode_test.sh b/tests/mixed_mode_test.sh
index 076ec4b..8949b42 100755
--- a/tests/mixed_mode_test.sh
+++ b/tests/mixed_mode_test.sh
@@ -12,7 +12,6 @@
function test_bazel_smoke {
setup
- create_mock_bazel
run_soong bp2build
@@ -21,7 +20,6 @@
function test_add_irrelevant_file {
setup
- create_mock_bazel
mkdir -p soong_tests/a/b
touch soong_tests/a/b/c.txt
@@ -33,7 +31,7 @@
}
EOF
- run_soong --bazel-mode nothing
+ run_soong --bazel-mode-staging nothing
if [[ ! -e out/soong/bp2build/soong_tests/a/b/BUILD.bazel ]]; then
fail "BUILD.bazel not created"
@@ -48,7 +46,7 @@
touch soong_tests/a/irrelevant.txt
- run_soong --bazel-mode nothing
+ run_soong --bazel-mode-staging nothing
local mtime_build2=$(stat -c "%y" out/soong/bp2build/soong_tests/a/b/BUILD.bazel)
local mtime_ninja2=$(stat -c "%y" out/soong/build.ninja)