Browse Source

Merged documents for test suites

master
Futago-za Ryuu 5 years ago
parent
commit
96a386ff15
  1. 75
      test/README.md
  2. 50
      test/benchmark/README.md
  3. 49
      test/spec/README.md

75
test/README.md

@ -0,0 +1,75 @@
# PEG.js Test Suites
This directory contains various test suites and scripts to ensure PEG.js works correctly.
* [Spec Suite](spec): Runs various test's that ensure PEG.js and it's generated parsers are working as intended. All tests should always pass on all supported platforms.
* [Benchmark Suite](benchmark): It measures speed of the parsers generated by PEG.js on various inputs. Its main goal is to provide data for code generator optimizations.
* [Impact Script](impact): Measures impact of a Git commit (or multiple commits) on generated parsers speed and size.
## Download and Install
To run the PEG.js test suites you most download the and install the module via the git repository:
1. Make sure you have Node.js and Git installed.
2. Download via Git and change the currently working directory:
```console
$ git clone https://github.com/pegjs/pegjs.git
$ cd pegjs
```
3. Install all dependencies, including the development dependencies:
```console
$ npm install
```
4. Install Gulp globally:
```console
$ npm install gulp -g
```
5. Processed...
* [Running in Node.js](#running-in-nodejs)
* [Running in the Browser](#running-in-the-browser)
## Running in Node.js
The commands below need to be executed via the console from the PEG.js root directory (one level up from this one), after which they will output their results (if any).
* Execute source code linting:
```console
$ gulp lint
```
* Execute the spec test suite:
```console
$ gulp test
```
* Execute the benchmark suite:
```console
$ gulp benchmark
```
* Execute the impact suite:
```console
$ node test/impact
```
## Running in the Browser
1. Serve the test suites using a web server:
```console
$ node test/server/run
```
2. Point your browser to the [test suite](http://localhost:8000/)

50
test/benchmark/README.md

@ -1,50 +0,0 @@
PEG.js Benchmark Suite
======================
This is the PEG.js benchmark suite. It measures speed of the parsers generated
by PEG.js on various inputs. Its main goal is to provide data for code generator
optimizations.
Running in Node.js
------------------
All commands in the following steps need to be executed in PEG.js root directory
(one level up from this one).
1. Install all PEG.js dependencies, including development ones:
```console
$ npm install
```
2. Execute the benchmark suite:
```console
$ gulp benchmark
```
3. Wait for results.
Running in the Browser
----------------------
All commands in the following steps need to be executed in PEG.js root directory
(one level up from this one).
1. Make sure you have Node.js installed.
2. Install all PEG.js dependencies, including development ones:
```console
$ npm install
```
3. Serve the benchmark suite using a web server:
```console
$ benchmark/server
```
4. Point your browser to the [benchmark suite](http://localhost:8000/).
5. Click the **Run** button and wait for results.

49
test/spec/README.md

@ -1,49 +0,0 @@
PEG.js Test Suite
=================
This is the PEG.js test suite. It ensures PEG.js works correctly. All tests
should always pass on all supported platforms.
Running in Node.js
------------------
All commands in the following steps need to be executed in PEG.js root directory
(one level up from this one).
1. Install all PEG.js dependencies, including development ones:
```console
$ npm install
```
2. Execute the test suite:
```console
$ gulp test
```
3. Watch the tests pass (or fail).
Running in the Browser
----------------------
All commands in the following steps need to be executed in PEG.js root directory
(one level up from this one).
1. Make sure you have Node.js installed.
2. Install all PEG.js dependencies, including development ones:
```console
$ npm install
```
3. Serve the test suite using a web server:
```console
$ test/server
```
4. Point your browser to the [test suite](http://localhost:8000/).
5. Watch the tests pass (or fail).
Loading…
Cancel
Save