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>