Skip to content

Commit a1a3ee8

Browse files
place mark cases
1 parent 9e1f116 commit a1a3ee8

File tree

3 files changed

+153
-1
lines changed

3 files changed

+153
-1
lines changed

code/tests/cases/test_mark.c

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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(c_mark_suite);
27+
28+
// Setup function for the test suite
29+
FOSSIL_SETUP(c_mark_suite) {
30+
// Setup code here
31+
}
32+
33+
// Teardown function for the test suite
34+
FOSSIL_TEARDOWN(c_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 initialization works correctly
47+
FOSSIL_TEST_CASE(c_mark_initialization) {
48+
MARK_BENCHMARK(init_test);
49+
FOSSIL_TEST_ASSUME(benchmark_init_test.name != NULL, "Benchmark initialization failed");
50+
}
51+
52+
// A test case to check if the benchmark start works correctly
53+
FOSSIL_TEST_CASE(c_mark_start) {
54+
MARK_BENCHMARK(start_test);
55+
MARK_START(start_test);
56+
FOSSIL_TEST_ASSUME(benchmark_start_test.start_time != 0, "Benchmark start failed");
57+
}
58+
59+
// A test case to check if the benchmark stop works correctly
60+
FOSSIL_TEST_CASE(c_mark_stop) {
61+
MARK_BENCHMARK(stop_test);
62+
MARK_START(stop_test);
63+
MARK_STOP(stop_test);
64+
FOSSIL_TEST_ASSUME(benchmark_stop_test.end_time != 0, "Benchmark stop failed");
65+
}
66+
67+
// * * * * * * * * * * * * * * * * * * * * * * * *
68+
// * Fossil Logic Test Pool
69+
// * * * * * * * * * * * * * * * * * * * * * * * *
70+
FOSSIL_TEST_GROUP(c_mark_test_cases) {
71+
FOSSIL_TEST_ADD(c_mark_suite, c_mark_initialization);
72+
FOSSIL_TEST_ADD(c_mark_suite, c_mark_start);
73+
FOSSIL_TEST_ADD(c_mark_suite, c_mark_stop);
74+
75+
FOSSIL_TEST_REGISTER(c_mark_suite);
76+
}

code/tests/cases/test_mark.cpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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 initialization works correctly
47+
FOSSIL_TEST_CASE(cpp_mark_initialization) {
48+
MARK_BENCHMARK(init_test);
49+
FOSSIL_TEST_ASSUME(benchmark_init_test.name != NULL, "Benchmark initialization failed");
50+
}
51+
52+
// A test case to check if the benchmark start works correctly
53+
FOSSIL_TEST_CASE(cpp_mark_start) {
54+
MARK_BENCHMARK(start_test);
55+
MARK_START(start_test);
56+
FOSSIL_TEST_ASSUME(benchmark_start_test.start_time != 0, "Benchmark start failed");
57+
}
58+
59+
// A test case to check if the benchmark stop works correctly
60+
FOSSIL_TEST_CASE(cpp_mark_stop) {
61+
MARK_BENCHMARK(stop_test);
62+
MARK_START(stop_test);
63+
MARK_STOP(stop_test);
64+
FOSSIL_TEST_ASSUME(benchmark_stop_test.end_time != 0, "Benchmark stop failed");
65+
}
66+
67+
// * * * * * * * * * * * * * * * * * * * * * * * *
68+
// * Fossil Logic Test Pool
69+
// * * * * * * * * * * * * * * * * * * * * * * * *
70+
FOSSIL_TEST_GROUP(cpp_mark_test_cases) {
71+
FOSSIL_TEST_ADD(cpp_mark_suite, cpp_mark_initialization);
72+
FOSSIL_TEST_ADD(cpp_mark_suite, cpp_mark_start);
73+
FOSSIL_TEST_ADD(cpp_mark_suite, cpp_mark_stop);
74+
75+
FOSSIL_TEST_REGISTER(cpp_mark_suite);
76+
}

code/tests/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if get_option('with_test').enabled()
44
test_c = ['unit_runner.c']
55
test_cpp = ['unit_runner.cpp']
66
test_cases = [
7-
'sample', 'bdd', 'tdd', 'ddd',
7+
'sample', 'bdd', 'tdd', 'ddd', 'mark'
88
]
99

1010
foreach cases : test_cases

0 commit comments

Comments
 (0)