Justfile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. all: build test xtests
  2. all-release: build-release test-release xtests-release
  3. export DOG_DEBUG := ""
  4. # compiles the dog binary
  5. @build:
  6. cargo build
  7. # compiles the dog binary (in release mode)
  8. @build-release:
  9. cargo build --release --verbose
  10. strip target/release/dog
  11. # runs unit tests
  12. @test:
  13. cargo test --workspace -- --quiet
  14. # runs unit tests (in release mode)
  15. @test-release:
  16. cargo test --release --all --verbose
  17. # runs mutation tests
  18. @test-mutation:
  19. cargo +nightly test --package dns --features=dns/with_mutagen -- --quiet
  20. cargo +nightly mutagen --package dns --features=dns/with_mutagen
  21. # runs extended tests
  22. @xtests:
  23. specsheet xtests/*.toml -O cmd.target.dog="${CARGO_TARGET_DIR:-../target}/debug/dog"
  24. # runs extended tests (in release mode)
  25. @xtests-release:
  26. specsheet xtests/*.toml -O cmd.target.dog="${CARGO_TARGET_DIR:-../target}/release/dog"
  27. # runs fuzzing on the dns crate
  28. @fuzz:
  29. cargo +nightly fuzz --version
  30. cd dns; cargo +nightly fuzz run fuzz_parsing -- -jobs=`nproc` -workers=`nproc` -runs=69105
  31. # prints out the data that caused crashes during fuzzing as hexadecimal
  32. @fuzz-hex:
  33. for crash in dns/fuzz/artifacts/fuzz_parsing/crash-*; do echo; echo $crash; hexyl $crash; done
  34. # removes fuzz log files
  35. @fuzz-clean:
  36. rm dns/fuzz/fuzz-*.log
  37. # lints the code
  38. @clippy:
  39. touch dns/src/lib.rs
  40. cargo clippy
  41. # generates a code coverage report using tarpaulin via docker
  42. @coverage-docker:
  43. docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin cargo tarpaulin --all --out Html
  44. # updates dependency versions, and checks for outdated ones
  45. @update-deps:
  46. cargo update
  47. command -v cargo-outdated >/dev/null || (echo "cargo-outdated not installed" && exit 1)
  48. cargo outdated
  49. # lists unused dependencies
  50. @unused-deps:
  51. command -v cargo-udeps >/dev/null || (echo "cargo-udeps not installed" && exit 1)
  52. cargo +nightly udeps
  53. # renders the documentation
  54. @doc args="":
  55. cargo doc --no-deps --all {{args}}
  56. # builds the man pages
  57. @man:
  58. mkdir -p "${CARGO_TARGET_DIR:-target}/man"
  59. pandoc --standalone -f markdown -t man man/dog.1.md > "${CARGO_TARGET_DIR:-target}/man/dog.1"
  60. # builds and previews the man page
  61. @man-preview: man
  62. man "${CARGO_TARGET_DIR:-target}/man/dog.1"