README_DOCS.rst: update tg prev and tg next usage summary
[topgit/pro.git] / t / t1000-usage-and-version.sh
blobdda13e72e374f6893a18faf7e703e5ac22308b01
1 #!/bin/sh
3 test_description='basic tg do-nothing commands work anywhere
5 The basic `tg version` `tg precheck` and friends should all work just fine
6 in or not in a Git repository without complaint.
9 TEST_NO_CREATE_REPO=1
11 . ./test-lib.sh
13 test_plan 8
15 test_expect_success 'test setup' '
16 mkdir norepo &&
17 test_create_repo repo
20 test_expect_success 'version' '
21 (cd norepo && test -n "$(tg version)") &&
22 (cd repo && test -n "$(tg version)")
25 test_expect_success 'precheck' '
26 (cd norepo && tg precheck) &&
27 (cd repo && tg precheck)
30 test_expect_success 'hook include' '
31 tg__include=1 && export tg__include &&
32 (cd norepo && test_might_fail tg 2>/dev/null) &&
33 (cd repo && tg)
36 test_expect_success 'hooks path' '
37 (cd norepo && test -d "$(tg --hooks-path)") &&
38 (cd repo && test -d "$(tg --hooks-path)")
41 test_expect_success 'help outside repo' '
42 cd norepo &&
43 tg help >/dev/null &&
44 tg -h >/dev/null &&
45 tg --help >/dev/null &&
46 tg help tg >/dev/null
49 test_expect_success 'help inside repo' '
50 cd repo &&
51 tg help >/dev/null &&
52 tg -h >/dev/null &&
53 tg --help >/dev/null &&
54 tg help tg >/dev/null
57 test_expect_success 'bad options' '
59 cd norepo &&
60 test_must_fail tg --no-such-option &&
61 test_must_fail tg -r &&
62 test_must_fail tg -C &&
63 test_must_fail tg -c
64 ) >/dev/null 2>&1 &&
66 cd repo &&
67 test_must_fail tg --no-such-option &&
68 test_must_fail tg -r &&
69 test_must_fail tg -C &&
70 test_must_fail tg -c
71 ) >/dev/null 2>&1
74 test_done