X91-AmalgamatedCatch.cpp 954 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright Catch2 Authors
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // https://www.boost.org/LICENSE_1_0.txt)
  5. // SPDX-License-Identifier: BSL-1.0
  6. /**\file
  7. * This file serves as a simple compilation test against the amalgamated
  8. * version of Catch2.
  9. */
  10. #include "catch_amalgamated.hpp"
  11. TEST_CASE("Just a dummy test") {
  12. auto i = GENERATE(1, 2, 3);
  13. SECTION("a") {
  14. REQUIRE(1 != 4);
  15. }
  16. SECTION("b") {
  17. CHECK(1 != 5);
  18. }
  19. REQUIRE_THAT(1,
  20. Catch::Matchers::Predicate<int>([](int i) {
  21. return i % 2 == 1;
  22. }));
  23. }
  24. TEMPLATE_TEST_CASE("Trivial template test case", "", char, short) {
  25. STATIC_REQUIRE(sizeof(TestType) <= sizeof(int));
  26. }
  27. TEST_CASE("Benchmark test", "[!benchmark]") {
  28. BENCHMARK("Allocation benchmark") {
  29. return std::vector<int>(10);
  30. };
  31. }