mediawiki-extensions-Visual.../tests/parser
Gabriel Wicke 19c67c28a2 Add a simple dump grepper using DumpReader. Useful to inform parser design
decisions, and as a way to exercise the dump reader in preparation for tests
over full dumps.
2012-02-27 16:40:01 +00:00
..
__patched-html5-parser.coffee * Convert __patched-html-parser to .coffee. 2012-02-18 18:54:12 +00:00
__patched-html5-parser.js * Convert __patched-html-parser to .coffee. 2012-02-18 18:54:12 +00:00
dumpGrepper.js Add a simple dump grepper using DumpReader. Useful to inform parser design 2012-02-27 16:40:01 +00:00
dumpReader.js Tweak dumpReader to work with current libxmljs and stdin 'data' events. 2012-02-27 15:46:08 +00:00
expansionTest.js First combination of WikiDom serializers with existing parser in 2011-11-03 13:55:48 +00:00
Makefile * Convert __patched-html-parser to .coffee. 2012-02-18 18:54:12 +00:00
parserTests-whitelist.js * Instead of sorting attributes, whitelist the one parserTest where it matters. 2012-02-20 22:26:24 +00:00
parserTests.js Green two more parser tests by implementing some parser functions. 2012-02-22 16:39:50 +00:00
parserTests.pegjs Add some support for functionhooks in test parser and parserTests.js, and 2012-02-22 15:59:11 +00:00
README * Convert __patched-html-parser to .coffee. 2012-02-18 18:54:12 +00:00
roundtrip-test.js Use pegjs from npm 2011-12-01 15:23:23 +00:00
roundtrip.js First combination of WikiDom serializers with existing parser in 2011-11-03 13:55:48 +00:00
tests.html First combination of WikiDom serializers with existing parser in 2011-11-03 13:55:48 +00:00
wikia-rte-roundtrip-tests.xml First combination of WikiDom serializers with existing parser in 2011-11-03 13:55:48 +00:00
worker.js First combination of WikiDom serializers with existing parser in 2011-11-03 13:55:48 +00:00

Work in progress. :)

Please see https://www.mediawiki.org/wiki/Future/Parser_development for some
information on how to get started with these tests and the current parser
architecture.

Needed npm modules:
* pegjs
* colors
* html5
* jquery
* jsdom
* diff
* libxmljs (requires native compilation)
* optimist (for argument handling)
* webworker (not needed for parserTests)
* coffee-script (if you'd like to modify .coffee files)

== Running parserTests.js ==

For parserTests, you also need MediaWiki's parser test cases (parserTests.txt)
either in a phase3 checkout parallel to extensions (tried by default). You can
also specify a test case file as an argument.

The "make test" target in this directory downloads parserTests.txt and specifies
it as the test case automatically.  Of course, you may also run tests manually:

node ./parserTests.js

Several options are available for parserTests:

node ./parserTests.js --help

Enjoy!

== Running roundtrip tests ==

Round-trip tests are not yet ported to the current parser architecture. The
focus so far has been on parserTests and getting the parser architecture in
shape, but we'll get back to round-trip tests eventually.