t/test-lib.sh: add test_external and test_external_without_stderr