Justfile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. # prints versions of the necessary build tools
  54. @versions:
  55. rustc --version
  56. cargo --version
  57. # renders the documentation
  58. @doc args="":
  59. cargo doc --no-deps --all {{args}}
  60. # builds the man pages
  61. @man:
  62. mkdir -p "${CARGO_TARGET_DIR:-target}/man"
  63. pandoc --standalone -f markdown -t man man/dog.1.md > "${CARGO_TARGET_DIR:-target}/man/dog.1"
  64. # builds and previews the man page
  65. @man-preview: man
  66. man "${CARGO_TARGET_DIR:-target}/man/dog.1"