echo "Testing reactjs @JSX ppx..." setglobal testPath = '"miscTests/reactjs_jsx_ppx_tests'" for i in [1 2 3 4 5] { setglobal test = ""$testPath/test$i.re"" setglobal 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 setglobal 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 } }