diff options
author | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-05-05 08:54:40 +0200 |
---|---|---|
committer | Jiri Olsa <Jiri Olsa jolsa@redhat.com> | 2011-05-05 08:54:40 +0200 |
commit | 29420f774dc55c794cebefe24aadc90280601b79 (patch) | |
tree | b2f371bebd836a564de30c5fbec7a659c90515ad /test | |
parent | c9d0018b9e527168292f8d40273a9e97223c0bc8 (diff) | |
download | latrace-29420f774dc55c794cebefe24aadc90280601b79.tar.gz latrace-29420f774dc55c794cebefe24aadc90280601b79.tar.xz latrace-29420f774dc55c794cebefe24aadc90280601b79.zip |
adding OUTPUT_TTY config file option
- added OUTPUT_TTY config file option
it is possible to catch traced program tty output and
storing it to the configured file (0/1/2 descriptors
are monitored)
- added automated test for the option
- refactoring process method a bit
- disabling connection between -R and -q options
Diffstat (limited to 'test')
-rw-r--r-- | test/script/test_tty_output.sh | 34 | ||||
-rwxr-xr-x | test/test.sh | 11 |
2 files changed, 43 insertions, 2 deletions
diff --git a/test/script/test_tty_output.sh b/test/script/test_tty_output.sh new file mode 100644 index 0000000..d1014d6 --- /dev/null +++ b/test/script/test_tty_output.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +function tto_init +{ + cat > /tmp/tto_latrace.conf <<EOF +OPTIONS { + OUTPUT_TTY = "/tmp/tto_latrace.output" +} +EOF +} + +function tto_cleanup +{ + rm -f /tmp/tto_latrace.conf + rm -f /tmp/tto_latrace.output +} + +function test_tty_output +{ + tto_init + + LD_LIBRARY_PATH=$PWD ./latrace -N /tmp/tto_latrace.conf -q /bin/cat \ + $PWD/test/script/test_tty_output.sh > /dev/null + + diff /tmp/tto_latrace.output $PWD/test/script/test_tty_output.sh + if [ $? -ne 0 ]; then + echo "FAILED test_tty_output" + exit + fi + + tto_cleanup + + echo . +} diff --git a/test/test.sh b/test/test.sh index 055a449..efcd545 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,7 +1,14 @@ #!/bin/sh # common tests -LD_LIBRARY_PATH=$PWD ./latrace -q ./test-common +echo "[APP test-common]" +LD_LIBRARY_PATH=$PWD ./latrace -qR ./test-common # arguments tests -LD_LIBRARY_PATH=$PWD ./latrace -q -a $PWD/test/lib-test-args.conf ./test-args +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/test_tty_output.sh +test_tty_output |