test-lib-functions-tg.sh: introduce TopGit-specific test functions library
commit54981a9a80de5ad181f3e8dedd806525278bb628
authorKyle J. McKay <mackyle@gmail.com>
Fri, 17 Mar 2017 21:28:00 +0000 (17 14:28 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Fri, 17 Mar 2017 21:28:00 +0000 (17 14:28 -0700)
tree1d7d33900a086d4e6a5294e25278b8549d846c2f
parentace20e676d7ab1438d0ef472342d59b1d02742a2
test-lib-functions-tg.sh: introduce TopGit-specific test functions library

The "test-lib-functions-tg.sh" file works very similarly to the
"test-lib-functions.sh" file but contains only TopGit specific functions.

The testing library now arranges to source it just like it does
for the "test-lib-functions.sh" file.

Also the following changes were made to better accomodate the new
"test-lib-functions-tg.sh" file and its contents:

  * the test library now sets and exports TG_FULL_PATH which is
    the full path to the "tg" binary (might be the wrapper) that
    should be used for testing

  * the "tg" wrapper now supports the special "tg__include" variable
    and, if set, will source the wrapped "tg" as the final line rather
    than exec'ing it

  * the "die" and "fatal" functions have been renamed to "_die" and
    "_fatal" with one-line pass-through "die" and "fatal" function
    front ends

  * the EXIT trap now uses "_die" rather than "die" in case some
    included file (such as tg) replaces the "die" function

A single initial TopGit specific function is provided named "tg_include"
which, as you might have guessed, sources the target "tg" in "include"
mode (i.e. with "tg__include=1" set).  It does support a few options to
make use of the "include" mode easier (-C, -u, -r, -f) but does not
otherwise do anything beyond the actual "include".

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Makefile
t/test-lib-functions-tg.sh [new file with mode: 0644]
t/test-lib-main.sh
t/test-lib.sh