Commits

Peter Szilagyi committed 5ff32f8

included ocp-indent tests, showed diffs, and updated ocp-indent location

Comments (0)

Files changed (1)

ocp-indent/regressions/runtests

 #!/bin/bash
 
-tests=$(ls *.ml)
+cd $(dirname "$0")		# relative filenames and patterns
+
+tests=$(ls *.ml ../../ocaml/contrib/ocp-indent/tests/*.ml)
 
 fail=0
 
-indent=ocp-indent
+indent=../../bin/ocp-indent
 
-echo "Running $(ls *.ml | wc -l | sed 's/[^0-9]//g') tests"
+diff="diff -u"
+
+echo "Running $(echo "$tests" | wc -l | sed 's/[^0-9]//g') tests"
 
 for test in $tests; do
     out1=$test.out1
 
     # already indented
     $indent $test > $out
-    if ! $(cmp $test $out &> /dev/null); then
+    if ! $diff $test $out; then
         fail=1
         echo "Test $test failed when already indented!"
     fi
 
+    # CR pszilagyi: Should this pass?  It changes indentation.
+    if false; then
+
     # flushleft
     sed -E 's/^ +//' $test > $out1
     $indent $out1 > $out
-    if ! $(cmp $test $out &> /dev/null); then
-        fail=1
+    if ! $diff $test $out; then
+	fail=1
         echo "Test $test failed on flush-left!"
     fi
 
+    fi
+
     # spaces in front of lines
     sed -E 's/^ *([^ ])/             \1/' $test > $out1
     $indent $out1 > $out
-    if ! $(cmp $test $out &> /dev/null); then
+    if ! $diff $test $out; then
         fail=1
         echo "Test $test failed on added spaces!"
     fi