From 84e8f950cc8705bfdc7dee571f59153daeea180a Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Wed, 15 Jun 2011 23:19:12 +0200 Subject: test: Move all tests to scripts Moving test-args/test-common into scripts, to have common way of running and cheking tests results. --- ChangeLog | 1 + test/script/functions.sh | 3 ++- test/script/test_args.sh | 9 +++++++++ test/script/test_common.sh | 9 +++++++++ test/script/test_kill.sh | 2 +- test/script/test_tty_output.sh | 2 +- test/test.sh | 12 ++---------- 7 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 test/script/test_args.sh create mode 100644 test/script/test_common.sh diff --git a/ChangeLog b/ChangeLog index 3c6ae78..02130df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2011-06-15 Jiri Olsa * global_symbol fix - proper tree management * make tracer return actual tracee status + * move all tests to scripts 2011-06-02 Jiri Olsa * 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 -- cgit