tests/test-webraw
author Martin Geisler <mg@lazybytes.net>
Sat, 29 Aug 2009 00:29:16 +0200
changeset 9410 1c83938b6a8e
parent 6137 1c0e7afe824a
permissions -rwxr-xr-x
extensions: load and configure extensions in well-defined phases Extensions are now loaded with a call-graph like this: dispatch._dispatch extensions.loadall extensions.load # add foo module to extensions._extensions extensions.load # add bar module to extensions._extensions foo.uisetup(ui) bar.uisetup(ui) foo.extsetup() bar.extsetup() commands.table.update(foo.cmdtable) commands.table.update(bar.cmdtable) hg.repository foo.reposetup(ui, repo) bar.reposetup(ui, repo) The uisetup calls could easily be moved out to dispatch._dispatch, but have been kept in extensions.loadall since at least TortoiseHg calls extensions.loadall and expects it to call uisetup. The extensions.load function called uisetup. It now has an unused ui argument which has been kept for backwards compatibility.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2532
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     1
#!/bin/sh
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     2
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     3
hg init test
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     4
cd test
6136
acfb9fa494e2 hgweb: Pass only filename instead of full path when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5384
diff changeset
     5
mkdir sub
6137
1c0e7afe824a hgweb: Quote filenames when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6136
diff changeset
     6
cat >'sub/some "text".txt' <<ENDSOME
2532
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     7
This is just some random text
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     8
that will go inside the file and take a few lines.
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
     9
It is very boring to read, but computers don't
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    10
care about things like that.
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    11
ENDSOME
6137
1c0e7afe824a hgweb: Quote filenames when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6136
diff changeset
    12
hg add 'sub/some "text".txt'
2536
8106e477f584 Fix new tests to be better. In particular, fix webraw test to
Eric Hopper <hopper@omnifarious.org>
parents: 2532
diff changeset
    13
hg commit -d "1 0" -m "Just some text"
5384
e3a0c092b4e2 Allow tests to run in parallel.
Bryan O'Sullivan <bos@serpentine.com>
parents: 2571
diff changeset
    14
hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
2571
83cfd95eafb5 tests: add timeouts, make run-tests.py clean up dead daemon processes
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2547
diff changeset
    15
cat hg.pid >> $DAEMON_PIDS
6137
1c0e7afe824a hgweb: Quote filenames when downloading raw files.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6136
diff changeset
    16
("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
2532
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    17
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    18
sleep 5
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    19
kill `cat hg.pid`
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    20
sleep 1 # wait for server to scream and die
84655f721f39 Add a test for getting raw files via the web UI.
Eric Hopper <hopper@omnifarious.org>
parents:
diff changeset
    21
cat getoutput.txt
2547
d75c68b55af8 test-webraw: do not store hostname in test output
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2536
diff changeset
    22
cat access.log error.log | \
d75c68b55af8 test-webraw: do not store hostname in test output
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2536
diff changeset
    23
  sed 's/^[^ ]*\( [^[]*\[\)[^]]*\(\].*\)$/host\1date\2/'