Thu, 23 Mar 2023 15:12:30 +0000
Serialize XML in a consistent order by default
This overrides all XML serialization to emit attributes in an ordered form, so
the XML will match across multiple runs. This can be useful for comparing
different runs, or even two stanzas printed in the same run (e.g. if there is
a mismatch).
143 | 1 | # Scansion - XMPP testing tool |
2 | ||
3 | Scansion executes simple scripts containing XMPP stanzas. It sends stanzas | |
4 | in the script, and awaits the response, and verifies it matches what the | |
5 | script expects. | |
6 | ||
7 | You can find some example scripts in the `scripts/` directory. | |
8 | ||
167
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
9 | Scansion is used by the Prosody XMPP server project to provide integration tests, and |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
10 | has a large number of [Scansion scripts](https://hg.prosody.im/trunk/file/tip/spec/scansion). |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
11 | While many of the scripts there may test for Prosody-specific behaviour, Scansion itself can |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
12 | be used with any XMPP server. |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
13 | |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
14 | ## Links |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
15 | |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
16 | - Documentation can be found at https://matthewwild.co.uk/projects/scansion |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
17 | - Source code at https://code.matthewwild.co.uk/scansion |
8b322a7eca1e
README: Add intro and links
Matthew Wild <mwild1@gmail.com>
parents:
143
diff
changeset
|
18 | |
143 | 19 | ## Setup |
20 | ||
21 | ### Requirements | |
22 | ||
23 | Scansion requires: | |
24 | ||
25 | - Lua 5.2 | |
26 | - Verse | |
27 | - LuaExpat | |
28 | - LuaCJSON | |
29 | - LuaSec | |
30 | - LuaSocket | |
31 | - LuaFileSystem (optional) | |
32 | ||
33 | If these are present, a simple 'make' and 'sudo make install' should suffice to install scansion to `/usr/local/bin/`. | |
34 | ||
35 | ### Docker | |
36 | ||
37 | A Dockerfile is also provided, to allow you to build and run scansion inside a clean environment with all dependencies | |
38 | installed already. | |
39 | ||
40 | First, build the image: | |
41 | ||
42 | ``` | |
43 | docker build -t scansion . | |
44 | ``` | |
45 | ||
46 | To run it with a directory of test scripts in ./spec/scansion: | |
47 | ||
48 | ``` | |
49 | docker run -v$PWD/spec/scansion:/scripts scansion | |
50 | ``` | |
51 | ||
52 | To run it as a web server: | |
53 | ||
54 | ``` | |
55 | docker run -p 8007:8007 -v$PWD/spec/scansion:/scripts scansion --serve | |
56 | ||
57 | ``` | |
58 |