My programming language.
- Rust 100%
| .forgejo/workflows | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
Octo
My programming language.
Getting Started
Prerequisites
- Rust
1.97+
Installation
-
Clone the repository.
-
Run the program.
# Run a file cargo run -- run /path/to/file # Run using the interactive prompt, which you can quit with \q cargo run -- run
Testing
-
Run the tests.
cargo test
Code coverage
You need to be on Rust nightly.
You might also need to install some LLVM-specific tools.
-
Install grcov.
cargo install grcov -
Run the tests with instrumentation and raw profiling data from LLVM enabled.
CARGO_INCREMENTAL=0 \ RUSTFLAGS="-C instrument-coverage -Z coverage-options=branch" \ RUSTDOCFLAGS="-C instrument-coverage -Z unstable-options --persist-doctests target/debug/doctestbins" \ LLVM_PROFILE_FILE="target/coverage/cargo-test-%p-%m.profraw" \ cargo test -
Generate an HTML coverage report.
grcov target/coverage \ --source-dir . \ --keep-only 'src/*' \ --binary-path target/debug \ --output-types html \ --output-path target/coverage/html \ --branch \ --excl-line grcov-ignore -
You can open the HTML report located at
target/coverage/html/index.htmlin your browser.
Credits
- Crafting Interpreters: For the starting point and resource for learning.
- How to do code coverage in Rust: Code coverage in Rust.