diff tests/test-extension @ 9661:c4f6c02e33c4

hgweb: added test case for extension loading phases (issue1824) this checks the order of module loading phases of hgweb. `4) reposetup' lines are duplicated because hgweb calls hg.repository() twice, one by __init__, another by refresh.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 28 Oct 2009 23:59:18 +0900
parents 1c83938b6a8e
children 4ce13d7c6b88
line wrap: on
line diff
--- a/tests/test-extension	Wed Oct 28 23:55:23 2009 +0900
+++ b/tests/test-extension	Wed Oct 28 23:59:18 2009 +0900
@@ -75,6 +75,20 @@
 # command with no output, we just want to see the extensions loaded
 hg paths
 
+# check hgweb's load order
+echo '% hgweb.cgi'
+cat > hgweb.cgi <<EOF
+#!/usr/bin/env python
+from mercurial import demandimport; demandimport.enable()
+from mercurial.hgweb import hgweb
+from mercurial.hgweb import wsgicgi
+
+application = hgweb('.', 'test repo')
+wsgicgi.launch(application)
+EOF
+SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
+    | grep '^[[:digit:]]) [[:alnum:] ]*$'  # ignores HTML output
+
 echo 'foo = !' >> $HGRCPATH
 echo 'bar = !' >> $HGRCPATH