RFR: Initial section on testing [v2]
Jesper Wilhelmsson
jwilhelm at openjdk.java.net
Mon Oct 19 22:17:17 UTC 2020
On Mon, 19 Oct 2020 21:21:13 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
>> Jesper Wilhelmsson has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Updates suggested by Phil and Igor
>
> src/index.md line 443:
>
>> 441: EXPECT_STREQ(expected_str, actual_str);
>> 442:
>> 443: `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.
>
> strictly speaking, `ASSERT` stops execution of the current method (as in fact it's just: change test's status, print
> message, `return`), so if a test uses `ASSERT` in a subroutine, its _main test code_ has to call a subroutine within
> `ASSERT_NO_FATAL_FAILURE` macro. it's explained in greater detail in `doc/hotspot-unit-tests.md`.
Is there an easy way to explain this or can we leave more complex examples with subroutines to
`doc/hotspot-unit.tests.md`?
> src/index.md line 445:
>
>> 443: `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. 444: 445: 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).
>
> just to avoid confusion, I'd prefer to be explicit here and say that `doc/hotspot-unit-tests.md` provides information
> about how to write good gtest tests for hotspot.
Ok.
-------------
PR: https://git.openjdk.java.net/guide/pull/30
More information about the guide-dev
mailing list