##// 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 $ echo 'raise Exception("bit bucket overflow")' > badext.py
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 $ cat <<EOF >> $HGRCPATH
11 $ cat <<EOF >> $HGRCPATH
5 > [extensions]
12 > [extensions]
6 > gpg =
13 > gpg =
7 > hgext.gpg =
14 > hgext.gpg =
8 > badext = $abspath
15 > badext = $abspathexc
16 > baddocext = $abspathdoc
9 > badext2 =
17 > badext2 =
10 > EOF
18 > EOF
11
19
12 $ hg -q help help 2>&1 |grep extension
20 $ hg -q help help 2>&1 |grep extension
13 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
21 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
14 *** failed to import extension badext2: No module named badext2
22 *** failed to import extension badext2: No module named badext2
15
23
16 show traceback
24 show traceback
17
25
18 $ hg -q help help --traceback 2>&1 | egrep ' extension|^Exception|Traceback|ImportError'
26 $ hg -q help help --traceback 2>&1 | egrep ' extension|^Exception|Traceback|ImportError'
19 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
27 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
20 Traceback (most recent call last):
28 Traceback (most recent call last):
21 Exception: bit bucket overflow
29 Exception: bit bucket overflow
22 *** failed to import extension badext2: No module named badext2
30 *** failed to import extension badext2: No module named badext2
23 Traceback (most recent call last):
31 Traceback (most recent call last):
24 ImportError: No module named badext2
32 ImportError: No module named badext2
25
33
26 show traceback for ImportError of hgext.name if debug is set
34 show traceback for ImportError of hgext.name if debug is set
27 (note that --debug option isn't applied yet when loading extensions)
35 (note that --debug option isn't applied yet when loading extensions)
28
36
29 $ (hg -q help help --traceback --config ui.debug=True 2>&1) \
37 $ (hg -q help help --traceback --config ui.debug=True 2>&1) \
30 > | grep -v '^ ' \
38 > | grep -v '^ ' \
31 > | egrep 'extension..[^p]|^Exception|Traceback|ImportError|not import'
39 > | egrep 'extension..[^p]|^Exception|Traceback|ImportError|not import'
32 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
40 *** failed to import extension badext from $TESTTMP/badext.py: bit bucket overflow
33 Traceback (most recent call last):
41 Traceback (most recent call last):
34 Exception: bit bucket overflow
42 Exception: bit bucket overflow
35 could not import hgext.badext2 (No module named *badext2): trying badext2 (glob)
43 could not import hgext.badext2 (No module named *badext2): trying badext2 (glob)
36 Traceback (most recent call last):
44 Traceback (most recent call last):
37 ImportError: No module named *badext2 (glob)
45 ImportError: No module named *badext2 (glob)
38 *** failed to import extension badext2: No module named badext2
46 *** failed to import extension badext2: No module named badext2
39 Traceback (most recent call last):
47 Traceback (most recent call last):
40 ImportError: No module named badext2
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