TestResult.h 848 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2023, Martin Janiczek <martin@janiczek.cz>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. namespace Test {
  8. // TestResult signals to the TestSuite how the TestCase execution went.
  9. enum class TestResult {
  10. NotRun,
  11. // Test fn ran to completion without setting any of the below flags
  12. Passed,
  13. // Didn't get through EXPECT(...).
  14. Failed,
  15. // Didn't get through the ASSUME(...) filter 15 times in a row
  16. // (in a randomized test).
  17. // Alternatively, user used REJECT(...).
  18. Rejected,
  19. // Ran out of RandomRun data (in a randomized test, when shrinking).
  20. // This is fine, we'll just try some other shrink.
  21. Overrun,
  22. };
  23. // Used eg. to signal we've ran out of prerecorded random bits.
  24. // Defined in TestSuite.cpp
  25. void set_current_test_result(TestResult);
  26. } // namespace Test