Skip to content

Commit 88c4b75

Browse files
OrangeTuxStranger6667
authored andcommitted
Document how to run tests
`cargo tests` depends on an external, undocumented dependency: the JSON Schema Test Suite. This commit introduces instructions how to get test suite. Without the test suite, `cargo test` fails with: ``` $ cargo test error: custom attribute panicked --> tests/test_suite.rs:5:1 | 5 | #[json_schema_test_suite("tests/suite", "draft4", {"optional_bignum_0_0", "optional_bignum_2_0"})] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: message: Tests directory not found: tests/suite/tests/draft4 ```
1 parent 558d13d commit 88c4b75

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,23 @@ This library is functional and ready for use, but its API is still evolving to t
139139
- Ruby - a [crate](https://github.com/driv3r/rusty_json_schema) by @driv3r
140140
- NodeJS - a [package](https://github.com/ahungrynoob/jsonschema) by @ahungrynoob
141141

142+
## `cargo test`
143+
144+
The tests in [jsonschema/](jsonschema/) depend on the [JSON Schema Test Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite). Before calling `cargo test`, download the suite:
145+
146+
```bash
147+
$ git submodule init
148+
$ git submodule update
149+
```
150+
These commands clone the suite to [jsonschema/tests/suite/](jsonschema/test/suite/).
151+
152+
Now, enter jsonschema/ folder and run `cargo test`.
153+
154+
```bash
155+
$ cd jsonschema
156+
$ cargo test
157+
```
158+
142159
## Performance
143160

144161
There is a comparison with other JSON Schema validators written in Rust - `jsonschema_valid==0.4.0` and `valico==3.6.0`.

0 commit comments

Comments
 (0)