diff --git a/topics/_shared/custom_language_testing_snippets.md b/topics/_shared/custom_language_testing_snippets.md new file mode 100644 index 000000000..4e7ef8203 --- /dev/null +++ b/topics/_shared/custom_language_testing_snippets.md @@ -0,0 +1,27 @@ +# Snippets +{is-library="true"} + + + + + +Run the test and make sure it's successful. + + + +1. Open the Gradle Tool Window. +2. Select the simple_language_plugin node. + You may need to reimport it as a Gradle project. +3. Drill down under simple_language_plugin to Tasks, verification, test task. +4. Run the test task. + +The results are displayed in the Run Tool Window, and also written to the simple_language_plugin/build/test-results/test directory. + +If the Run Tool Window displays the error *Test events were not received*, do the following: +1. In the Gradle Tool Window, drill down under simple_language_plugin to Tasks, build, clean task. +2. Run the clean task, which deletes the simple_language_plugin/build directory. +3. Restart the test. + + + + diff --git a/topics/tutorials/writing_tests_for_plugins/annotator_test.md b/topics/tutorials/writing_tests_for_plugins/annotator_test.md index 65fc4ce5e..0c722cc47 100644 --- a/topics/tutorials/writing_tests_for_plugins/annotator_test.md +++ b/topics/tutorials/writing_tests_for_plugins/annotator_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 4. Annotator Test) +# 4. Annotator Test - + @@ -37,4 +37,5 @@ It then calls the `checkHighlighting()` method to verify weak warnings. {src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java" include-symbol="testAnnotator"} ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/commenter_test.md b/topics/tutorials/writing_tests_for_plugins/commenter_test.md index 70c9d794e..7339c938b 100644 --- a/topics/tutorials/writing_tests_for_plugins/commenter_test.md +++ b/topics/tutorials/writing_tests_for_plugins/commenter_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 9. Commenter Test) +# 9. Commenter Test - + @@ -21,4 +21,5 @@ It again calls the line comment action to remove the comment character and verif {src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java" include-symbol="testCommenter"} ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/completion_test.md b/topics/tutorials/writing_tests_for_plugins/completion_test.md index 30c1b282e..7560fe034 100644 --- a/topics/tutorials/writing_tests_for_plugins/completion_test.md +++ b/topics/tutorials/writing_tests_for_plugins/completion_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 3. Completion Test) +# 3. Completion Test - + @@ -48,4 +48,5 @@ This method: A number of related methods exist in [`CodeInsightTestFixture`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestFixture.java) for testing completion and lookup elements, e.g., when testing completion variants and requiring only one testdata file `CodeInsightTestFixture.testCompletionVariants()`. ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/documentation_test.md b/topics/tutorials/writing_tests_for_plugins/documentation_test.md index e2e1fa9c6..8507a9ebd 100644 --- a/topics/tutorials/writing_tests_for_plugins/documentation_test.md +++ b/topics/tutorials/writing_tests_for_plugins/documentation_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 11. Documentation Test) +# 11. Documentation Test - + @@ -24,4 +24,5 @@ Finally, the documentation string is verified against the expected output. {src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java" include-symbol="testDocumentation"} ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/find_usages_test.md b/topics/tutorials/writing_tests_for_plugins/find_usages_test.md index 59c9b85ae..adaad1eba 100644 --- a/topics/tutorials/writing_tests_for_plugins/find_usages_test.md +++ b/topics/tutorials/writing_tests_for_plugins/find_usages_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 8. Find Usages Test) +# 8. Find Usages Test - + @@ -33,4 +33,5 @@ This test verifies the find usage functionality will identify the "key with spac ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/folding_test.md b/topics/tutorials/writing_tests_for_plugins/folding_test.md index 7494c4fa7..a89fc2748 100644 --- a/topics/tutorials/writing_tests_for_plugins/folding_test.md +++ b/topics/tutorials/writing_tests_for_plugins/folding_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 7. Folding Test) +# 7. Folding Test - + @@ -33,4 +33,5 @@ This test method reuses the DefaultTestData.simple Simple file. ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/formatter_test.md b/topics/tutorials/writing_tests_for_plugins/formatter_test.md index c7dec9d09..79b092ee5 100644 --- a/topics/tutorials/writing_tests_for_plugins/formatter_test.md +++ b/topics/tutorials/writing_tests_for_plugins/formatter_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 5. Formatter Test) +# 5. Formatter Test - + @@ -31,4 +31,5 @@ Add the `testFormatter()` method to the `SimpleCodeInsightTest` class [previousl {src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java" include-symbol="testFormatter"} ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/parsing_test.md b/topics/tutorials/writing_tests_for_plugins/parsing_test.md index e3a959a53..45c5610bf 100644 --- a/topics/tutorials/writing_tests_for_plugins/parsing_test.md +++ b/topics/tutorials/writing_tests_for_plugins/parsing_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 2. Parsing Test) +# 2. Parsing Test - + @@ -64,16 +64,4 @@ Override `getTestDataPath()`, and return the path from the root of this plugin m ## Run the Test -Run tests by: -* Opening the Gradle Tool Window. -* Select the simple_language_plugin node. - You may need to reimport it as a Gradle project. -* Drill down under simple_language_plugin to Tasks, verification, test task. -* Run the test task. - -The results are displayed in the Run Tool Window, and also written to the simple_language_plugin/build/test-results/test directory. - -If the Run Tool Window displays the error *Test events were not received*, do the following: -* In the Gradle Tool Window, drill down under simple_language_plugin to Tasks, build, clean task. -* Run the clean task, which deletes the simple_language_plugin/build directory. -* Restart the test. + diff --git a/topics/tutorials/writing_tests_for_plugins/reference_test.md b/topics/tutorials/writing_tests_for_plugins/reference_test.md index 6985b5865..369094310 100644 --- a/topics/tutorials/writing_tests_for_plugins/reference_test.md +++ b/topics/tutorials/writing_tests_for_plugins/reference_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 10. Reference Test) +# 10. Reference Test - + @@ -29,6 +29,6 @@ The fixture gets the `PsiReference` at the caret position, and then asserts the ``` {src="simple_language_plugin/src/test/java/org/intellij/sdk/language/SimpleCodeInsightTest.java" include-symbol="testReference"} - ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + + diff --git a/topics/tutorials/writing_tests_for_plugins/rename_test.md b/topics/tutorials/writing_tests_for_plugins/rename_test.md index 70b4a0147..e08ea01c8 100644 --- a/topics/tutorials/writing_tests_for_plugins/rename_test.md +++ b/topics/tutorials/writing_tests_for_plugins/rename_test.md @@ -1,6 +1,6 @@ -[//]: # (title: 6. Rename Test) +# 6. Rename Test - + @@ -45,4 +45,5 @@ Add the `testRename()` method to the `SimpleCodeInsightTest` class [previously d ## Run the Test -[Run](parsing_test.md#run-the-test) the test and make sure it's green. + +