For compiling and running kitty, you will need:
For running tests you will need:
Build:
cargo build
Run:
cargo run -- <args for kitty here>
If you want to install your local version of kitty on your computer, you can use:
cargo install --path .
To run the test suite, you must provide a username and a authentication token for Kattis which will be used to fetch and submit test samples. The test suite expects the following environment variables:
KATTIS_TEST_USERNAME
: your test account's Kattis usernameKATTIS_TEST_TOKEN
: your test account's Kattis authentication token
You can do this in two ways:
- Set the environment variables in your shell
- Create a
.env
file in the project root that looks like the below. The test suite will load it if present.KATTIS_TEST_USERNAME=<insert username> KATTIS_TEST_TOKEN=<insert token>
To run tests:
make test
If you don't have make
(maybe you're on Windows), just look inside the Makefile
and run the commands directly.
The test recipe builds a Docker image in which it installs kitty from your local version of the project, and then it runs cargo test
. The tests will each run in their own Docker container to fully sandbox them.
Please note that if you change kitty's source code (anything inside src
), you have to rebuild the Docker image. make test
does this for you.
All source code is formatted with rustfmt
and linted with clippy
. If you make a pull request, checks for these will be run automatically.