[LTP] new shell library

Cyril Hrubis chrubis@suse.cz
Wed Oct 12 15:17:26 CEST 2016


Hi!
> What about greping the test source as in [2] instead? Because that way
> we can print error if the test source touches any of the internally used
> variables as well. For instance if it tries to do anything with
> TST_PASS/TST_FAIL/...

What about this one:

https://github.com/metan-ucw/ltp/commit/445e3ae253bdd11f18ec12ccc74fe99eb582eeb6

$ cat d.sh

#!/bin/sh
TST_ID="test"
TST_TESTFUNC=do_test
. tst_test.sh

do_test()
{
        tst_res TPASS "Passed"

        TST_FOO=1

        echo "$TST_PASS"
}

tst_run

# PATH is set to contain both path to tst_test.sh and d.sh
$ ./d.sh
test 1 TWARN : Reserved variable TST_FOO used!
test 1 TWARN : Reserved variable TST_PASS used!
test 1 TPASS : Passed
1

Summary:
passed   1
failed   0
skipped  0
warnings 2

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list