mirror of
https://github.com/eclipse-cdt/cdt
synced 2024-10-28 03:59:40 +01:00
Update FAQ instruction on running test suite (#58)
as a result of the conversation on PR #54 we identified the FAQ on this item was out of date. https://github.com/eclipse-cdt/cdt/pull/54#issuecomment-1222596313
This commit is contained in:
parent
6445ec4890
commit
42a7aa82d6
3 changed files with 23 additions and 18 deletions
|
@ -2545,24 +2545,7 @@ still pass. Add a test case for your changes.
|
|||
|
||||
#### How do I run CDT JUnit test suite?
|
||||
|
||||
There are special Java packages to test CDT itself. Their names end with
|
||||
suffix ".tests". They are normally run during the build of CDT for
|
||||
example you can see results for Hudson builds here:
|
||||
[<https://ci.eclipse.org/cdt/job/cdt-master/lastCompletedBuild/testReport/>](https://hudson.eclipse.org/hudson/job/cdt-nightly/lastCompletedBuild/testReport/).
|
||||
|
||||
You can run JUnit tests in UI this way:
|
||||
|
||||
1. Select test CDT package (ends with ".tests", for example
|
||||
org.eclipse.cdt.core.tests).
|
||||
2. Locate the main test suite in the package (i.e.
|
||||
suite/org.eclipse.cdt.core.suite/AutomatedIntegrationSuite.java)
|
||||
3. Right-click on the suite java file in Package Explorer and
|
||||
select Run As-\>JUnit Plugin Test.
|
||||
|
||||
You can run individual tests this way as well.
|
||||
|
||||
Note that there could be intermittent failures in random tests, if you
|
||||
are getting those, try to rerun the tests.
|
||||
Please see instructions in the testing readme section [How do I run CDT JUnit test suite?](../TESTING.md#how-do-i-run-cdt-junit-test-suite)
|
||||
|
||||
#### How do I submit a fix for a bug?
|
||||
|
||||
|
|
22
TESTING.md
22
TESTING.md
|
@ -6,6 +6,28 @@ This document is a collection of various notes on testing and writing JUnit test
|
|||
|
||||
Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for contributing information, including setting up a development environment.
|
||||
|
||||
### How do I run CDT JUnit test suite?
|
||||
|
||||
There are special Java packages to test CDT itself.
|
||||
Their names generally end with suffix ".tests".
|
||||
They are normally run during the build of CDT for example you can see results for Jenkins builds [here](https://ci.eclipse.org/cdt/job/cdt/job/main/lastCompletedBuild/testReport).
|
||||
|
||||
You can run JUnit tests in UI this way:
|
||||
|
||||
1. Select test CDT package (ends with ".tests", for example org.eclipse.cdt.core.tests).
|
||||
2. Right-click on the class, suite, package, source folder or project you want to run in Package Explorer and select Run As-\>JUnit Plugin Test.
|
||||
|
||||
The build machine generally use the standard [Tycho Surefire](https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/plugin-info.html) class name patterns for [includes](https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/integration-test-mojo.html#includes) and [excludes](https://www.eclipse.org/tycho/sitedocs/tycho-surefire-plugin/integration-test-mojo.html#excludes) to identify tests during automated builds.
|
||||
|
||||
![run_junit_tests.png](images/run_junit_tests.png "screenshot of how to run junit plug-in tests")
|
||||
|
||||
|
||||
Some sets of tests are grouped in "suites", these can be used to run subsets of tests that may exist across numerous packages.
|
||||
An example is the CDT core's [AutomatedIntegrationSuite](https://github.com/eclipse-cdt/cdt/blob/main/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java).
|
||||
|
||||
Note that there could be intermittent failures in random tests, if you are getting those, try to rerun the tests.
|
||||
Tests can be marked as flaky, see the subsequent section for more details.
|
||||
|
||||
### Marking tests as Slow or Flaky
|
||||
|
||||
Tests in CDT can be marked as Slow or Flaky to prevent them running as part of the standard test suites. See excludedGroups to skip slow or flaky tests sections above.
|
||||
|
|
BIN
images/run_junit_tests.png
Normal file
BIN
images/run_junit_tests.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
Loading…
Reference in a new issue