Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for docs #430

Merged
merged 8 commits into from
Dec 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
document the documentation testing script
Akuli committed Dec 7, 2023
commit efa880f5c72ed538b279a23e72dcb6ef44963f15
15 changes: 13 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -106,8 +106,8 @@ Running tests (if on Windows, use Git Bash):
$ ./runtests.sh
```

This command does a few things:
- I compiles the Jou compiler if you have changed something in `src/` since the last time it was compiled.
The `runtests.sh` script does a few things:
- It compiles the Jou compiler if you have changed something in `src/` since the last time it was compiled.
- It runs all Jou files in `examples/` and `tests/`. To speed things up, it runs two files in parallel.
- It ensures that the Jou files output what is expected.

@@ -165,6 +165,17 @@ This doesn't do anything with tests that are supposed to fail with an error, for
There are also a few other ways to run the tests.
You can look at `.github/workflows/` to see how the CI runs tests.

To ensure that documentation stays up to date,
it is also possible to run code examples in the documentation as tests:

```
$ ./doctest.sh
```

The `doctest.sh` script finds code examples from markdown files in `doc/`.
It only looks at code examples that contain `# Output:`, `# Warning:` or `# Error:` comments.
It then attempts to run each example and compares the output similarly to `runtests.sh`.


## Windows Release Builds