Skip to content

Commit 1d453b9

Browse files
committed
Gadgets/Stdrev: Describe how to run tests
1 parent 1fb57c3 commit 1d453b9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
How to run tests
2+
----------------
3+
4+
Tests depend on non-standard software being installed. The instructions below
5+
apply to Linux. Tests should work on other operating systems, but the
6+
prerequisites might be sligtly differents.
7+
8+
Tests are written in python and depend on non-standard python packages. It's
9+
best to install these in virtual python environment so that packages installed
10+
to the system are not affected.
11+
12+
cd path/to/cppreference
13+
virtualenv --no-site-packages --python=/usr/bin/python3 venv
14+
. venv/bin/activate
15+
16+
Now install Selenium python bindings:
17+
18+
pip install selenium
19+
20+
The tests use Selenium Firefox Webdriver which depends on geckodriver being
21+
installed. Download applicable release from
22+
[here](https://github.com/mozilla/geckodriver/releases/), extract the executable
23+
and put it somewhere in PATH.
24+
25+
Now just run tests:
26+
27+
cd gadgets/standard_revisions-tests
28+
./test.sh
29+
30+
Note that the tests at the moment hardcode official cppreference.com MediaWiki
31+
instance. The test pages there are not always updated - if that's the case,
32+
please sync them to the sources stored at gadgets/standard_revisions-tests-pages
33+
in this repository.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python3 -m unittest discover

0 commit comments

Comments
 (0)