Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/target
/package-build
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,30 @@ File Status:
...
```

## Development

This project uses [just](https://github.com/casey/just) as a command runner. Run `just` to see available commands:

| Command | Description |
|---------|-------------|
| `just check` | Run all checks (cargo check, cargo clippy, cargo fmt, ruff, mypy) |
| `just test` | Run unit tests |
| `just fmt` | Format code (cargo fmt, ruff) |
| `just integration-test` | Run SQL query integration tests |
| `just integration-update` | Update expected test output |
| `just package` | Build release packages |

### SQL query integration tests

These tests verify mquire produces correct output for queries against memory snapshots.

- **`just integration-test`** - Run tests and compare output to expected JSON files
- **`just integration-update`** - Update expected JSON files with actual output (use when changing table schemas)

After running `integration-update`, review the git diff to ensure changes match your expectations before committing.

**Adding new tests:** Create a `.sql` file and matching `.json` file in the appropriate snapshot directory, then run `just integration-update` to populate the expected output.

## Contributing

Contributions are welcome! When contributing, please follow these guidelines:
Expand Down
40 changes: 40 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright (c) 2025-present, Trail of Bits, Inc.
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#

default:
@just --list

check:
cargo check --all-targets --all-features --examples --tests --workspace
cargo clippy --all-targets --all-features --examples -- -D warnings
cargo fmt --check

cd integration-tests/sql-queries/verifier && uv run ruff check src/
cd integration-tests/sql-queries/verifier && uv run ruff format --check src/
cd integration-tests/sql-queries/verifier && uv run mypy src/

test:
cargo test

integration-test config="linux_simple":
cd integration-tests/sql-queries/verifier && \
uv run mquire-sql-query-verifier --skip-download ../cfg/{{config}}.json test.xml

integration-update config="linux_simple":
cd integration-tests/sql-queries/verifier && \
uv run mquire-sql-query-verifier --skip-download ../cfg/{{config}}.json test.xml --update

fmt:
cargo fmt
cd integration-tests/sql-queries/verifier && uv run ruff format src/

[linux]
package:
cargo build --release --target x86_64-unknown-linux-musl
cmake -S package -B package-build -DMQUIRE_REPOSITORY_PATH="$(pwd)"
cmake --build package-build --target package