Merge branch 'dk/blame-el' into pu
[git/spearce.git] / t / t9502-gitweb-standalone-parse-output.sh
blob5f2b1d53a0818acd917cb94c2a40442cd9c0dc37
1 #!/bin/sh
3 # Copyright (c) 2009 Mark Rada
6 test_description='gitweb as standalone script (parsing script output).
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.'
13 . ./gitweb-lib.sh
15 # ----------------------------------------------------------------------
16 # snapshot file name
18 test_commit \
19 'SnapshotFileTests' \
20 'i can has snapshot?'
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
28 test_debug 'cat gitweb.output'
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
35 test_debug 'cat gitweb.output'
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
43 test_debug 'cat gitweb.output'
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
50 test_debug 'cat gitweb.output'
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
57 test_debug 'cat gitweb.output'
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
64 test_debug 'cat gitweb.output'
67 test_done