echo "Testing reactjs @JSX ppx..." setvar testPath = ""miscTests/reactjs_jsx_ppx_tests"" for i in [1 2 3 4 5] { setvar test = ""$testPath/test$i.re"" setvar expected = $(cat $testPath/expected$i.txt) ocamlc -dsource -ppx ./reactjs_jsx_ppx.native -pp ./refmt_impl.native -impl $test \ 2>&1| sed '$ d' | sed '$ d' > $testPath/actual${i}.txt # remove the last two lines. It's noise about command failure and changes at # every run because the temporary file name in the error message changes setvar actual = $(cat $testPath/actual$i.txt) if [[ "$expected" = "$actual" ]] { echo "OK" } else { echo "Wrong" # show the error diff -u $testPath/expected$i.txt $testPath/actual$i.txt exit 1 } }