Results.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. * Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
  4. * Copyright (c) 2021, Brian Gianforcaro <bgianf@serenityos.org>
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #pragma once
  9. #include <AK/DeprecatedString.h>
  10. #include <AK/Vector.h>
  11. namespace Test {
  12. enum class Result {
  13. Pass,
  14. Fail,
  15. Skip,
  16. Crashed,
  17. };
  18. struct Case {
  19. DeprecatedString name;
  20. Result result;
  21. DeprecatedString details;
  22. u64 duration_us;
  23. };
  24. struct Suite {
  25. DeprecatedString path;
  26. DeprecatedString name;
  27. // A failed test takes precedence over a skipped test, which both have
  28. // precedence over a passed test
  29. Result most_severe_test_result { Result::Pass };
  30. Vector<Case> tests {};
  31. };
  32. struct Counts {
  33. // Not all of these might be used by a certain test runner, e.g. some
  34. // do not have a concept of suites, or might not load tests from files.
  35. unsigned tests_failed { 0 };
  36. unsigned tests_passed { 0 };
  37. unsigned tests_skipped { 0 };
  38. unsigned suites_failed { 0 };
  39. unsigned suites_passed { 0 };
  40. unsigned files_total { 0 };
  41. };
  42. }