[LTP] [PATCH v2 3/4] shell lib: Add basic support for test setup

Cyril Hrubis chrubis@suse.cz
Fri May 2 11:36:23 CEST 2025


Hi!
> test.sh
>   . tst_env.sh
>   . tst_loader.sh
>     tst_run_shell test.sh
>       . tst_env.sh
>       . tst_loader.sh

Maybe we can even simplify this a bit more if we move the part that
calls the tst_run_shell before we parse the whole shell test.

I guess that this would work:

test.sh
  . tst_loader.sh
    tst_run_shell test.sh
    . tst_loader.sh
      . tst_env.sh
    . tst_run.sh


 And the tst_loader.sh would be untouched and the code you are adding to
 tst_loader.sh in this patch would go to the tst_run.sh.

 That way we would include tst_env.sh in the tst_loader.sh on it's
 second invocation, parse the shell test code and finally in tst_run.sh
 setup the cleanup trap, call the setup and run the actual test.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list