Hi!
In order to make consistent usage of temporary directory and other
things in tests written in shell I've prototyped a simple library that
more or less mirrors the C test interface (when it's posible and when it
makes sense). All functions and variables from the test library are
prefixed with tst_ or TST_ you should not define variables with this
prefixes except for the TST_CLEANUP.

The expected usage is following:

#!/bin/sh
TCID=foo
. test.sh

cleanup()
{
        tst_rmdir
}

# if test needs to run as root
tst_require_root

# if test needs to run in temporary directory
# the content of TST_CLEANUP variable is evaluated
# on test exit
tst_tmpdir
TST_CLEANUP=cleanup

tst_resm TPASS "Testcase passed"
tst_brkm TFAIL "Testcase failed, this will exit the test immediately"

# exits the test with return value from the tst_resm
tst_exit

As usuall comments and patches are welcome :)

-- 
Cyril Hrubis
[email protected]

Attachment: test.sh
Description: Bourne shell script

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to