aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar John Keeping <john@keeping.me.uk>2013-03-05 06:58:49 (JST)
committerGravatar Jason A. Donenfeld <Jason@zx2c4.com>2013-03-05 09:38:44 (JST)
commit392e07d28a23aec9942b9ed0d122e35d2d268fb9 (patch)
tree352b722bec1a02b47aa86f9285043982cfe70fbc
parent78a24e5c55ac57efab90cf1e65b9af226b388a39 (diff)
downloadcgit-392e07d28a23aec9942b9ed0d122e35d2d268fb9.zip
cgit-392e07d28a23aec9942b9ed0d122e35d2d268fb9.tar.gz
tests: "grep -e" is not portable to all platforms
The "-e" option to grep is not needed unless specifying more than one pattern, which we don't do. Remove it to avoid restricting the tests on platforms that do not have a grep that recognises "-e". Signed-off-by: John Keeping <john@keeping.me.uk>
-rwxr-xr-xtests/t0101-index.sh18
-rwxr-xr-xtests/t0102-summary.sh22
-rwxr-xr-xtests/t0103-log.sh20
-rwxr-xr-xtests/t0104-tree.sh12
-rwxr-xr-xtests/t0105-commit.sh12
-rwxr-xr-xtests/t0106-diff.sh10
-rwxr-xr-xtests/t0107-snapshot.sh6
-rwxr-xr-xtests/t0108-patch.sh10
8 files changed, 55 insertions, 55 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh
index 573a351..ab63aca 100755
--- a/tests/t0101-index.sh
+++ b/tests/t0101-index.sh
@@ -5,14 +5,14 @@
5prepare_tests "Check content on index page" 5prepare_tests "Check content on index page"
6 6
7run_test 'generate index page' 'cgit_url "" >trash/tmp' 7run_test 'generate index page' 'cgit_url "" >trash/tmp'
8run_test 'find foo repo' 'grep -e "foo" trash/tmp' 8run_test 'find foo repo' 'grep "foo" trash/tmp'
9run_test 'find foo description' 'grep -e "\[no description\]" trash/tmp' 9run_test 'find foo description' 'grep "\[no description\]" trash/tmp'
10run_test 'find bar repo' 'grep -e "bar" trash/tmp' 10run_test 'find bar repo' 'grep "bar" trash/tmp'
11run_test 'find bar description' 'grep -e "the bar repo" trash/tmp' 11run_test 'find bar description' 'grep "the bar repo" trash/tmp'
12run_test 'find foo+bar repo' 'grep -e ">foo+bar<" trash/tmp' 12run_test 'find foo+bar repo' 'grep ">foo+bar<" trash/tmp'
13run_test 'verify foo+bar link' 'grep -e "/foo+bar/" trash/tmp' 13run_test 'verify foo+bar link' 'grep "/foo+bar/" trash/tmp'
14run_test 'verify "with%20space" link' 'grep -e "/with%20space/" trash/tmp' 14run_test 'verify "with%20space" link' 'grep "/with%20space/" trash/tmp'
15run_test 'no tree-link' '! grep -e "foo/tree" trash/tmp' 15run_test 'no tree-link' '! grep "foo/tree" trash/tmp'
16run_test 'no log-link' '! grep -e "foo/log" trash/tmp' 16run_test 'no log-link' '! grep "foo/log" trash/tmp'
17 17
18tests_done 18tests_done
diff --git a/tests/t0102-summary.sh b/tests/t0102-summary.sh
index f299c5a..f778cb4 100755
--- a/tests/t0102-summary.sh
+++ b/tests/t0102-summary.sh
@@ -5,22 +5,22 @@
5prepare_tests "Check content on summary page" 5prepare_tests "Check content on summary page"
6 6
7run_test 'generate foo summary' 'cgit_url "foo" >trash/tmp' 7run_test 'generate foo summary' 'cgit_url "foo" >trash/tmp'
8run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' 8run_test 'find commit 1' 'grep "commit 1" trash/tmp'
9run_test 'find commit 5' 'grep -e "commit 5" trash/tmp' 9run_test 'find commit 5' 'grep "commit 5" trash/tmp'
10run_test 'find branch master' 'grep -e "master" trash/tmp' 10run_test 'find branch master' 'grep "master" trash/tmp'
11run_test 'no tags' '! grep -e "tags" trash/tmp' 11run_test 'no tags' '! grep "tags" trash/tmp'
12run_test 'clone-url expanded correctly' ' 12run_test 'clone-url expanded correctly' '
13 grep -e "git://example.org/foo.git" trash/tmp 13 grep "git://example.org/foo.git" trash/tmp
14' 14'
15 15
16run_test 'generate bar summary' 'cgit_url "bar" >trash/tmp' 16run_test 'generate bar summary' 'cgit_url "bar" >trash/tmp'
17run_test 'no commit 45' '! grep -e "commit 45" trash/tmp' 17run_test 'no commit 45' '! grep "commit 45" trash/tmp'
18run_test 'find commit 46' 'grep -e "commit 46" trash/tmp' 18run_test 'find commit 46' 'grep "commit 46" trash/tmp'
19run_test 'find commit 50' 'grep -e "commit 50" trash/tmp' 19run_test 'find commit 50' 'grep "commit 50" trash/tmp'
20run_test 'find branch master' 'grep -e "master" trash/tmp' 20run_test 'find branch master' 'grep "master" trash/tmp'
21run_test 'no tags' '! grep -e "tags" trash/tmp' 21run_test 'no tags' '! grep "tags" trash/tmp'
22run_test 'clone-url expanded correctly' ' 22run_test 'clone-url expanded correctly' '
23 grep -e "git://example.org/bar.git" trash/tmp 23 grep "git://example.org/bar.git" trash/tmp
24' 24'
25 25
26tests_done 26tests_done
diff --git a/tests/t0103-log.sh b/tests/t0103-log.sh
index 7fa6754..67fcba0 100755
--- a/tests/t0103-log.sh
+++ b/tests/t0103-log.sh
@@ -5,21 +5,21 @@
5prepare_tests "Check content on log page" 5prepare_tests "Check content on log page"
6 6
7run_test 'generate foo/log' 'cgit_url "foo/log" >trash/tmp' 7run_test 'generate foo/log' 'cgit_url "foo/log" >trash/tmp'
8run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' 8run_test 'find commit 1' 'grep "commit 1" trash/tmp'
9run_test 'find commit 5' 'grep -e "commit 5" trash/tmp' 9run_test 'find commit 5' 'grep "commit 5" trash/tmp'
10 10
11run_test 'generate bar/log' 'cgit_url "bar/log" >trash/tmp' 11run_test 'generate bar/log' 'cgit_url "bar/log" >trash/tmp'
12run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' 12run_test 'find commit 1' 'grep "commit 1" trash/tmp'
13run_test 'find commit 50' 'grep -e "commit 50" trash/tmp' 13run_test 'find commit 50' 'grep "commit 50" trash/tmp'
14 14
15run_test 'generate "with%20space/log?qt=grep&q=commit+1"' ' 15run_test 'generate "with%20space/log?qt=grep&q=commit+1"' '
16 cgit_url "with+space/log&qt=grep&q=commit+1" >trash/tmp 16 cgit_url "with+space/log&qt=grep&q=commit+1" >trash/tmp
17' 17'
18run_test 'find commit 1' 'grep -e "commit 1" trash/tmp' 18run_test 'find commit 1' 'grep "commit 1" trash/tmp'
19run_test 'find link with %20 in path' 'grep -e "/with%20space/log/?qt=grep" trash/tmp' 19run_test 'find link with %20 in path' 'grep "/with%20space/log/?qt=grep" trash/tmp'
20run_test 'find link with + in arg' 'grep -e "/log/?qt=grep&amp;q=commit+1" trash/tmp' 20run_test 'find link with + in arg' 'grep "/log/?qt=grep&amp;q=commit+1" trash/tmp'
21run_test 'no links with space in path' '! grep -e "href=./with space/" trash/tmp' 21run_test 'no links with space in path' '! grep "href=./with space/" trash/tmp'
22run_test 'no links with space in arg' '! grep -e "q=commit 1" trash/tmp' 22run_test 'no links with space in arg' '! grep "q=commit 1" trash/tmp'
23run_test 'commit 2 is not visible' '! grep -e "commit 2" trash/tmp' 23run_test 'commit 2 is not visible' '! grep "commit 2" trash/tmp'
24 24
25tests_done 25tests_done
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh
index 2ce1251..7aa3b8d 100755
--- a/tests/t0104-tree.sh
+++ b/tests/t0104-tree.sh
@@ -5,29 +5,29 @@
5prepare_tests "Check content on tree page" 5prepare_tests "Check content on tree page"
6 6
7run_test 'generate bar/tree' 'cgit_url "bar/tree" >trash/tmp' 7run_test 'generate bar/tree' 'cgit_url "bar/tree" >trash/tmp'
8run_test 'find file-1' 'grep -e "file-1" trash/tmp' 8run_test 'find file-1' 'grep "file-1" trash/tmp'
9run_test 'find file-50' 'grep -e "file-50" trash/tmp' 9run_test 'find file-50' 'grep "file-50" trash/tmp'
10 10
11run_test 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >trash/tmp' 11run_test 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >trash/tmp'
12 12
13run_test 'find line 1' ' 13run_test 'find line 1' '
14 grep -e "<a class=.no. id=.n1. name=.n1. href=.#n1.>1</a>" trash/tmp 14 grep "<a class=.no. id=.n1. name=.n1. href=.#n1.>1</a>" trash/tmp
15' 15'
16 16
17run_test 'no line 2' ' 17run_test 'no line 2' '
18 ! grep -e "<a class=.no. id=.n2. name=.n2. href=.#n2.>2</a>" trash/tmp 18 ! grep "<a class=.no. id=.n2. name=.n2. href=.#n2.>2</a>" trash/tmp
19' 19'
20 20
21run_test 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >trash/tmp' 21run_test 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >trash/tmp'
22 22
23run_test 'verify a+b link' ' 23run_test 'verify a+b link' '
24 grep -e "/foo+bar/tree/a+b" trash/tmp 24 grep "/foo+bar/tree/a+b" trash/tmp
25' 25'
26 26
27run_test 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >trash/tmp' 27run_test 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >trash/tmp'
28 28
29run_test 'verify a+b?h=1+2 link' ' 29run_test 'verify a+b?h=1+2 link' '
30 grep -e "/foo+bar/tree/a+b?h=1%2b2" trash/tmp 30 grep "/foo+bar/tree/a+b?h=1%2b2" trash/tmp
31' 31'
32 32
33tests_done 33tests_done
diff --git a/tests/t0105-commit.sh b/tests/t0105-commit.sh
index ae794c8..19a650b 100755
--- a/tests/t0105-commit.sh
+++ b/tests/t0105-commit.sh
@@ -5,18 +5,18 @@
5prepare_tests "Check content on commit page" 5prepare_tests "Check content on commit page"
6 6
7run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp' 7run_test 'generate foo/commit' 'cgit_url "foo/commit" >trash/tmp'
8run_test 'find tree link' 'grep -e "<a href=./foo/tree/.>" trash/tmp' 8run_test 'find tree link' 'grep "<a href=./foo/tree/.>" trash/tmp'
9run_test 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" trash/tmp' 9run_test 'find parent link' 'grep -E "<a href=./foo/commit/\?id=.+>" trash/tmp'
10 10
11run_test 'find commit subject' ' 11run_test 'find commit subject' '
12 grep -e "<div class=.commit-subject.>commit 5<" trash/tmp 12 grep "<div class=.commit-subject.>commit 5<" trash/tmp
13' 13'
14 14
15run_test 'find commit msg' 'grep -e "<div class=.commit-msg.></div>" trash/tmp' 15run_test 'find commit msg' 'grep "<div class=.commit-msg.></div>" trash/tmp'
16run_test 'find diffstat' 'grep -e "<table summary=.diffstat. class=.diffstat.>" trash/tmp' 16run_test 'find diffstat' 'grep "<table summary=.diffstat. class=.diffstat.>" trash/tmp'
17 17
18run_test 'find diff summary' ' 18run_test 'find diff summary' '
19 grep -e "1 files changed, 1 insertions, 0 deletions" trash/tmp 19 grep "1 files changed, 1 insertions, 0 deletions" trash/tmp
20' 20'
21 21
22run_test 'get root commit' ' 22run_test 'get root commit' '
@@ -31,7 +31,7 @@ run_test 'root commit contains diffstat' '
31 31
32run_test 'root commit contains diff' ' 32run_test 'root commit contains diff' '
33 grep ">diff --git a/file-1 b/file-1<" trash/tmp && 33 grep ">diff --git a/file-1 b/file-1<" trash/tmp &&
34 grep -e "<div class=.add.>+1</div>" trash/tmp 34 grep "<div class=.add.>+1</div>" trash/tmp
35' 35'
36 36
37tests_done 37tests_done
diff --git a/tests/t0106-diff.sh b/tests/t0106-diff.sh
index e140bcc..eee0c8c 100755
--- a/tests/t0106-diff.sh
+++ b/tests/t0106-diff.sh
@@ -5,16 +5,16 @@
5prepare_tests "Check content on diff page" 5prepare_tests "Check content on diff page"
6 6
7run_test 'generate foo/diff' 'cgit_url "foo/diff" >trash/tmp' 7run_test 'generate foo/diff' 'cgit_url "foo/diff" >trash/tmp'
8run_test 'find diff header' 'grep -e "a/file-5 b/file-5" trash/tmp' 8run_test 'find diff header' 'grep "a/file-5 b/file-5" trash/tmp'
9run_test 'find blob link' 'grep -e "<a href=./foo/tree/file-5?id=" trash/tmp' 9run_test 'find blob link' 'grep "<a href=./foo/tree/file-5?id=" trash/tmp'
10run_test 'find added file' 'grep -e "new file mode 100644" trash/tmp' 10run_test 'find added file' 'grep "new file mode 100644" trash/tmp'
11 11
12run_test 'find hunk header' ' 12run_test 'find hunk header' '
13 grep -e "<div class=.hunk.>@@ -0,0 +1 @@</div>" trash/tmp 13 grep "<div class=.hunk.>@@ -0,0 +1 @@</div>" trash/tmp
14' 14'
15 15
16run_test 'find added line' ' 16run_test 'find added line' '
17 grep -e "<div class=.add.>+5</div>" trash/tmp 17 grep "<div class=.add.>+5</div>" trash/tmp
18' 18'
19 19
20tests_done 20tests_done
diff --git a/tests/t0107-snapshot.sh b/tests/t0107-snapshot.sh
index 8ab4912..8ad9573 100755
--- a/tests/t0107-snapshot.sh
+++ b/tests/t0107-snapshot.sh
@@ -10,10 +10,10 @@ run_test 'get foo/snapshot/master.tar.gz' '
10 10
11run_test 'check html headers' ' 11run_test 'check html headers' '
12 head -n 1 trash/tmp | 12 head -n 1 trash/tmp |
13 grep -e "Content-Type: application/x-gzip" && 13 grep "Content-Type: application/x-gzip" &&
14 14
15 head -n 2 trash/tmp | 15 head -n 2 trash/tmp |
16 grep -e "Content-Disposition: inline; filename=.master.tar.gz." 16 grep "Content-Disposition: inline; filename=.master.tar.gz."
17' 17'
18 18
19run_test 'strip off the header lines' ' 19run_test 'strip off the header lines' '
@@ -32,7 +32,7 @@ run_test 'count files' '
32' 32'
33 33
34run_test 'verify untarred file-5' ' 34run_test 'verify untarred file-5' '
35 grep -e "^5$" trash/master/file-5 && 35 grep "^5$" trash/master/file-5 &&
36 test $(cat trash/master/file-5 | wc -l) = 1 36 test $(cat trash/master/file-5 | wc -l) = 1
37' 37'
38 38
diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
index 6ee70b3..f15c893 100755
--- a/tests/t0108-patch.sh
+++ b/tests/t0108-patch.sh
@@ -9,19 +9,19 @@ run_test 'generate foo/patch' '
9' 9'
10 10
11run_test 'find `From:` line' ' 11run_test 'find `From:` line' '
12 grep -e "^From: " trash/tmp 12 grep "^From: " trash/tmp
13' 13'
14 14
15run_test 'find `Date:` line' ' 15run_test 'find `Date:` line' '
16 grep -e "^Date: " trash/tmp 16 grep "^Date: " trash/tmp
17' 17'
18 18
19run_test 'find `Subject:` line' ' 19run_test 'find `Subject:` line' '
20 grep -e "^Subject: commit 5" trash/tmp 20 grep "^Subject: commit 5" trash/tmp
21' 21'
22 22
23run_test 'find `cgit` signature' ' 23run_test 'find `cgit` signature' '
24 tail -1 trash/tmp | grep -e "^cgit" 24 tail -1 trash/tmp | grep "^cgit"
25' 25'
26 26
27run_test 'find initial commit' ' 27run_test 'find initial commit' '
@@ -33,7 +33,7 @@ run_test 'generate patch for initial commit' '
33' 33'
34 34
35run_test 'find `cgit` signature' ' 35run_test 'find `cgit` signature' '
36 tail -1 trash/tmp | grep -e "^cgit" 36 tail -1 trash/tmp | grep "^cgit"
37' 37'
38 38
39tests_done 39tests_done