Skip to content

Latest commit

 

History

History
82 lines (53 loc) · 1.45 KB

DEVELOPING.md

File metadata and controls

82 lines (53 loc) · 1.45 KB

Developing

Testing

To run unit tests only (tests defined in /src):

cargo test

To run all the available tests including integration tests, C API tests and linting:

./scripts/test.sh

To run only those tests that contain a {substring} in their name:

./scripts/test.sh {substring}

Running benchmarks

cargo bench

To run only those benchmarks that contain a {substring} in their name:

cargo bench {substring}

Test report can be found in the target/criterion/report/index.html file.

Useful debugging tools

HTML parser tracer

The tool provides comprehensive trace information about parsing process of the given HTML input. For usage information run:

./scripts/parser_trace.sh -- -h

CSS selector VM's AST printer

The tool prints selector VM's program AST for the given list of CSS selectors. CSS selector list should be specified in the JSON format:

./scripts/selectors_ast.sh '["selector1", "selector2", ...]'

Fuzzing

Fuzzing with cargo-fuzz

NOTE: requires Rust nightly.

Run fuzzing for the crate:

./scripts/fuzz_with_libfuzzer.sh

Run fuzzing for C API:

./scripts/fuzz_c_api_with_libfuzzer.sh

Fuzzing with afl

./scripts/fuzz_with_afl.sh

Fuzzing with honggfuzz

./scripts/fuzz_with_hongg.sh