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
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ on `master`. CI runs on every PR in the stack.
For compiler or standard-library changes, run `make test`. For syntax changes,
also run `make test-syntax`; use `make test-syntax-roundtrip` when parsing or
printing changes. Other focused suites are `make test-gentype`,
`make test-analysis`, `make test-tools`, and `make test-rewatch`.
`make test-analysis`, `make test-tools`, `make test-rewatch` (OCaml build
system), and `make test-rewatch-rust` (Rust build system).

### Testing Requirements

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ test-gentype: lib
test-rewatch: lib
./rewatch/tests/suite.sh $(RESCRIPT_EXE)

test-rewatch-rust: lib rewatch
./rewatch/tests/suite.sh $(RESCRIPT_RUST_EXE)

test-all: test test-gentype test-analysis test-tools test-rewatch

# Playground
Expand Down Expand Up @@ -382,4 +385,4 @@ clean: clean-lib clean-compiler clean-rewatch clean-coverage

.DEFAULT_GOAL := build

.PHONY: yarn-install build rewatch compiler lib artifacts bench test test-analysis test-reanalyze benchmark-reanalyze test-tools test-syntax test-syntax-roundtrip test-gentype test-rewatch test-all playground playground-compiler playground-test playground-cmijs playground-release format checkformat semantic-diff clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean
.PHONY: yarn-install build rewatch compiler lib artifacts bench test test-analysis test-reanalyze benchmark-reanalyze test-tools test-syntax test-syntax-roundtrip test-gentype test-rewatch test-rewatch-rust test-all playground playground-compiler playground-test playground-cmijs playground-release format checkformat semantic-diff clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean
1 change: 1 addition & 0 deletions changes/test-rewatch-rust.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Add `make test-rewatch-rust`, which runs the build system suite against the Rust implementation, and document that `make test-rewatch` tests the OCaml one.
6 changes: 3 additions & 3 deletions rewatch/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ cargo fmt --check --manifest-path rewatch/Cargo.toml
cargo build --manifest-path rewatch/Cargo.toml --release

# Or use the Makefile shortcuts
make rewatch # Build rewatch
make test-rewatch # Run integration tests
make rewatch # Build rewatch
make test-rewatch-rust # Build rewatch and run the integration tests against it
```

**Note**: The rewatch project is located in the `rewatch/` directory with its own `Cargo.toml` file. All cargo commands should be run from the project root using the `--manifest-path rewatch/Cargo.toml` flag, as shown in the CI workflow.

**Integration Tests**: The `make test-rewatch` command runs bash-based integration tests located in `rewatch/tests/suite.sh`. These tests use the `rewatch/testrepo/` directory as a test workspace with various package configurations to verify rewatch's behavior across different scenarios.
**Integration Tests**: The `make test-rewatch-rust` command runs bash-based integration tests located in `rewatch/tests/suite.sh` against the Rust binary, `rescript-rust`. `make test-rewatch` runs the same suite against `rescript`, the OCaml implementation in `rewatch-ocaml/`, so it neither rebuilds nor tests this code. These tests use the `rewatch/testrepo/` directory as a test workspace with various package configurations to verify rewatch's behavior across different scenarios.

**Running Individual Integration Tests**: You can run individual test scripts directly by setting up the environment manually:

Expand Down
6 changes: 5 additions & 1 deletion rewatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ Run commands from the repository root:

```sh
make rewatch
make test-rewatch
make test-rewatch-rust
cargo test --manifest-path rewatch/Cargo.toml
cargo clippy --manifest-path rewatch/Cargo.toml --all-targets --all-features
cargo fmt --check --manifest-path rewatch/Cargo.toml
```

`make test-rewatch-rust` builds this implementation and runs the integration
suite against it; `make test-rewatch` runs the same suite against `rescript`,
the OCaml implementation.

The integration suite is [`tests/suite.sh`](tests/suite.sh). It creates and
modifies projects under `testrepo/`; use its helpers for portable path and file
operations rather than adding platform-specific `sed` commands or fixed
Expand Down
Loading