Skip to content

Commit

Permalink
Use cargo nextest
Browse files Browse the repository at this point in the history
  • Loading branch information
jpikl committed Mar 13, 2024
1 parent a32d777 commit 479cddd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install development tools
uses: taiki-e/install-action@v2
with:
tool: just,coreutils
tool: just,coreutils,nextest

- name: Run build
run: just build
Expand Down
46 changes: 21 additions & 25 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@ dev-docs:
trap 'kill $(jobs -pr)' EXIT
wait

# Run `rew` with args
run *ARGS:
cargo run -- {{ARGS}}

# Run `rew x` with a pattern
x PATTERN:
cargo run -- x "{{PATTERN}}"

# Build
build:
cargo build --workspace --exclude fuzz

# Install release build to ~/.local/bin/
install:
cargo build --release
mkdir -p ~/.local/bin/
cp target/release/rew ~/.local/bin/

# Format code
format *ARGS:
cargo +nightly fmt --all {{ARGS}}
Expand All @@ -27,46 +45,24 @@ clippy:

# Run tests
test:
cargo test --package rew --tests --quiet

# Build
build:
cargo build --workspace --exclude fuzz
cargo nextest run --status-level leak

# Generate docs
docs:
cargo run --package xtask -- docs

# Install release build to ~/.local/bin/
install:
cargo build --release
mkdir -p ~/.local/bin/
cp target/release/rew ~/.local/bin/

# Run `rew` with args
run *ARGS:
cargo run -- {{ARGS}}

# Run `rew x` with a pattern
x PATTERN:
cargo run -- x "{{PATTERN}}"

# Run fuzzer
fuzz:
cargo +nightly fuzz run --jobs {{num_cpus()}} pattern

# Generate code coverage
coverage format:
cargo tarpaulin \
--packages rew \
--tests \
--engine llvm \
--exclude-files 'tests/*' \
--exclude-files 'fuzz/*' \
--exclude-files 'xtask/*' \
--out {{format}} \
-- \
--quiet
--out {{format}}

# Preview code coverage as HTML
coverage-preview:
Expand All @@ -89,4 +85,4 @@ setup:
else \
cargo binstall cargo-binstall; \
fi
cargo binstall mdbook coreutils cargo-watch cargo-tarpaulin cargo-fuzz
cargo binstall cargo-fuzz cargo-nextest cargo-tarpaulin cargo-watch coreutils mdbook
6 changes: 6 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- Fix Windows CI: create symlinks/copies `coreutils` -> `<util>` for each `<util>` + add on PATH.
Do this using some task run before `just test`.
Before each integration test, set PATH env var for each `Command`
set PATH=%PATH%;C:\your\path\here\
export PATH=$PATH:/your/path/here
Use $PROJECT/coreutils path + add it to .gitignore
- Add `rew prefix` command and use it to prefix stderr of `rew x` child processes?
- Add `REW_PREFIX` env var to enforce stderr prefix over detecting it from argv[0]?
- Fix `--examples` order in generated docs.
Expand Down

0 comments on commit 479cddd

Please sign in to comment.