pegjs/test
2018-09-06 12:38:26 +01:00
..
benchmark Merge the test suites into the website 2018-09-06 12:38:26 +01:00
node_modules Ensure usage of 'lib/peg.d.ts' 2017-12-28 01:48:01 +00:00
spec Stop ESLint warnings 2018-09-05 08:54:35 +01:00
.eslintrc.js Update code format and style 2017-10-25 19:19:42 +01:00
impact Fix compatibility for older bins 2017-10-25 23:08:53 +01:00
README.md Merge the test suites into the website 2018-09-06 12:38:26 +01:00

PEG.js Test Suites

This directory contains various test suites and scripts to ensure PEG.js works correctly.

  • Spec Suite: 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: 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: Measures impact of a Git commit (or multiple commits) on generated parsers speed and size.

Note: The package pegjs-dev, used by the benchmark and spec modules within this directory, points to 'test/node_modules/pegjs-dev.js', which is an alias module for 'lib/peg.js'

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:

    $ git clone https://github.com/pegjs/pegjs.git
    $ cd pegjs
    
  3. Install all dependencies, including the development dependencies:

    $ npm install
    
  4. Install Gulp globally:

    $ npm install gulp -g
    
  5. Processed...

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:

    $ gulp lint
    
  • Execute the spec test suite:

    $ gulp test
    
  • Execute the benchmark suite:

    $ gulp benchmark
    
  • Execute the impact suite:

    $ node test/impact
    

Running in the Browser

You also have the option of running the website locally by running node server.js or npm start from the root of this repository. After that just go to the development page and click the link Benchmark Suite or Spec Suite.