diff --git a/AGENTS.md b/AGENTS.md index 1378a13c8a..1222bf94e5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 diff --git a/Makefile b/Makefile index 46b3413003..a49799ae4b 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/changes/test-rewatch-rust.internal.md b/changes/test-rewatch-rust.internal.md new file mode 100644 index 0000000000..83f8e6c2c7 --- /dev/null +++ b/changes/test-rewatch-rust.internal.md @@ -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. diff --git a/rewatch/AGENTS.md b/rewatch/AGENTS.md index d9c16dfaca..9cb7abd59f 100644 --- a/rewatch/AGENTS.md +++ b/rewatch/AGENTS.md @@ -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: diff --git a/rewatch/README.md b/rewatch/README.md index 1457fc1d07..e5e19871f2 100644 --- a/rewatch/README.md +++ b/rewatch/README.md @@ -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