-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathtest.sh
executable file
·30 lines (27 loc) · 1003 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
for file in src/*.{res,resi}; do
output="$(dirname $file)/expected/$(basename $file).txt"
../../rescript-editor-analysis.exe test $file &> $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
fi
done
for file in not_compiled/*.{res,resi}; do
output="$(dirname $file)/expected/$(basename $file).txt"
../../rescript-editor-analysis.exe test $file &> $output
# CI. We use LF, and the CI OCaml fork prints CRLF. Convert.
if [ "$RUNNER_OS" == "Windows" ]; then
perl -pi -e 's/\r\n/\n/g' -- $output
fi
done
warningYellow='\033[0;33m'
successGreen='\033[0;32m'
reset='\033[0m'
diff=$(git ls-files --modified src/expected)
if [[ $diff = "" ]]; then
printf "${successGreen}✅ No unstaged tests difference.${reset}\n"
else
printf "${warningYellow}⚠️ There are unstaged differences in tests/! Did you break a test?\n${diff}\n${reset}"
git --no-pager diff src/expected
exit 1
fi