[folks] tests: Add execute-test.sh to do test output capturing. tests: Call execute-test.sh from each of wit



commit 358e7d8cd7c62f7df4f0897922881ebebb19f925
Author: Jeremy Whiting <jpwhiting kde org>
Date:   Mon Jul 16 10:19:10 2012 -0600

    tests: Add execute-test.sh to do test output capturing.
    tests: Call execute-test.sh from each of with-session-bus scripts.

 tests/tools/execute-test.sh             |   28 ++++++++++++++++++++++++++++
 tests/tools/with-session-bus-eds.sh     |    3 ++-
 tests/tools/with-session-bus-tracker.sh |    2 +-
 tests/tools/with-session-bus.sh         |   18 ++----------------
 4 files changed, 33 insertions(+), 18 deletions(-)
---
diff --git a/tests/tools/execute-test.sh b/tests/tools/execute-test.sh
new file mode 100755
index 0000000..cb211aa
--- /dev/null
+++ b/tests/tools/execute-test.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+# with-session-bus.sh - run a program with a temporary D-Bus session daemon
+#
+# interesting bits have been move into dbus to permit reusability
+#
+# Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+
+e=0
+
+if test -t 1 && test "z$CHECK_VERBOSE" != z; then
+  "$@" || e=$?
+else
+  "$@" > capture-$$.log 2>&1 || e=$?
+fi
+
+# if exit code is 0, check for skipped tests
+if test z$e = z0; then
+  grep -i skipped capture-$$.log || true
+  rm -f capture-$$.log
+# exit code is not 0, so output log and exit
+else
+  cat capture-$$.log
+  exit $e
+fi
diff --git a/tests/tools/with-session-bus-eds.sh b/tests/tools/with-session-bus-eds.sh
index e3c1e5d..faa5848 100755
--- a/tests/tools/with-session-bus-eds.sh
+++ b/tests/tools/with-session-bus-eds.sh
@@ -37,7 +37,8 @@ dbus_start
 eds_start
 
 e=0
-"$@" || e=$?
+
+$cur_dir"/execute-test.sh" "$@" || e=$?
 
 trap - INT HUP TERM
 cleanup
diff --git a/tests/tools/with-session-bus-tracker.sh b/tests/tools/with-session-bus-tracker.sh
index e0c10b7..1bef880 100755
--- a/tests/tools/with-session-bus-tracker.sh
+++ b/tests/tools/with-session-bus-tracker.sh
@@ -37,7 +37,7 @@ dbus_start
 tracker_start
 
 e=0
-"$@" || e=$?
+$cur_dir"/execute-test.sh" "$@" || e=$?
 
 trap - INT HUP TERM
 cleanup
diff --git a/tests/tools/with-session-bus.sh b/tests/tools/with-session-bus.sh
index d807688..fa78f94 100755
--- a/tests/tools/with-session-bus.sh
+++ b/tests/tools/with-session-bus.sh
@@ -31,23 +31,9 @@ trap cleanup INT HUP TERM
 dbus_init 0
 dbus_start
 
-e=0
-
-if test -t 1 && test "z$CHECK_VERBOSE" != z; then
-  "$@" || e=$?
-else
-  "$@" > capture-$$.log 2>&1 || e=$?
-fi
+$cur_dir"/execute-test.sh" "$@" || e=$?
 
 trap - INT HUP TERM
 cleanup
 
-# if exit code is 0, check for skipped tests
-if test z$e = z0; then
-  grep -i skipped capture-$$.log || true
-  rm -f capture-$$.log
-# exit code is not 0, so output log and exit
-else
-  cat capture-$$.log
-  exit $e
-fi
+exit $e



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]