Skip to content

Commit eb0e54a

Browse files
[pigeon] Update testing and docs (#6984)
Minor improvements for contributors: - Explicitly log failure of a test suite. Depeending on the generator and the failure, it may not be obvious (e.g., gtest crashes, which just don't have any output). - Clarify `test.dart` vs `run_tests.dart`, and mention the `-t` and `-l` flags. - Add newer generators to the source list.
1 parent 71b2f68 commit eb0e54a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/pigeon/CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ generators with that AST.
2121
* [ast.dart](./lib/ast.dart) - The data structure for representing the Abstract Syntax Tree.
2222
* [dart_generator.dart](./lib/dart_generator.dart) - The Dart code generator.
2323
* [java_generator.dart](./lib/java_generator.dart) - The Java code generator.
24+
* [kotlin_generator.dart](./lib/kotlin_generator.dart) - The Kotlin code generator.
2425
* [objc_generator.dart](./lib/objc_generator.dart) - The Objective-C code
2526
generator (header and source files).
27+
* [swift_generator.dart](./lib/swift_generator.dart) - The Swift code generator.
2628
* [cpp_generator.dart](./lib/cpp_generator.dart) - The C++ code generator.
2729
* [generator_tools.dart](./lib/generator_tools.dart) - Shared code between generators.
2830
* [pigeon_cl.dart](./lib/pigeon_cl.dart) - The top-level function executed by
@@ -49,6 +51,11 @@ Pigeon has 3 types of tests, you'll find them all in
4951
code, then execute the generated code. It can be thought of as unit-tests run
5052
against the generated code. Examples: [platform_tests](./platform_tests)
5153

54+
For local testing, always use `test.dart` rather than `run_tests.dart`, as
55+
`run_tests.dart` is specifically a CI entrypoint. When iterating on a specific
56+
generator, you will likely want to use the `-t` flag to specific only the
57+
relevant tests. Pass `-l` to get a list of available tests for the `-t` flag.
58+
5259
## Generated Source Code Example
5360

5461
This is what the temporary generated code that the _PigeonIsolate_ executes

packages/pigeon/tool/shared/test_runner.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Future<void> runTests(
4949
print('# Running $test');
5050
final int testCode = await info.function();
5151
if (testCode != 0) {
52+
print('# Failed, exit code: $testCode');
5253
exit(testCode);
5354
}
5455
print('');

0 commit comments

Comments
 (0)