Justfile 2.1 KB

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