Skip to content

Commit f4e1036

Browse files
committed
Removing line ending matches in tests to be compatible on Windows
grep was upgraded to 3.5 after updating MSYS on Winodws VM, which no longer matches CRLF line endings with `$`. Fixes #13816 RELNOTES: None PiperOrigin-RevId: 389600750
1 parent 7bbff61 commit f4e1036

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/test/shell/bazel/resource_compiler_toolchain_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ function _assert_outputs() {
181181
[[ -e bazel-bin/foo.res ]] || fail "missing output"
182182
grep -q "src=foo.rc" "bazel-bin/foo.res" || fail "bad output"
183183
grep -q "out=.*\bfoo.res" "bazel-bin/foo.res" || fail "bad output"
184-
grep -q ".*\bres1.dat$" "bazel-bin/foo.res" || fail "bad output"
185-
grep -q ".*\bres2.dat$" "bazel-bin/foo.res" || fail "bad output"
184+
grep -q ".*\bres1.dat" "bazel-bin/foo.res" || fail "bad output"
185+
grep -q ".*\bres2.dat" "bazel-bin/foo.res" || fail "bad output"
186186

187187
[[ -e bazel-bin/bar.res ]] || fail "missing output"
188188
grep -q "src=bar.rc" "bazel-bin/bar.res" || fail "bad output"
189189
grep -q "out=.*\bbar.res" "bazel-bin/bar.res" || fail "bad output"
190-
grep -q ".*\bres1.dat$" "bazel-bin/bar.res" || fail "bad output"
191-
grep -q ".*\bres2.dat$" "bazel-bin/bar.res" || fail "bad output"
190+
grep -q ".*\bres1.dat" "bazel-bin/bar.res" || fail "bad output"
191+
grep -q ".*\bres2.dat" "bazel-bin/bar.res" || fail "bad output"
192192
}
193193

194194
function _assert_no_outputs() {

src/test/shell/integration/loading_phase_test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,24 +598,24 @@ function test_path_from_subdir() {
598598
cd "$pkg/subdir"
599599
bazel query '../BUILD + ../foo' >output 2> "$TEST_log" \
600600
|| fail "Expected success"
601-
assert_contains "^//$pkg:BUILD\$" output
602-
assert_contains "^//$pkg:foo\$" output
601+
assert_contains "^//$pkg:BUILD" output
602+
assert_contains "^//$pkg:foo" output
603603
}
604604

605605
function test_target_with_BUILD() {
606606
local -r pkg="${FUNCNAME}"
607607
mkdir -p "$pkg" || fail "could not create \"$pkg\""
608608
echo 'filegroup(name = "foo/BUILD", srcs = [])' > "$pkg/BUILD" || fail "echo"
609609
bazel query "$pkg/foo/BUILD" >output 2> "$TEST_log" || fail "Expected success"
610-
assert_contains "^//$pkg:foo/BUILD\$" output
610+
assert_contains "^//$pkg:foo/BUILD" output
611611
}
612612

613613
function test_directory_with_BUILD() {
614614
local -r pkg="${FUNCNAME}"
615615
mkdir -p "$pkg/BUILD" || fail "could not create \"$pkg/BUILD\""
616616
touch "$pkg/BUILD/BUILD" || fail "Couldn't touch"
617617
bazel query "$pkg/BUILD" >output 2> "$TEST_log" || fail "Expected success"
618-
assert_contains "^//$pkg/BUILD:BUILD\$" output
618+
assert_contains "^//$pkg/BUILD:BUILD" output
619619
}
620620

621621
function test_missing_BUILD() {

src/test/shell/integration/target_compatible_with_test.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ EOF
629629
# Validate that we get the dependency chain printed out.
630630
expect_log '^Dependency chain:$'
631631
expect_log '^ //target_skipping:generate_with_tool$'
632-
expect_log "^ //target_skipping:generator_tool <-- target platform didn't satisfy constraint //target_skipping:foo1$"
632+
expect_log "^ //target_skipping:generator_tool <-- target platform didn't satisfy constraint //target_skipping:foo1"
633633
expect_log 'FAILED: Build did NOT complete successfully'
634634
635635
# Validate the test.
@@ -644,7 +644,7 @@ EOF
644644
expect_log '^Dependency chain:$'
645645
expect_log '^ //target_skipping:generated_test$'
646646
expect_log '^ //target_skipping:generate_with_tool$'
647-
expect_log "^ //target_skipping:generator_tool <-- target platform didn't satisfy constraint //target_skipping:foo1$"
647+
expect_log "^ //target_skipping:generator_tool <-- target platform didn't satisfy constraint //target_skipping:foo1"
648648
expect_log 'FAILED: Build did NOT complete successfully'
649649
}
650650
@@ -692,7 +692,7 @@ EOF
692692
expect_log '^Dependency chain:$'
693693
expect_log '^ //target_skipping:generated_test$'
694694
expect_log '^ //target_skipping:generate_with_tool$'
695-
expect_log "^ //target_skipping:generator_tool <-- target platform didn't satisfy constraints \[//target_skipping:foo1, //target_skipping:bar2\]$"
695+
expect_log "^ //target_skipping:generator_tool <-- target platform didn't satisfy constraints \[//target_skipping:foo1, //target_skipping:bar2\]"
696696
expect_log 'FAILED: Build did NOT complete successfully'
697697
}
698698
@@ -848,7 +848,7 @@ EOF
848848
849849
# Make sure that the contents of the file are what we expect.
850850
cp ../${PRODUCT_NAME}-bin/target_skipping/host_tool_message.txt "${TEST_log}"
851-
expect_log '^Hello World$'
851+
expect_log 'Hello World'
852852
}
853853
854854
# Validates that we successfully skip analysistest rule targets when they
@@ -916,8 +916,8 @@ function test_query() {
916916
bazel query \
917917
'deps(//target_skipping:sh_foo1)' &> "${TEST_log}" \
918918
|| fail "Bazel query failed unexpectedly."
919-
expect_log '^//target_skipping:sh_foo1$'
920-
expect_log '^//target_skipping:genrule_foo1$'
919+
expect_log '^//target_skipping:sh_foo1'
920+
expect_log '^//target_skipping:genrule_foo1'
921921
}
922922
923923
# Run a cquery on a target that is compatible. This should pass.

0 commit comments

Comments
 (0)