summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <Jiri Olsa jolsa@redhat.com>2011-06-15 23:19:12 +0200
committerJiri Olsa <Jiri Olsa jolsa@redhat.com>2011-06-17 12:08:12 +0200
commit84e8f950cc8705bfdc7dee571f59153daeea180a (patch)
tree93d8784e394db84e38b10ce3de27a5223903ea91
parentbe08addc50d60683fdcc9c3b8cf4488d940e3b96 (diff)
downloadlatrace-84e8f950cc8705bfdc7dee571f59153daeea180a.tar.gz
latrace-84e8f950cc8705bfdc7dee571f59153daeea180a.tar.xz
latrace-84e8f950cc8705bfdc7dee571f59153daeea180a.zip
test: Move all tests to scripts
Moving test-args/test-common into scripts, to have common way of running and cheking tests results.
-rw-r--r--ChangeLog1
-rw-r--r--test/script/functions.sh3
-rw-r--r--test/script/test_args.sh9
-rw-r--r--test/script/test_common.sh9
-rw-r--r--test/script/test_kill.sh2
-rw-r--r--test/script/test_tty_output.sh2
-rwxr-xr-xtest/test.sh12
7 files changed, 25 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c6ae78..02130df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2011-06-15 Jiri Olsa <olsajiri@gmail.com>
* global_symbol fix - proper tree management
* make tracer return actual tracee status
+ * move all tests to scripts
2011-06-02 Jiri Olsa <olsajiri@gmail.com>
* adding large file support
diff --git a/test/script/functions.sh b/test/script/functions.sh
index 361b364..523116d 100644
--- a/test/script/functions.sh
+++ b/test/script/functions.sh
@@ -3,7 +3,8 @@
function CHECK_RET
{
if [ $? -ne 0 ]; then
- echo "FAILED"
+ echo " FAILED"
+ exit -1
else
echo -n "."
fi
diff --git a/test/script/test_args.sh b/test/script/test_args.sh
new file mode 100644
index 0000000..f416dc1
--- /dev/null
+++ b/test/script/test_args.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+. $PWD/test/script/functions.sh
+
+function test_args
+{
+ LD_LIBRARY_PATH=$PWD ./latrace -qR -a $PWD/test/lib-test-args.conf ./test-args > /dev/null
+ CHECK_RET
+}
diff --git a/test/script/test_common.sh b/test/script/test_common.sh
new file mode 100644
index 0000000..f342842
--- /dev/null
+++ b/test/script/test_common.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+. $PWD/test/script/functions.sh
+
+function test_common
+{
+ LD_LIBRARY_PATH=$PWD ./latrace -qR ./test-common > /dev/null
+ CHECK_RET
+}
diff --git a/test/script/test_kill.sh b/test/script/test_kill.sh
index 90a62f7..995df49 100644
--- a/test/script/test_kill.sh
+++ b/test/script/test_kill.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
. $PWD/test/script/functions.sh
diff --git a/test/script/test_tty_output.sh b/test/script/test_tty_output.sh
index 70d7b07..c79f943 100644
--- a/test/script/test_tty_output.sh
+++ b/test/script/test_tty_output.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
. $PWD/test/script/functions.sh
diff --git a/test/test.sh b/test/test.sh
index 296c91a..46f8cf8 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -3,17 +3,9 @@
# Force locale to ensure we always get the same output
export LC_ALL=C
-# common tests
-echo "[APP test-common]"
-LD_LIBRARY_PATH=$PWD ./latrace -qR ./test-common
-
-# arguments tests
-echo "[APP test-args]"
-LD_LIBRARY_PATH=$PWD ./latrace -qR -a $PWD/test/lib-test-args.conf ./test-args
-
-# script tests
-echo "[SCRIPTS]"
. $PWD/test/script/functions.sh
+TEST test_args
+TEST test_common
TEST test_tty_output
TEST test_kill