Merge branch 'dk/blame-el' into pu
[git] / t / t9502-gitweb-standalone-parse-output.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2009 Mark Rada
4 #
5
6 test_description='gitweb as standalone script (parsing script output).
7
8 This test runs gitweb (git web interface) as a CGI script from the
9 commandline, and checks that it produces the correct output, either
10 in the HTTP header or the actual script output.'
11
12
13 . ./gitweb-lib.sh
14
15 # ----------------------------------------------------------------------
16 # snapshot file name
17
18 test_commit \
19         'SnapshotFileTests' \
20         'i can has snapshot?'
21
22 test_expect_success 'snapshots: give full hash' '
23         ID=`git rev-parse --verify HEAD` &&
24         gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
25         ID=`git rev-parse --short HEAD` &&
26         grep ".git-$ID.tar.gz" gitweb.output
27 '
28 test_debug 'cat gitweb.output'
29
30 test_expect_success 'snapshots: give short hash' '
31         ID=`git rev-parse --short HEAD` &&
32         gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
33         grep ".git-$ID.tar.gz" gitweb.output
34 '
35 test_debug 'cat gitweb.output'
36
37 test_expect_success 'snapshots: give almost full hash' '
38         ID=`git rev-parse --short=30 HEAD` &&
39         gitweb_run "p=.git;a=snapshot;h=$ID;sf=tgz" &&
40         ID=`git rev-parse --short HEAD` &&
41         grep ".git-$ID.tar.gz" gitweb.output
42 '
43 test_debug 'cat gitweb.output'
44
45 test_expect_success 'snapshots: give HEAD tree-ish' '
46         gitweb_run "p=.git;a=snapshot;h=HEAD;sf=tgz" &&
47         ID=`git rev-parse --short HEAD` &&
48         grep ".git-HEAD-$ID.tar.gz" gitweb.output
49 '
50 test_debug 'cat gitweb.output'
51
52 test_expect_success 'snapshots: give branch name tree-ish' '
53         gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" &&
54         ID=`git rev-parse --short master` &&
55         grep ".git-master-$ID.tar.gz" gitweb.output
56 '
57 test_debug 'cat gitweb.output'
58
59 test_expect_success 'snapshots: give tag tree-ish' '
60         gitweb_run "p=.git;a=snapshot;h=SnapshotFileTests;sf=tgz" &&
61         ID=`git rev-parse --short SnapshotFileTests` &&
62         grep ".git-SnapshotFileTests-$ID.tar.gz" gitweb.output
63 '
64 test_debug 'cat gitweb.output'
65
66
67 test_done