Skip to content

Commit f53941c

Browse files
committed
Fix runtime warnings test
1 parent 271714f commit f53941c

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

test/error_if_warnings.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ grep -E "^warning: .+" --after-context=6 <&0
22

33
if [ $? -eq 0 ]
44
then
5-
exit 1
5+
echo "error: Runtime warnings detected. Exiting ..."
6+
exit 255
67
else
78
exit 0
89
fi

test/runtime_warnings.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,33 @@ set -e
55
mix compile --force --warnings-as-errors
66

77

8-
mix credo --mute-exit-status | ./test/error_if_warnings.sh
8+
mix credo --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
99

10-
mix credo --strict --enable-disabled-checks . --mute-exit-status | ./test/error_if_warnings.sh
10+
mix credo --strict --enable-disabled-checks . --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
1111

12-
mix credo --strict --enable-disabled-checks . --mute-exit-status --format=json | ./test/error_if_warnings.sh
12+
mix credo --strict --enable-disabled-checks . --mute-exit-status --format=json 2>&1 | ./test/error_if_warnings.sh
1313

14-
mix credo lib/credo.ex --read-from-stdin --strict < lib/credo.ex | ./test/error_if_warnings.sh
14+
mix credo lib/credo.ex --read-from-stdin --strict < lib/credo.ex 2>&1 | ./test/error_if_warnings.sh
1515

16-
mix credo list --mute-exit-status | ./test/error_if_warnings.sh
16+
mix credo list --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
1717

18-
mix credo suggest --mute-exit-status | ./test/error_if_warnings.sh
18+
mix credo suggest --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
1919

20-
mix credo diff HEAD^ --mute-exit-status | ./test/error_if_warnings.sh
20+
mix credo diff HEAD^ --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
2121

22-
mix credo diff v1.4.0 --mute-exit-status | ./test/error_if_warnings.sh
22+
mix credo diff v1.4.0 --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
2323

24-
mix credo explain test/fixtures/example_code/clean_redux.ex:1:11 --mute-exit-status | ./test/error_if_warnings.sh
24+
mix credo explain test/fixtures/example_code/clean_redux.ex:1:11 --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
2525

26-
mix credo explain Credo.Check.Refactor.Nesting --mute-exit-status | ./test/error_if_warnings.sh
26+
mix credo explain Credo.Check.Refactor.Nesting --mute-exit-status 2>&1 | ./test/error_if_warnings.sh
2727

28-
mix credo categories | ./test/error_if_warnings.sh
28+
mix credo categories 2>&1 | ./test/error_if_warnings.sh
2929

30-
mix credo info --verbose | ./test/error_if_warnings.sh
30+
mix credo info --verbose 2>&1 | ./test/error_if_warnings.sh
3131

32-
mix credo version | ./test/error_if_warnings.sh
32+
mix credo version 2>&1 | ./test/error_if_warnings.sh
3333

34-
mix credo help | ./test/error_if_warnings.sh
34+
mix credo help 2>&1 | ./test/error_if_warnings.sh
3535

3636

3737
echo ""

0 commit comments

Comments
 (0)