[test] Add compiler `dart test -c cli` to run hooks (#2660) Bug: * https://github.com/dart-lang/sdk/issues/63372 This PR uses `dart build cli` under the `-c cli` flag. Implementation: * The wrapper Dart script around the test that package test creates is the new entry-point and **must** be within the package root to run the correct hooks. * So, this PR updates the temp dir to be in `.dart_tool/test/temp/<...>` rather than in the system temp. * Gates the implementation on the next dev release after https://dart-review.googlesource.com/c/sdk/+/506242. Testing: * The integration tests run with the `cli` compiler * The integration tests must run on a valid package with a valid pubspec and package_config.json (otherwise the hooks-runner cannot determine which hooks to run). * The integration tests do _not_ actually run a hook and include c code. `dart build cli` bundles are already properly tested in the dartdev tests for `dart build cli` in the SDK. If you feel we should add an integration test running native code here, I'm happy to add one. * Skips the tests before the next dev release. * **TODO**: Rerun tests on Tuesday after new dev release has come out.
Welcome! package:test is the standard testing library for Dart and Flutter. If you have questions about Dart testing, please see the docs for package:test. package:test_api and package:test_core are implementation details and generally not user-facing.
package:checks is a relatively new library for expressing test expectations. It's a more modern version of package:matcher and features a literate API.
| Package | Description | Issues | Version |
|---|---|---|---|
| checks | A framework for checking values against expectations and building custom expectations. | ||
| fake_async | Fake asynchronous events such as timers and microtasks for deterministic testing. | ||
| matcher | Support for specifying test expectations via an extensible Matcher class. Also includes a number of built-in Matcher implementations for common cases. | ||
| test | A full featured library for writing and running Dart tests across platforms. | ||
| test_api | The user facing API for structuring Dart tests and checking expectations. | ||
| test_core | A basic library for writing tests and running them on the VM. | ||
| test_descriptor | An API for defining and verifying files and directory structures. | ||
| test_process | Test processes: starting; validating stdout and stderr; checking exit code. |