##// END OF EJS Templates
tests: confirm that a badly documented extension doesn't cause a crash...
Simon Farnsworth -
r28083:550097d0 default
parent child Browse files
Show More
@@ -1,40 +1,57 b''
1 1 $ echo 'raise Exception("bit bucket overflow")' > badext.py
2 $ abspath=`pwd`/badext.py
2 $ abspathexc=`pwd`/badext.py
3
4 $ cat >baddocext.py <<EOF
5 > """
6 > baddocext is bad
7 > """
8 > EOF
9 $ abspathdoc=`pwd`/baddocext.py
3 10
4 11 $ cat <<EOF >> $HGRCPATH
5 12 > [extensions]
6 13 > gpg =
7 14 > hgext.gpg =
8 > badext = $abspath
15 > badext = $abspathexc
16 > baddocext = $abspathdoc
9 17 > badext2 =
10 18 > EOF
11 19
12 20 $ hg -q help help 2>&1 |grep extension
13 21 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
14 22 *** failed to import extension badext2: No module named badext2
15 23
16 24 show traceback
17 25
18 26 $ hg -q help help --traceback 2>&1 | egrep ' extension|^Exception|Traceback|ImportError'
19 27 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
20 28 Traceback (most recent call last):
21 29 Exception: bit bucket overflow
22 30 *** failed to import extension badext2: No module named badext2
23 31 Traceback (most recent call last):
24 32 ImportError: No module named badext2
25 33
26 34 show traceback for ImportError of hgext.name if debug is set
27 35 (note that --debug option isn't applied yet when loading extensions)
28 36
29 37 $ (hg -q help help --traceback --config ui.debug=True 2>&1) \
30 38 > | grep -v '^ ' \
31 39 > | egrep 'extension..[^p]|^Exception|Traceback|ImportError|not import'
32 40 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
33 41 Traceback (most recent call last):
34 42 Exception: bit bucket overflow
35 43 could not import hgext.badext2 (No module named *badext2): trying badext2 (glob)
36 44 Traceback (most recent call last):
37 45 ImportError: No module named *badext2 (glob)
38 46 *** failed to import extension badext2: No module named badext2
39 47 Traceback (most recent call last):
40 48 ImportError: No module named badext2
49
50 confirm that there's no crash when an extension's documentation is bad
51
52 $ hg help --keyword baddocext
53 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
54 *** failed to import extension badext2: No module named badext2
55 Topics:
56
57 extensions Using Additional Features
General Comments 0
You need to be logged in to leave comments. Login now