diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-30 18:15:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 18:15:06 +0200 |
commit | 7488b07220fc73df5ed4babf2c9bf53f2fa1bf0e (patch) | |
tree | 10de495597514c016be013fc31cdd851c20ffce4 /tests/test_validate_testing.h | |
parent | 9833f9cc11b82e560b81b605c2ff4ba0a1247624 (diff) | |
parent | 0512cc01d9eab9dce2278fddb92e134d23cd25eb (diff) |
Merge pull request #40883 from Xrayez/tests-macros
Hide implementation details of doctest macros
Diffstat (limited to 'tests/test_validate_testing.h')
-rw-r--r-- | tests/test_validate_testing.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/test_validate_testing.h b/tests/test_validate_testing.h index 5be7d45185..24acdec96c 100644 --- a/tests/test_validate_testing.h +++ b/tests/test_validate_testing.h @@ -33,10 +33,26 @@ #include "core/os/os.h" -#include "thirdparty/doctest/doctest.h" +#include "tests/test_macros.h" -TEST_CASE("Validate Test will always pass") { - CHECK(true); +TEST_SUITE("Validate tests") { + TEST_CASE("Always pass") { + CHECK(true); + } + TEST_CASE_PENDING("Pending tests are skipped") { + if (!doctest::getContextOptions()->no_skip) { // Normal run. + FAIL("This should be skipped if `--no-skip` is NOT set (missing `doctest::skip()` decorator?)"); + } else { + CHECK_MESSAGE(true, "Pending test is run with `--no-skip`"); + } + } + TEST_CASE("Muting Godot error messages") { + ERR_PRINT_OFF; + CHECK_MESSAGE(!_print_error_enabled, "Error printing should be disabled."); + ERR_PRINT("Still waiting for Godot!"); // This should never get printed! + ERR_PRINT_ON; + CHECK_MESSAGE(_print_error_enabled, "Error printing should be re-enabled."); + } } #endif // TEST_VALIDATE_TESTING_H |