|
| 1 | +/* |
| 2 | + * ----------------------------------------------------------------------------- |
| 3 | + * Project: Fossil Logic |
| 4 | + * |
| 5 | + * This file is part of the Fossil Logic project, which aims to develop high- |
| 6 | + * performance, cross-platform applications and libraries. The code contained |
| 7 | + * herein is subject to the terms and conditions defined in the project license. |
| 8 | + * |
| 9 | + * Author: Michael Gene Brockus (Dreamer) |
| 10 | + * Date: 07/01/2024 |
| 11 | + * |
| 12 | + * Copyright (C) 2024 Fossil Logic. All rights reserved. |
| 13 | + * ----------------------------------------------------------------------------- |
| 14 | + */ |
| 15 | + |
| 16 | +#include "fossil/test/framework.h" |
| 17 | + |
| 18 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 19 | +// * Fossil Logic Test Utilites |
| 20 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 21 | +// Setup steps for things like test fixtures and |
| 22 | +// mock objects are set here. |
| 23 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 24 | + |
| 25 | +// Define the test suite and add test cases |
| 26 | +FOSSIL_TEST_SUITE(cpp_mark_suite); |
| 27 | + |
| 28 | +// Setup function for the test suite |
| 29 | +FOSSIL_SETUP(cpp_mark_suite) { |
| 30 | + // Setup code here |
| 31 | +} |
| 32 | + |
| 33 | +// Teardown function for the test suite |
| 34 | +FOSSIL_TEARDOWN(cpp_mark_suite) { |
| 35 | + // Teardown code here |
| 36 | +} |
| 37 | + |
| 38 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 39 | +// * Fossil Logic Test Cases |
| 40 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 41 | +// The test cases below are provided as samples, inspired |
| 42 | +// by the Meson build system's approach of using test cases |
| 43 | +// as samples for library usage. |
| 44 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 45 | + |
| 46 | +// A test case to check if the benchmark stop works correctly |
| 47 | +FOSSIL_TEST_CASE(cpp_mark_start_and_stop) { |
| 48 | + MARK_BENCHMARK(stop_test); |
| 49 | + MARK_START(stop_test); |
| 50 | + MARK_STOP(stop_test); |
| 51 | + FOSSIL_TEST_ASSUME(benchmark_stop_test.end_time != 0, "Benchmark stop failed"); |
| 52 | +} |
| 53 | + |
| 54 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 55 | +// * Fossil Logic Test Pool |
| 56 | +// * * * * * * * * * * * * * * * * * * * * * * * * |
| 57 | +FOSSIL_TEST_GROUP(cpp_mark_test_cases) { |
| 58 | + FOSSIL_TEST_ADD(cpp_mark_suite, cpp_mark_start_and_stop); |
| 59 | + |
| 60 | + FOSSIL_TEST_REGISTER(cpp_mark_suite); |
| 61 | +} |
0 commit comments