Skip to content

Commit bdb10dc

Browse files
last patch
1 parent 549ffdb commit bdb10dc

File tree

2 files changed

+17
-45
lines changed

2 files changed

+17
-45
lines changed

README.md

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# ***Fossil Test: Unit Testing/Mocking Framework*** - `C, C++`
1+
# ***Fossil Test by Fossil Logic***
22

3-
**Overview:**
4-
Fossil Test is a robust unit testing and mocking framework developed by Fossil Logic. It is designed to facilitate the creation of high-quality test cases for C and C++ projects, promoting software reliability and correctness. The framework supports various development methodologies, including Behavior-Driven Development (BDD), Domain-Driven Design (DDD), and Test-Driven Development (TDD), offering flexibility for diverse development workflows.
3+
**Fossil Test** is a comprehensive unit testing, mocking, and benchmarking suite created by Fossil Logic, designed to ensure the reliability and performance of C and C++ projects. With support for multiple development methodologies, including Behavior-Driven Development (BDD), Domain-Driven Design (DDD), and Test-Driven Development (TDD), Fossil Test provides a versatile foundation for crafting high-quality test cases across various workflows.
54

6-
In addition to Fossil Test, Fossil Logic also offers two additional frameworks to enhance your development experience:
7-
- **Fossil Mark**: A powerful benchmarking tool that allows developers to measure code performance, identify bottlenecks, and optimize execution time. It offers detailed timing information and reporting.
8-
- **Fossil Mock**: A mocking library enabling developers to simulate the behavior of complex dependencies. By using mock objects, you can write focused unit tests that test isolated components, enhancing test reliability and coverage.
5+
The Fossil suite consists of three complementary frameworks to streamline the development and testing process:
96

10-
Together, Fossil Test, Fossil Mark, and Fossil Mock provide a comprehensive toolkit for developing, testing, and optimizing high-quality software.
7+
- **Fossil Test**: The core unit testing framework that enables developers to create, manage, and execute unit tests effectively, ensuring each component functions as expected.
8+
- **Fossil Mock**: A dedicated mocking library that simulates complex dependencies. Using mock objects, developers can isolate and thoroughly test individual components, improving the precision and reliability of test coverage.
9+
- **Fossil Mark**: A benchmarking tool that provides detailed performance insights by measuring execution time, identifying bottlenecks, and offering in-depth reporting to optimize code efficiency.
10+
11+
Together, **Fossil Test**, **Fossil Mock**, and **Fossil Mark** offer a powerful, integrated toolkit for developing, testing, and optimizing robust software, making them an essential asset for developers committed to quality and performance.
1112

1213
---
1314

@@ -18,12 +19,8 @@ Together, Fossil Test, Fossil Mark, and Fossil Mock provide a comprehensive tool
1819
| **BDD, DDD, and TDD Support** | Supports Behavior-Driven, Domain-Driven, and Test-Driven Development styles, catering to various project methodologies. |
1920
| **Comprehensive Unit Testing** | A full suite of tools for creating, managing, and executing unit tests, ensuring that individual units of code behave as expected. |
2021
| **Mocking Capabilities** | Powerful mocking features allow developers to simulate complex dependencies, ensuring focused and reliable unit tests. |
21-
| **Test Case Management** | Organize and manage test cases with features for categorization, prioritization, and tagging, improving test suite maintainability. |
22-
| **Detailed Reporting** | Generates comprehensive reports on test execution, including information on passed, failed, skipped, and timed-out tests, aiding quick issue resolution. |
2322
| **Performance Tracking** | Measures and reports the performance of each test case, helping developers optimize test execution time and performance. |
24-
| **Assertion Detection** | Ensures that assertions are properly used in code, enforcing critical conditions and identifying potential areas lacking validation. |
2523
| **Command-Line Interface (CLI)** | A powerful CLI for running tests, generating reports, and managing the test suite, supporting automation and integration workflows. |
26-
| **Extensible and Configurable** | Highly extensible, allowing developers to customize the framework to their needs, from reporting formats to tool integration. |
2724

2825
---
2926

@@ -59,8 +56,6 @@ To integrate Fossil Test into your project, follow these steps:
5956

6057
[provide]
6158
fossil-test = fossil_test_dep
62-
fossil-mock = fossil_mock_dep
63-
fossil-mark = fossil_mark_dep
6459
```
6560

6661
3. **Integrate the Dependency**:
@@ -81,20 +76,12 @@ The Fossil Test CLI provides an efficient way to run and manage tests directly f
8176

8277
| Command | Description |
8378
|----------------------------------|-----------------------------------------------------------------------------------------------|
84-
| `--version` | Displays the current version of the Fossil Test CLI. |
79+
| `--version` | Displays the current version of Fossil Test. |
8580
| `--help` | Shows help message with usage instructions. |
86-
| `--tip` | Displays a tip or hint related to the CLI usage. |
87-
| `--info` | Displays detailed information about the test runner configuration. |
88-
| `--author` | Shows information about the author of the test runner. |
89-
| `only=<tag>` or `only=<tags>` | Runs only tests tagged with the specified tag(s). Tags can be comma-separated for multiple tags. |
81+
| `--info` | Displays detailed information about the test run. |
9082
| `reverse [enable/disable]` | Enables or disables reverse order of test execution. |
9183
| `repeat=<number>` | Repeats the test suite a specified number of times. |
9284
| `shuffle [enable/disable]` | Enables or disables shuffling of test execution order. |
93-
| `verbose [cutback/normal/verbose]` | Sets verbosity level of the output. Options are `cutback`, `normal`, and `verbose`. |
94-
| `list` | Lists all available tests. |
95-
| `summary [enable/disable]` | Enables or disables a summary of test results after execution. |
96-
| `color [enable/disable]` | Enables or disables colored output in the terminal. |
97-
| `sanity [enable/disable]` | Enables or disables sanity checks before running tests. |
9885

9986
### Example Usage
10087

@@ -103,11 +90,6 @@ The Fossil Test CLI provides an efficient way to run and manage tests directly f
10390
fossil_cli --version
10491
```
10592

106-
- Run tests tagged with `unit` and `integration`:
107-
```sh
108-
fossil_cli only=unit,integration
109-
```
110-
11193
- Enable reverse order of test execution:
11294
```sh
11395
fossil_cli reverse enable
@@ -118,16 +100,6 @@ The Fossil Test CLI provides an efficient way to run and manage tests directly f
118100
fossil_cli repeat=5
119101
```
120102

121-
- Show a summary after execution:
122-
```sh
123-
fossil_cli summary enable
124-
```
125-
126-
- Enable colored output:
127-
```sh
128-
fossil_cli color enable
129-
```
130-
131103
---
132104

133105
## Configure Build Options

code/logic/unittest.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ fossil_options_t init_options(void) {
127127
void usage_info(void) {
128128
printf("Usage: fossil [options] [command]\n");
129129
printf("Options:\n");
130-
printf(" --version\t\tShow version information\n");
131-
printf(" --help\t\tShow help information\n");
132-
printf(" --info\t\tShow additional information\n");
130+
printf(" --version\t\tDisplays the current version of Fossil Test\n");
131+
printf(" --help\t\tShows help message with usage\n");
132+
printf(" --info\t\tDisplays detailed information about the test run.\n");
133133
printf("Commands:\n");
134-
printf(" reverse [enable|disable]\tEnable or disable reverse order of test cases\n");
135-
printf(" repeat [count]\t\tEnable repeat mode with optional count\n");
136-
printf(" shuffle [enable|disable]\tEnable or disable shuffle mode\n");
134+
printf(" reverse [enable|disable]\tEnables or disables reverse order of test execution\n");
135+
printf(" repeat [count]\t\tRepeats the test suite a specified number of times\n");
136+
printf(" shuffle [enable|disable]\tEnables or disables shuffling of test execution order\n");
137137
}
138138

139139
void version_info(void) {
@@ -493,7 +493,7 @@ void fossil_test_summary(fossil_test_env_t *env) {
493493

494494
// Optionally, you could add the total execution time summary here
495495
printf(COLOR_INFO "====================================\n" COLOR_RESET);
496-
printf(COLOR_INFO "Total execution time: %.3f seconds\n" COLOR_RESET, total_time / CLOCKS_PER_SEC);
496+
printf(COLOR_INFO "Total execution time: %.3f seconds\n" COLOR_RESET, (env->total_execution_time - total_time) / CLOCKS_PER_SEC);
497497
printf(COLOR_INFO "====================================\n" COLOR_RESET);
498498

499499
fossil_test_message(env);

0 commit comments

Comments
 (0)