Mercurial > hg
annotate tests/test-highlight @ 7429:dbc40381620e
tests: Skip tests if they will fail because of outer repo
For different reasons these tests will fail if run in a tmpdir which is in a hg
repo.
The following three tests assumes no .hg in path dirs - I don't know how to
work around that:
* test-dispatch explicitly tests for no repo and expects "abort: There is no
Mercurial repository here (.hg not found)!"
* test-extension expects parentui to be None when not cd'ed to a repo dir
* test-globalopts tests that implicit -R works correctly - that could perhaps be
done from another repo instead of assuming no repo
The following two might be worth investigating further:
* test-convert-svn-sink fails for unknown reasons, starting with "abort:
unresolved merge conflicts (see hg resolve)"
* test-glog gets strange failures when testing "from outer space"
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 27 Nov 2008 00:57:31 +0100 |
parents | db7557359636 |
children | c5e37dc38a52 |
rev | line source |
---|---|
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
1 #!/bin/sh |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
2 |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
3 "$TESTDIR/hghave" pygments || exit 80 |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
4 |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
5 cat <<EOF >> $HGRCPATH |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
6 [extensions] |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
7 hgext.highlight = |
6485
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
8 [web] |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
9 pygments_style = friendly |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
10 EOF |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
11 |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
12 hg init test |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
13 cd test |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
14 cp $TESTDIR/get-with-headers.py ./ |
7120
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
15 |
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
16 # check for UnicodeDecodeError with iso-8859-1 file contents |
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
17 python -c 'fp = open("isolatin", "w"); fp.write("h\xFCbsch\n"); fp.close();' |
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
18 |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
19 hg ci -Ama |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
20 |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
21 echo % hg serve |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
22 hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
23 cat hg.pid >> $DAEMON_PIDS |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
24 |
6987
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
25 echo % hgweb filerevision, html |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
26 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py') \ |
7038
d1c82127573e
tests: fix test-highlight for compatiblity with newer Pygments
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6355
diff
changeset
|
27 | sed "s/[0-9]* years ago/long ago/g" | sed "s/class=\"k\"/class=\"kn\"/g" |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
28 |
7120
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
29 echo % hgweb filerevision, html |
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
30 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/isolatin') \ |
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
31 | sed "s/[0-9]* years ago/long ago/g" | sed "s/class=\"k\"/class=\"kn\"/g" |
db7557359636
highlight: convert text to local before passing to pygmentize (issue1341)
Christian Ebert <blacktrash@gmx.net>
parents:
7040
diff
changeset
|
32 |
6987
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
33 echo % hgweb fileannotate, html |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
34 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \ |
7038
d1c82127573e
tests: fix test-highlight for compatiblity with newer Pygments
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
6355
diff
changeset
|
35 | sed "s/[0-9]* years ago/long ago/g" | sed "s/class=\"k\"/class=\"kn\"/g" |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
36 |
6987
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
37 echo % hgweb fileannotate, raw |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
38 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py?style=raw') \ |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
39 | sed "s/test@//" > a |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
40 |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
41 echo "200 Script output follows" > b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
42 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
43 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
44 hg annotate "get-with-headers.py" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
45 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
46 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
47 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
48 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
49 |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
50 diff -u b a |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
51 |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
52 echo |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
53 echo % hgweb filerevision, raw |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
54 ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py?style=raw') \ |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
55 > a |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
56 |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
57 echo "200 Script output follows" > b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
58 echo "" >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
59 hg cat get-with-headers.py >> b |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
60 |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
61 diff -u b a |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
62 |
d09e813b21e3
highlight: only pygmentize for HTML mimetypes
Rocco Rutte <pdmef@gmx.net>
parents:
6863
diff
changeset
|
63 echo |
6485
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
64 echo % hgweb highlightcss friendly |
6863
d78d0f9783b8
Fix intermittent broken pipe in test-highlight
Brendan Cully <brendan@kublai.com>
parents:
6485
diff
changeset
|
65 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out |
d78d0f9783b8
Fix intermittent broken pipe in test-highlight
Brendan Cully <brendan@kublai.com>
parents:
6485
diff
changeset
|
66 head -n 4 out |
d78d0f9783b8
Fix intermittent broken pipe in test-highlight
Brendan Cully <brendan@kublai.com>
parents:
6485
diff
changeset
|
67 rm out |
6485
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
68 |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
69 echo % errors encountered |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
70 cat errors.log |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
71 kill `cat hg.pid` |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
72 |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
73 # Change the pygments style |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
74 cat > .hg/hgrc <<EOF |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
75 [web] |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
76 pygments_style = fruity |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
77 EOF |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
78 |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
79 echo % hg serve again |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
80 hg serve -p $HGPORT -d -n test --pid-file=hg.pid -A access.log -E errors.log |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
81 cat hg.pid >> $DAEMON_PIDS |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
82 |
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
83 echo % hgweb highlightcss fruity |
6863
d78d0f9783b8
Fix intermittent broken pipe in test-highlight
Brendan Cully <brendan@kublai.com>
parents:
6485
diff
changeset
|
84 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/highlightcss' > out |
d78d0f9783b8
Fix intermittent broken pipe in test-highlight
Brendan Cully <brendan@kublai.com>
parents:
6485
diff
changeset
|
85 head -n 4 out |
d78d0f9783b8
Fix intermittent broken pipe in test-highlight
Brendan Cully <brendan@kublai.com>
parents:
6485
diff
changeset
|
86 rm out |
6485
938319418d8c
highlight: Generate pygments style sheet dynamically
Isaac Jurado <diptongo@gmail.com>
parents:
6355
diff
changeset
|
87 |
6355
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
88 echo % errors encountered |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
89 cat errors.log |
3b841c189ab7
tests: add highlight extension tests
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
90 |