Deal with `wc -l' putting spaces in the output.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 21 Jun 2005 04:08:53 +0000 (04:08 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 21 Jun 2005 04:08:53 +0000 (04:08 +0000)
src/tests/Make.tests

index 00b9097c8420b7bd2ddf2f22b019f9f0a4cac757..44e8d5e495b91fb5a6727b99f3ebc8124f9c8da9 100644 (file)
@@ -26,13 +26,13 @@ grade:: results
 
 check:: results
        @cat $<
-       @COUNT="`egrep '^(pass|FAIL) ' $< | wc -l`";            \
-       FAILURES="`egrep '^FAIL ' $< | wc -l`";                 \
-       if [ "$$FAILURES" = 0 ]; then                           \
-               echo "All $$COUNT tests passed.";               \
-       else                                                    \
-               echo "$$FAILURES of $$COUNT tests failed.";     \
-               exit 1;                                         \
+       @COUNT="`egrep '^(pass|FAIL) ' $< | wc -l | sed 's/[    ]//g;'`"; \
+       FAILURES="`egrep '^FAIL ' $< | wc -l | sed 's/[         ]//g;'`"; \
+       if [ $$FAILURES = 0 ]; then                                       \
+               echo "All $$COUNT tests passed.";                         \
+       else                                                              \
+               echo "$$FAILURES of $$COUNT tests failed.";               \
+               exit 1;                                                   \
        fi
 
 results: $(RESULTS)