Skip to content

Commit

Permalink
Update contribution guide to not use TestGenerator (#92)
Browse files Browse the repository at this point in the history
* Update contribution guide to not use TestGenerator.
* Update contribution guide to use compilerTestEnabled property.
  • Loading branch information
neetopia committed Sep 30, 2020
1 parent e1c5ca1 commit 6c45a3b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Expand Up @@ -57,12 +57,9 @@ it should be extending [AbstractTestProcessor](compiler-plugin/src/main/kotlin/c
* Then follows virtual files section till the end of test file.
* You can use ```// FILE: <file name>``` to create files that will be available at run time of the test.
* E.g. ```// FILE: a.kt``` will result in a file named ```a.kt``` at run time.
* Generate test using gradle.
* After you have finished writing your test file, you can generate the test case in TestSuite by running
```generateTests```gradle task. It can take a while.
* After generating, make sure there is no other tests generated by checking git status, you should include only tests in
[KotlinKSPTestGenerated](compiler-plugin/src/test/kotlin/com/google/devtools/ksp/test/KotlinKSPTestGenerated.java) in your PR.
* Add new test to [test suite](compiler-plugin/src/test/java/com/google/devtools/ksp/test/KotlinKSPTestGenerated.java)
* Run generated tests with ```:compiler-plugin:test``` gradle task.
* Make sure you run test with `-PcompilerTestEnabled` as Gradle argument. Alternatively, you can also set `compilerTestEnabled=false` in `gradle.properties` in project root.
* This will execute all tests in KSP test suite. To run your test only, specify the test name with
```--tests "com.google.devtools.ksp.test.KotlinKSPTestGenerated.<name of your generated test>"```
* Make sure your change is not breaking any existing test as well :).

0 comments on commit 6c45a3b

Please sign in to comment.