cgitsb/tests/t0108-patch.sh
John Keeping c95cc5ec56 tests: use Git's test framework
This allows tests to run in parallel as well as letting us use "prove"
or another TAP harness to run the tests.

Git's test framework requires Git to be fully built before letting any
tests run, so add a new target to the top-level Makefile which builds
all of Git instead of just libgit.a and make the "test" target depend on
that.

Signed-off-by: John Keeping <john@keeping.me.uk>
2013-04-08 22:27:11 +02:00

39 sor
743 B
Bash
Executable File

#!/bin/sh
test_description='Check content on patch page'
. ./setup.sh
test_expect_success 'generate foo/patch' '
cgit_query "url=foo/patch" >tmp
'
test_expect_success 'find `From:` line' '
grep "^From: " tmp
'
test_expect_success 'find `Date:` line' '
grep "^Date: " tmp
'
test_expect_success 'find `Subject:` line' '
grep "^Subject: commit 5" tmp
'
test_expect_success 'find `cgit` signature' '
tail -1 tmp | grep "^cgit"
'
test_expect_success 'find initial commit' '
root=$(git --git-dir="$PWD/repos/foo/.git" rev-list HEAD | tail -1)
'
test_expect_success 'generate patch for initial commit' '
cgit_query "url=foo/patch&id=$root" >tmp
'
test_expect_success 'find `cgit` signature' '
tail -1 tmp | grep "^cgit"
'
test_done