From 591e08b656b9e11d59cbed38a269024d16a1069b Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Fri, 16 Oct 2020 16:12:51 +0200 Subject: [PATCH 1/9] Initial section on testing --- src/index.md | 109 ++++++++++++++++++++++++++++++++++++++++++ src/testingChanges.md | 20 +------- 2 files changed, 111 insertions(+), 18 deletions(-) diff --git a/src/index.md b/src/index.md index dd042b3..930d2c9 100644 --- a/src/index.md +++ b/src/index.md @@ -333,6 +333,115 @@ For the purposes of brevity this document will use the term "bug" to refer to bo _Congratulations!_ Your changeset will now make its way towards a promoted build. When the changeset becomes part of a promoted build, the bug's "Resolved in Build" will have a value of \"b\[1-9\]\[0-9\]*\" to indicate the build number. +# Testing Changes + +In addition to your own Java applications, OpenJDK have support for two test frameworks, JTReg and GTest. JTReg is a Java regression test framework that is used for most of the tests that are included in the OpenJDK source repository. The Google Test (GTest) framework is intended for unit testing of the C++ native code. + +## JTReg + +In depth documentation about the JTReg framework is found here: [JTReg harness](https://openjdk.java.net/jtreg/). JTReg itself is available in the [Code Tools Project](https://openjdk.java.net/projects/code-tools/). + +Below is a small example of a JTReg test. It’s a clean Java class with a main method that is called from the test harness. If the test fails we throw a RuntimeException. This is picked up by the harness and is reported as a test failure. Try to always write a meaningful message in the exception. One that actually helps with understanding what went wrong once the test fails. + + /* + * @test + * @summary Make sure feature X handles Y correctly + */ + public class TestXY { + public static void main(String[] args) throws Exception { + var result = X.y(); + if (result != expected_result) { + throw new RuntimeException("X.y() gave " + result + ", expexted " + expected_result); + } + } + } + +This example only utilizes two JTReg specific tags, `@test` and `@summary`. `@test` simply tells JTReg that this class is a test, and `@summary` provides a description of the test. There are several other tags that can be used in JTReg tests. You can for instance associate the test with a specific bug that this test is a regression test for. + + @bug 7000001 + +Or you can specify a number of requirements that must be fulfilled for JTReg to execute the test. + + @requires docker.support + @requires os.family != ”windows” + @requires os.maxMemory > 3G + @requires os.arch=="x86_64" | os.arch=="amd64" + +You can also specify if the test requires specific modules, and you can specify command line flags and run the test in several different ways. + + @modules java.base/jdk.internal.misc + @run main/othervm -Xmx128m TestStringEndify + +Note that you can have several `@run` tags in the same test with different command line options. + +The [JTReg documentation](https://openjdk.java.net/jtreg/) provides information on many more tags like these. + +### Running OpenJDK JTReg Tests + +When configuring the OpenJDK build you can tell it where your JTReg installation is located. When providing this information you can later run `make run-test` to execute JTReg tests. + + sh ./configure --with-jtreg=/path/to/jtreg + make run-test TEST=tier1 + +In the OpenJDK source tree you can find a directory called `test`. There are a large number of tests in this directory that are written to be used with JTReg. + + make run-test TEST=test/jdk/java/lang/String/ + +You can also run JTReg without invoking make. In this case you’ll need to tell JTReg which JDK to test. + + jtreg -jdk:/path/to/jdk /path/to/test + +## GTest + +As mentioned the Google test framework is mainly used for C++ unit tests. There are several of these in the `test/hotspot` directory. The tests can be run without starting the JVM, which enables testing of JVM data structures that would be fragile to play with in a running JVM. + + static int demo_comparator(int a, int b) { + if (a == b) { + return 0; + } + if (a < b) { + return -1; + } + return 1; + } + + TEST(Demo, quicksort) { + int test_array[] = {7,1,5,3,6,9,8,2,4,0}; + int expected_array[] = {0,1,2,3,4,5,6,7,8,9}; + + QuickSort::sort(test_array, 10, demo_comparator, false); + for (int i = 0; i < 10; i++) { + ASSERT_EQ(expected_array[i], test_array[i]); + } + } + +`ASSERT_EQ` is one example of an assertion that can be used in the test. Below are a few other examples. A full list is found in the [Google Test Documentation](https://github.com/google/googletest/blob/master/googletest/docs/primer.md). + + EXPECT_TRUE(condition); + EXPECT_FALSE(condition); + ASSERT_TRUE(condition); + ASSERT_FALSE(condition); + EXPECT_EQ(expected, actual); + EXPECT_NE(val1, val2); + EXPECT_LT(val1, val2); + EXPECT_LE(val1, val2); + EXPECT_GT(val1, val2); + EXPECT_GE(val1, val2); + EXPECT_STREQ(expected_str, actual_str); + +`ASSERT` is a fatal assertion and will give you fast failure. That means that test execution will be stopped and the failure will be reported. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. + +### Running OpenJDK GTests + +To run GTests in OpenJDK use make: + + make test-hotspot-gtest + +You can use the environment variable `GTEST_FILTER` to select subsets of tests. The filter should be a regular expression. + + GTEST_FILTER="code.*:os.*" + GTEST_FILTER="os.*-os.page_size_*" + # Producing a Changeset This section is confined to the actual Mercurial mechanics required to produce a changeset: diff --git a/src/testingChanges.md b/src/testingChanges.md index 1385dfe..97f7af7 100644 --- a/src/testingChanges.md +++ b/src/testingChanges.md @@ -1,19 +1,3 @@ -% Testing Changes +% Page moved -::: {.NavBit} -[« Previous](reviewBodies.html) • [TOC](index.html) • [Next »](jckAcquisition.html) -::: - -This section will describe the need for tests and will provide an engineering -perspective to the different kinds of test suites, including regression tests -as run by the [jtreg harness](../jtreg/) and JCK -tests. Characteristics of a good regression test will be provided. - - - -::: {.NavBit} -[« Previous](reviewBodies.html) • [TOC](index.html) • [Next »](jckAcquisition.html) -::: +The OpenJDK Developers' Guide has been merged into a single document. Please update your links to point to the new location: [OpenJDK Developers' Guide](index.html) From f2bd4bc05b76d20c0b3f7cbadb130cd8e447a650 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Mon, 19 Oct 2020 22:48:54 +0200 Subject: [PATCH 2/9] Updates suggested by Phil and Igor --- README.md | 1 + src/index.md | 34 +++++++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 95375d9..b456514 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,4 @@ The Developers' Guide is continuously updated and there are several parts still * Text about JCK * Text about backports * Text about JBS, triage, priorities, status +* List JTReg `@key` conventions for different areas diff --git a/src/index.md b/src/index.md index 930d2c9..628d45e 100644 --- a/src/index.md +++ b/src/index.md @@ -337,15 +337,18 @@ _Congratulations!_ Your changeset will now make its way towards a promoted build In addition to your own Java applications, OpenJDK have support for two test frameworks, JTReg and GTest. JTReg is a Java regression test framework that is used for most of the tests that are included in the OpenJDK source repository. The Google Test (GTest) framework is intended for unit testing of the C++ native code. +This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://github.com/openjdk/jdk/blob/master/doc/testing.md). + ## JTReg -In depth documentation about the JTReg framework is found here: [JTReg harness](https://openjdk.java.net/jtreg/). JTReg itself is available in the [Code Tools Project](https://openjdk.java.net/projects/code-tools/). +In-depth documentation about the JTReg framework is found here: [JTReg harness](https://openjdk.java.net/jtreg/). JTReg itself is available in the [Code Tools Project](https://openjdk.java.net/projects/code-tools/). Below is a small example of a JTReg test. It’s a clean Java class with a main method that is called from the test harness. If the test fails we throw a RuntimeException. This is picked up by the harness and is reported as a test failure. Try to always write a meaningful message in the exception. One that actually helps with understanding what went wrong once the test fails. /* * @test * @summary Make sure feature X handles Y correctly + * @run main TestXY */ public class TestXY { public static void main(String[] args) throws Exception { @@ -356,7 +359,9 @@ Below is a small example of a JTReg test. It’s a clean Java class with a main } } -This example only utilizes two JTReg specific tags, `@test` and `@summary`. `@test` simply tells JTReg that this class is a test, and `@summary` provides a description of the test. There are several other tags that can be used in JTReg tests. You can for instance associate the test with a specific bug that this test is a regression test for. +This example only utilizes three JTReg specific tags, `@test`, `@summary`, and `@run`. `@test` simply tells JTReg that this class is a test, and `@summary` provides a description of the test. `@run` tells JTReg how to execute the test. In this case we simply tell JTReg to execute the main method of the class `TestXY`. `@run` is not strictly necessary for JTReg to execute the test, an implicit `@run` tag will be added if none exists. However, for clarity and in order to avoid bugs it's recommended to always explicitly use the `@run` tag. + +There are several other tags that can be used in JTReg tests. You can for instance associate the test with a specific bug that this test is a regression test for. @bug 7000001 @@ -370,10 +375,16 @@ Or you can specify a number of requirements that must be fulfilled for JTReg to You can also specify if the test requires specific modules, and you can specify command line flags and run the test in several different ways. @modules java.base/jdk.internal.misc - @run main/othervm -Xmx128m TestStringEndify + @run main/othervm -Xmx128m TestXY Note that you can have several `@run` tags in the same test with different command line options. +JTReg also have support for labeling tests with arbitrary keys using the `@key` tag. These keywords can then be used to filter the test selection. For instance if you have a UI test which needs to display a window you'll want to make sure the test harness doesn't try to run this test on a system which doesn't support headful tests. You do this by specifying + + @key headful + +There are many other keywords in use, like `intermittent` and `randomness`, and their usage may differ between areas in the JDK. Make sure you understand the conventions for the particular area you are testing since this is just an example. + The [JTReg documentation](https://openjdk.java.net/jtreg/) provides information on many more tags like these. ### Running OpenJDK JTReg Tests @@ -393,7 +404,7 @@ You can also run JTReg without invoking make. In this case you’ll need to tell ## GTest -As mentioned the Google test framework is mainly used for C++ unit tests. There are several of these in the `test/hotspot` directory. The tests can be run without starting the JVM, which enables testing of JVM data structures that would be fragile to play with in a running JVM. +As mentioned the Google test framework is mainly used for C++ unit tests. There are several of these in the `test/hotspot` directory. Currently, only the C++ code in the JVM area is supported by the OpenJDK GTest framework. The tests can be run without starting the JVM, which enables testing of JVM data structures that would be fragile to play with in a running JVM. static int demo_comparator(int a, int b) { if (a == b) { @@ -431,16 +442,21 @@ As mentioned the Google test framework is mainly used for C++ unit tests. There `ASSERT` is a fatal assertion and will give you fast failure. That means that test execution will be stopped and the failure will be reported. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. +For more information on how to write good GTests in OpenJDK, see [`doc/hotspot-unit-tests.md`](https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.md). + ### Running OpenJDK GTests -To run GTests in OpenJDK use make: +When configuring the OpenJDK build you can tell it where your GTest installation is located. Once configured, use make to run GTests. + + sh ./configure --with-gtest=/path/to/gtest + make test TEST=gtest - make test-hotspot-gtest +You can also use a regular expression to filter which tests to run: -You can use the environment variable `GTEST_FILTER` to select subsets of tests. The filter should be a regular expression. + make test TEST=gtest:code.*:os.* + make test TEST=gtest:$X/$variant - GTEST_FILTER="code.*:os.*" - GTEST_FILTER="os.*-os.page_size_*" +The second example above runs tests which match the regexp `$X.*` on a specific variant of the JVM. The variant is one of client, server, etc. # Producing a Changeset From bc95e8c3960f86d7ba3621d536b5fc983176d8c3 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Mon, 19 Oct 2020 23:29:28 +0200 Subject: [PATCH 3/9] Updates suggested by Joe --- src/index.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/index.md b/src/index.md index 628d45e..9df1182 100644 --- a/src/index.md +++ b/src/index.md @@ -339,6 +339,14 @@ In addition to your own Java applications, OpenJDK have support for two test fra This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://github.com/openjdk/jdk/blob/master/doc/testing.md). +In general all changes should come with a regression test so if you're writing product code you should also be writing test code. There are a few examples where it doesn't make sence to write an explicit regression test. These should be tagged in JBS with one of the [noreg-labels](#noreg). + +A few key items to think about when writing a regression test: + +* A regression test should execute fast - a few seconds at most +* The test should only test the desired functionality - if you have several features to test, write more tests +* The test should pass reliably on all supported platforms - watch out for platform-specific differences such as path separators + ## JTReg In-depth documentation about the JTReg framework is found here: [JTReg harness](https://openjdk.java.net/jtreg/). JTReg itself is available in the [Code Tools Project](https://openjdk.java.net/projects/code-tools/). @@ -383,7 +391,9 @@ JTReg also have support for labeling tests with arbitrary keys using the `@key` @key headful -There are many other keywords in use, like `intermittent` and `randomness`, and their usage may differ between areas in the JDK. Make sure you understand the conventions for the particular area you are testing since this is just an example. +Another example is `@key randomness` that should be used to indicate that a test is using randomness - i.e. is intentionally non-deterministic. + +There are many other keywords in use and their usage may differ between areas in the JDK. Make sure you understand the conventions for the particular area you are testing since these are just examples. The [JTReg documentation](https://openjdk.java.net/jtreg/) provides information on many more tags like these. From ec90176895aa4a4f10f8acfada4c45039955d697 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Tue, 20 Oct 2020 00:24:05 +0200 Subject: [PATCH 4/9] Updates suggested by Igor --- src/index.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/index.md b/src/index.md index 9df1182..edcb05c 100644 --- a/src/index.md +++ b/src/index.md @@ -347,6 +347,8 @@ A few key items to think about when writing a regression test: * The test should only test the desired functionality - if you have several features to test, write more tests * The test should pass reliably on all supported platforms - watch out for platform-specific differences such as path separators +The JTReg documentation has a section on [how to write good JTReg tests](https://openjdk.java.net/jtreg/writetests.html). + ## JTReg In-depth documentation about the JTReg framework is found here: [JTReg harness](https://openjdk.java.net/jtreg/). JTReg itself is available in the [Code Tools Project](https://openjdk.java.net/projects/code-tools/). @@ -387,7 +389,7 @@ You can also specify if the test requires specific modules, and you can specify Note that you can have several `@run` tags in the same test with different command line options. -JTReg also have support for labeling tests with arbitrary keys using the `@key` tag. These keywords can then be used to filter the test selection. For instance if you have a UI test which needs to display a window you'll want to make sure the test harness doesn't try to run this test on a system which doesn't support headful tests. You do this by specifying +JTReg also have support for labeling tests with keys using the `@key` tag. These keywords can then be used to filter the test selection. For instance if you have a UI test which needs to display a window you'll want to make sure the test harness doesn't try to run this test on a system which doesn't support headful tests. You do this by specifying @key headful @@ -397,6 +399,8 @@ There are many other keywords in use and their usage may differ between areas in The [JTReg documentation](https://openjdk.java.net/jtreg/) provides information on many more tags like these. +The [compiler group](https://openjdk.java.net/groups/compiler/) has a section in their wiki with [Guidelines for "langtools" tests](https://openjdk.java.net/groups/compiler/tests.html). + ### Running OpenJDK JTReg Tests When configuring the OpenJDK build you can tell it where your JTReg installation is located. When providing this information you can later run `make run-test` to execute JTReg tests. @@ -438,21 +442,15 @@ As mentioned the Google test framework is mainly used for C++ unit tests. There `ASSERT_EQ` is one example of an assertion that can be used in the test. Below are a few other examples. A full list is found in the [Google Test Documentation](https://github.com/google/googletest/blob/master/googletest/docs/primer.md). - EXPECT_TRUE(condition); - EXPECT_FALSE(condition); ASSERT_TRUE(condition); ASSERT_FALSE(condition); EXPECT_EQ(expected, actual); - EXPECT_NE(val1, val2); EXPECT_LT(val1, val2); - EXPECT_LE(val1, val2); - EXPECT_GT(val1, val2); - EXPECT_GE(val1, val2); EXPECT_STREQ(expected_str, actual_str); `ASSERT` is a fatal assertion and will give you fast failure. That means that test execution will be stopped and the failure will be reported. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. -For more information on how to write good GTests in OpenJDK, see [`doc/hotspot-unit-tests.md`](https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.md). +For more information on how to write good GTests in HotSpot, see [`doc/hotspot-unit-tests.md`](https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.md). ### Running OpenJDK GTests From c3425990af8d3089d35f4778faa48f9fe9699e0b Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Tue, 20 Oct 2020 00:59:03 +0200 Subject: [PATCH 5/9] C++ testing using JTReg. --- src/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.md b/src/index.md index edcb05c..c39dbf3 100644 --- a/src/index.md +++ b/src/index.md @@ -335,7 +335,7 @@ _Congratulations!_ Your changeset will now make its way towards a promoted build # Testing Changes -In addition to your own Java applications, OpenJDK have support for two test frameworks, JTReg and GTest. JTReg is a Java regression test framework that is used for most of the tests that are included in the OpenJDK source repository. The Google Test (GTest) framework is intended for unit testing of the C++ native code. +In addition to your own Java applications, OpenJDK have support for two test frameworks, JTReg and GTest. JTReg is a Java regression test framework that is used for most of the tests that are included in the OpenJDK source repository. The Google Test (GTest) framework is intended for unit testing of the C++ native code. Currently only JVM testing is supported by the GTest framework. Other areas use JTReg for unit testing of C++ code. This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://github.com/openjdk/jdk/blob/master/doc/testing.md). @@ -448,7 +448,7 @@ As mentioned the Google test framework is mainly used for C++ unit tests. There EXPECT_LT(val1, val2); EXPECT_STREQ(expected_str, actual_str); -`ASSERT` is a fatal assertion and will give you fast failure. That means that test execution will be stopped and the failure will be reported. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. +`ASSERT` is a fatal assertion and will interrupt execution of the current sub-routine. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. For more information on how to write good GTests in HotSpot, see [`doc/hotspot-unit-tests.md`](https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.md). From 9e8f4bc56852b1e15e1ab56277b7ed3d076195cd Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Tue, 20 Oct 2020 12:47:48 +0200 Subject: [PATCH 6/9] Link to html version of testing docs --- src/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.md b/src/index.md index c39dbf3..bec330c 100644 --- a/src/index.md +++ b/src/index.md @@ -337,7 +337,7 @@ _Congratulations!_ Your changeset will now make its way towards a promoted build In addition to your own Java applications, OpenJDK have support for two test frameworks, JTReg and GTest. JTReg is a Java regression test framework that is used for most of the tests that are included in the OpenJDK source repository. The Google Test (GTest) framework is intended for unit testing of the C++ native code. Currently only JVM testing is supported by the GTest framework. Other areas use JTReg for unit testing of C++ code. -This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://github.com/openjdk/jdk/blob/master/doc/testing.md). +This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://htmlpreview.github.io/?https://github.com/openjdk/jdk/blob/master/doc/testing.html). In general all changes should come with a regression test so if you're writing product code you should also be writing test code. There are a few examples where it doesn't make sence to write an explicit regression test. These should be tagged in JBS with one of the [noreg-labels](#noreg). @@ -450,7 +450,7 @@ As mentioned the Google test framework is mainly used for C++ unit tests. There `ASSERT` is a fatal assertion and will interrupt execution of the current sub-routine. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. -For more information on how to write good GTests in HotSpot, see [`doc/hotspot-unit-tests.md`](https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.md). +For more information on how to write good GTests in HotSpot, see [`doc/hotspot-unit-tests.md`](https://htmlpreview.github.io/?https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.html). ### Running OpenJDK GTests From 23762e2c6205a13eb52207a3fa3126434a6f7ac6 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 22 Oct 2020 21:54:24 +0200 Subject: [PATCH 7/9] Updates suggested by Lance --- src/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.md b/src/index.md index bec330c..2af37df 100644 --- a/src/index.md +++ b/src/index.md @@ -346,6 +346,8 @@ A few key items to think about when writing a regression test: * A regression test should execute fast - a few seconds at most * The test should only test the desired functionality - if you have several features to test, write more tests * The test should pass reliably on all supported platforms - watch out for platform-specific differences such as path separators +* Binary files should not be checked in, if your test needs to use one, the test should create it in some fashion +* Avoid shell scripts and relying on external commands as much as possible The JTReg documentation has a section on [how to write good JTReg tests](https://openjdk.java.net/jtreg/writetests.html). From 2726d1dcc57c9399a92f3f1902203d39d39c555a Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 22 Oct 2020 22:00:23 +0200 Subject: [PATCH 8/9] Revert links back to .md files --- src/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.md b/src/index.md index 2af37df..a275c13 100644 --- a/src/index.md +++ b/src/index.md @@ -337,7 +337,7 @@ _Congratulations!_ Your changeset will now make its way towards a promoted build In addition to your own Java applications, OpenJDK have support for two test frameworks, JTReg and GTest. JTReg is a Java regression test framework that is used for most of the tests that are included in the OpenJDK source repository. The Google Test (GTest) framework is intended for unit testing of the C++ native code. Currently only JVM testing is supported by the GTest framework. Other areas use JTReg for unit testing of C++ code. -This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://htmlpreview.github.io/?https://github.com/openjdk/jdk/blob/master/doc/testing.html). +This section provides a brief summary of how to get started with testing in OpenJDK. For more information on configuration and how to use the OpenJDK test framework, a.k.a. "run-test framework", see [`doc/testing.md`](https://github.com/openjdk/jdk/blob/master/doc/testing.md). In general all changes should come with a regression test so if you're writing product code you should also be writing test code. There are a few examples where it doesn't make sence to write an explicit regression test. These should be tagged in JBS with one of the [noreg-labels](#noreg). @@ -452,7 +452,7 @@ As mentioned the Google test framework is mainly used for C++ unit tests. There `ASSERT` is a fatal assertion and will interrupt execution of the current sub-routine. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test. All assertions have both an `ASSERT` and an `EXPECT` variant. -For more information on how to write good GTests in HotSpot, see [`doc/hotspot-unit-tests.md`](https://htmlpreview.github.io/?https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.html). +For more information on how to write good GTests in HotSpot, see [`doc/hotspot-unit-tests.md`](https://github.com/openjdk/jdk/blob/master/doc/hotspot-unit-tests.md). ### Running OpenJDK GTests From 43dd254839b2a8462806f08b2391d5975c321f91 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Thu, 22 Oct 2020 22:07:15 +0200 Subject: [PATCH 9/9] Added note about TEST.properties --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b456514..e4b8766 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,4 @@ The Developers' Guide is continuously updated and there are several parts still * Text about backports * Text about JBS, triage, priorities, status * List JTReg `@key` conventions for different areas +* Document best practices around TEST.properties usage. See [PR#30](https://github.com/openjdk/guide/pull/30#issuecomment-714589551)