Skip to content

Commit

Permalink
add integ test
Browse files Browse the repository at this point in the history
  • Loading branch information
wisechengyi committed Mar 9, 2021
1 parent 23cdaf7 commit 2a5ef01
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static final class Options extends OptionsBase {
+ "to disable the search for a user rc file, e.g. in release builds.\n"
+ "If unspecified, Bazel uses the first .bazelrc file it finds in "
+ "the following two locations: the workspace directory, then the user's home "
+ "directory. \n"
+ "directory.\n"
+ "Note: command line options will always supersede any option in bazelrc.")
public String blazerc;

Expand Down
12 changes: 12 additions & 0 deletions src/test/shell/integration/startup_options_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,16 @@ function test_multiple_bazelrc_set_different_options() {
expect_log "Inherited 'common' options: --test_output=all"
}

function test_bazelrc_after_devnull_ignored() {
echo "common --verbose_failures" > 1.rc
echo "common --test_output=all" > 2.rc
echo "common --definitely_invalid_config" > 3.rc

bazel "--${PRODUCT_NAME}rc=1.rc" "--${PRODUCT_NAME}rc=2.rc" "--${PRODUCT_NAME}rc=/dev/null" \
"--${PRODUCT_NAME}rc=3.rc" build --announce_rc &> $TEST_log || fail "Should pass"
expect_log "Inherited 'common' options: --verbose_failures"
expect_log "Inherited 'common' options: --test_output=all"
expect_not_log "--definitely_invalid_config"
}

run_suite "${PRODUCT_NAME} startup options test"

0 comments on commit 2a5ef01

Please sign in to comment.