[gegl] tests: Fix some small errors
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] tests: Fix some small errors
- Date: Mon, 24 Jan 2011 14:38:09 +0000 (UTC)
commit 7d0789eaeadf4cb1e1111dbfdf7068c364a958c6
Author: Tobias Ellinghaus <houz gmx de>
Date: Mon Jan 24 15:00:41 2011 +0100
tests: Fix some small errors
* Return 1 instead of -1 if a test fails.
* Don't use wc to count the output of grep. Use -c instead.
* set LC_ALL=C when calling diff. Otherwise it makes no sense to grep the
output.
tests/buffer/Makefile.am | 2 +-
tests/buffer/buffer-tests-results.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/buffer/Makefile.am b/tests/buffer/Makefile.am
index c5511f9..857fd87 100644
--- a/tests/buffer/Makefile.am
+++ b/tests/buffer/Makefile.am
@@ -55,7 +55,7 @@ buffer-tests.inc: $(buffer_test_SOURCES) Makefile.am $(top_srcdir)/tests/buffer/
buffer-tests-report: buffer-test$(EXEEXT) $(top_srcdir)/tests/buffer/reference/*.buf
@mkdir -p output > /dev/null 2>&1
./buffer-test$(EXEEXT)
- for f in $(top_srcdir)/tests/buffer/reference/*.buf; do diff --report-identical-files --context=50 $$f output/`basename $$f`; done > buffer-tests-report; true
+ for f in $(top_srcdir)/tests/buffer/reference/*.buf; do LC_ALL=C diff --report-identical-files --context=50 $$f output/`basename $$f`; done > buffer-tests-report; true
clean-local:
rm -rf output
diff --git a/tests/buffer/buffer-tests-results.sh b/tests/buffer/buffer-tests-results.sh
index 11819eb..fff9169 100755
--- a/tests/buffer/buffer-tests-results.sh
+++ b/tests/buffer/buffer-tests-results.sh
@@ -4,7 +4,7 @@
reference_dir=$REFERENCE_DIR
total_tests=`ls -1 $reference_dir/*.buf | wc -l`
-successful_tests=`cat buffer-tests-report | grep identical | wc -l`
+successful_tests=`cat buffer-tests-report | grep -c identical`
echo $successful_tests of $total_tests tests succesful.
@@ -13,5 +13,5 @@ then
exit 0;
else
echo Look in the file \"buffer-tests-report\" for detailed failure information.
-exit -1;
+exit 1;
fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]