Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
76230d3
Update testing.c
dreamer-coding Apr 7, 2025
c2c2fae
Update internal.h
dreamer-coding Apr 7, 2025
6e25ad2
Update testing.c
dreamer-coding Apr 7, 2025
0ebcce4
Update README.md
dreamer-coding Apr 7, 2025
b849342
Update testing.c
dreamer-coding Apr 7, 2025
7b57865
Update README.md
dreamer-coding Apr 7, 2025
6ee0a55
Update internal.h
dreamer-coding Apr 7, 2025
2b108ae
Update testing.c
dreamer-coding Apr 7, 2025
70d2e92
Create internal.c
dreamer-coding Apr 7, 2025
e93154d
Update meson.build
dreamer-coding Apr 7, 2025
65c806d
Update testing.c
dreamer-coding Apr 7, 2025
3e70875
Update internal.h
dreamer-coding Apr 7, 2025
3650911
Update internal.c
dreamer-coding Apr 7, 2025
2811682
Update internal.h
dreamer-coding Apr 7, 2025
f912774
Update testing.c
dreamer-coding Apr 7, 2025
ee4c785
Update internal.c
dreamer-coding Apr 7, 2025
1c54757
Update internal.h
dreamer-coding Apr 7, 2025
ad8df08
Update testing.c
dreamer-coding Apr 7, 2025
98c6225
Update internal.h
dreamer-coding Apr 7, 2025
df7aa46
Update internal.h
dreamer-coding Apr 7, 2025
3675724
Update internal.c
dreamer-coding Apr 7, 2025
f74f91f
Update testing.c
dreamer-coding Apr 7, 2025
6d5e685
Update internal.c
dreamer-coding Apr 7, 2025
0d63f0c
Update internal.c
dreamer-coding Apr 7, 2025
c2fd62a
Update internal.h
dreamer-coding Apr 7, 2025
e34b87e
Update internal.h
dreamer-coding Apr 7, 2025
9d3a2f9
Update internal.h
dreamer-coding Apr 7, 2025
e903797
Update internal.h
dreamer-coding Apr 7, 2025
b5eb7bf
Update internal.c
dreamer-coding Apr 7, 2025
0d2818d
Update internal.h
dreamer-coding Apr 7, 2025
2052cd8
Update internal.c
dreamer-coding Apr 7, 2025
19b28d9
Update testing.c
dreamer-coding Apr 7, 2025
70029af
Update internal.h
dreamer-coding Apr 7, 2025
3d7e32d
Update internal.h
dreamer-coding Apr 7, 2025
36165b8
Update mocking.h
dreamer-coding Apr 7, 2025
68065f8
Update marking.h
dreamer-coding Apr 7, 2025
f62d9b1
Update internal.h
dreamer-coding Apr 7, 2025
8e6a38c
Update internal.c
dreamer-coding Apr 7, 2025
68c621e
Update internal.h
dreamer-coding Apr 7, 2025
3142516
Update internal.h
dreamer-coding Apr 7, 2025
c70ac78
Update internal.c
dreamer-coding Apr 7, 2025
d6f9bad
Update testing.c
dreamer-coding Apr 7, 2025
c381366
Update internal.c
dreamer-coding Apr 7, 2025
938ef66
Update internal.c
dreamer-coding Apr 7, 2025
7bfd115
Update meson_ci.yml
dreamer-coding Apr 7, 2025
6954074
Update marking.c
dreamer-coding Apr 7, 2025
d71951a
Update meson_ci.yml
dreamer-coding Apr 7, 2025
1a7cf66
Create bedrock-wrapper.py
dreamer-coding Apr 7, 2025
102a075
Update arm.txt
dreamer-coding Apr 7, 2025
4b74613
Update arm64.txt
dreamer-coding Apr 7, 2025
d9cf50e
Update mips.txt
dreamer-coding Apr 7, 2025
44d256e
Update mipsel.txt
dreamer-coding Apr 7, 2025
02ad1dc
Update ppc.txt
dreamer-coding Apr 7, 2025
ba2a0fa
Update ppc64le.txt
dreamer-coding Apr 7, 2025
5a1e23e
Update riscv64.txt
dreamer-coding Apr 7, 2025
7e02c4b
Update s390x.txt
dreamer-coding Apr 7, 2025
8ad5c81
Update sparc64.txt
dreamer-coding Apr 7, 2025
7afc3e5
Update meson.build
dreamer-coding Apr 7, 2025
efd27c4
Update meson_ci.yml
dreamer-coding Apr 7, 2025
8fffada
Update arm.txt
dreamer-coding Apr 7, 2025
3738c1d
Update arm64.txt
dreamer-coding Apr 7, 2025
12de73f
Update mips.txt
dreamer-coding Apr 7, 2025
2c753fc
Update mipsel.txt
dreamer-coding Apr 7, 2025
4344897
Update ppc.txt
dreamer-coding Apr 7, 2025
cf3e492
Update ppc64le.txt
dreamer-coding Apr 7, 2025
4e83658
Update riscv64.txt
dreamer-coding Apr 7, 2025
2e02b6d
Update s390x.txt
dreamer-coding Apr 7, 2025
33c2bde
Update sparc64.txt
dreamer-coding Apr 7, 2025
ef1dda2
Delete code/tests/tools/bedrock-wrapper.py
dreamer-coding Apr 7, 2025
aa1dce8
Update meson_ci.yml
dreamer-coding Apr 7, 2025
60e10bf
Update meson.build
dreamer-coding Apr 7, 2025
e4ab873
Update README.md
dreamer-coding Apr 7, 2025
843c5fc
Update testing.c
dreamer-coding Apr 7, 2025
b6dc73d
Update internal.h
dreamer-coding Apr 8, 2025
a352f14
Update testing.c
dreamer-coding Apr 8, 2025
669473f
Update README.md
dreamer-coding Apr 8, 2025
6db7afa
Update README.md
dreamer-coding Apr 8, 2025
614d5b1
Update README.md
dreamer-coding Apr 8, 2025
a5bbe27
Update README.md
dreamer-coding Apr 8, 2025
3d7dca2
Update testing.c
dreamer-coding Apr 11, 2025
bf91e94
Update internal.h
dreamer-coding Apr 11, 2025
139f54f
Update README.md
dreamer-coding Apr 11, 2025
9a63497
Update testing.c
dreamer-coding Apr 11, 2025
ddb89e8
Update internal.h
dreamer-coding Apr 11, 2025
0812ee6
Update internal.c
dreamer-coding Apr 11, 2025
b72ce81
Update internal.h
dreamer-coding Apr 11, 2025
ed2bc5c
Update testing.c
dreamer-coding Apr 11, 2025
7c58e60
Update testing.c
dreamer-coding Apr 11, 2025
3a35994
Update meson_ci.yml
dreamer-coding Apr 11, 2025
bad9491
Update meson.build
dreamer-coding Apr 11, 2025
0344423
Update testing.c
dreamer-coding Apr 11, 2025
2e5649f
Update testing.c
dreamer-coding Apr 11, 2025
26ad53b
Update meson_ci.yml
dreamer-coding Apr 11, 2025
c4b0ad9
Update meson.build
dreamer-coding Apr 11, 2025
e3b91bd
Update testing.c
dreamer-coding Apr 11, 2025
1c17165
Update testing.c
dreamer-coding Apr 11, 2025
48752cb
Update meson_ci.yml
dreamer-coding Apr 11, 2025
66a0cbc
Update meson.build
dreamer-coding Apr 11, 2025
fe1a81b
Update testing.c
dreamer-coding Apr 11, 2025
b2dbc55
Update meson_ci.yml
dreamer-coding Apr 11, 2025
e51404a
Update README.md
dreamer-coding Apr 11, 2025
03da56e
Update testing.c
dreamer-coding Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions .github/workflows/meson_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@ on:
paths:
- "**.c"
- "**.h"
- "**.cpp"
- "**.hpp"
- "**.py"
- "**.build"
- "**.options"
pull_request:
paths:
- "**.c"
- "**.h"
- "**.cpp"
- "**.hpp"
- "**.py"
- "**.build"
- "**.options"
Expand All @@ -26,7 +22,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
msvc_version: [2015, 2017, 2019, 2022]
msvc_version: [2015, 2017, 2019, 2022, 2025]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -51,6 +47,8 @@ jobs:
choco install visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
} elseif ($env:msvc_version -eq "2022") {
choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
} elseif ($env:msvc_version -eq "2025") {
choco install visualstudio2025buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --includeOptional --passive"
}
$env:CC="cl.exe"
$env:CXX="cl.exe"
Expand All @@ -62,7 +60,7 @@ jobs:
run: meson compile -C builddir_msvc_${{ matrix.msvc_version }}

- name: Run Tests
run: meson test -C builddir_msvc_${{ matrix.msvc_version }} -v
run: meson test -C builddir_msvc_${{ matrix.msvc_version }} -v --test-arg='summary ci'

- name: Upload Test Log
if: failure()
Expand Down Expand Up @@ -102,7 +100,7 @@ jobs:
run: meson compile -C builddir

- name: Run Tests
run: meson test -C builddir -v
run: meson test -C builddir -v --test-arg='summary ci'

- name: Upload Test Log
if: failure()
Expand Down Expand Up @@ -149,7 +147,7 @@ jobs:
run: meson compile -C builddir

- name: Run Tests
run: meson test -C builddir -v
run: meson test -C builddir -v --test-arg='summary ci'

- name: Upload Test Log
if: failure()
Expand Down Expand Up @@ -200,7 +198,7 @@ jobs:
run: meson compile -C builddir

- name: Run Tests
run: meson test -C builddir -v
run: meson test -C builddir -v --test-arg='summary ci'

- name: Upload Test Log
if: failure()
Expand Down Expand Up @@ -250,7 +248,7 @@ jobs:
sudo apt update
meson setup builddir --fatal-meson-warnings -Dwerror=true -Dwith_test=enabled -Dwarning_level=3
meson compile -C builddir
meson test -C builddir -v"
meson test -C builddir -v --test-arg='summary ci'"

build_cross:
name: Building on Bedrock ${{ matrix.architecture }}
Expand Down Expand Up @@ -344,4 +342,9 @@ jobs:

- name: Build the Project
run: |
meson compile -C builddir
meson compile -C builddir -v

- name: Test the Project
run: |
meson test -C builddir -v --test-arg='summary ci'

89 changes: 10 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ To get started with Fossil Test, ensure you have the following installed:
# ======================
[wrap-git]
url = https://github.com/fossillogic/fossil-test.git
revision = v1.1.8
revision = v1.2.0

[provide]
fossil-test = fossil_test_dep
Expand All @@ -79,87 +79,18 @@ The Fossil Test CLI provides an efficient way to run and manage tests directly f

### Commands and Options

| Command | Description | Notes |
| Command | Description | Notes |
|----------------------------------|-----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| `--version` | Displays the current version of Fossil Test. | Useful for verifying the version of the tool in use. |
| `--help` | Shows help message with usage instructions. | Provides a quick reference for all available commands. |
| `--info` | Displays detailed information about the test run. | Includes information such as test count, duration, and configuration. |
| `reverse [enable/disable]` | Enables or disables reverse order of test execution. | Useful for debugging or ensuring the tests don't depend on execution order. |
| `shuffle [enable/disable]` | Enables or disables shuffling of test execution order. | Helps identify order-dependent issues in the test suite. |
| `dry-run [enable/disable]` | Enables or disables dry run mode, showing which tests will execute without running them. | Ideal for verifying test selection criteria before actual execution. |
| `repeat=<number>` | Repeats the test suite a specified number of times. | Handy for stress-testing or reproducing intermittent failures. |

### Key Notes Summary:
- **Version**: Quickly check the installed version of Fossil Test.
- **Help**: Access usage instructions and command references.
- **Info**: Get detailed insights about the test run, including test count and duration.
- **Reverse and Shuffle**: Help debug issues by manipulating test execution order.
- **Repeat**: Ideal for reliability testing by repeatedly executing tests.
- **Dry Run**: Provides a preview of the test plan without running the tests, useful for preparation and validation.

### Usage

To use the Fossil Test CLI, navigate to your project directory and run the desired command. For example, to check the version of Fossil Test, use:

```sh
fossil-test --version
```

To display help information, use:

```sh
fossil-test --help
```

For detailed information about the test run, use:

```sh
fossil-test --info
```

To enable reverse order of test execution, use:

```sh
fossil-test reverse enable
```

To disable reverse order of test execution, use:

```sh
fossil-test reverse disable
```

To enable shuffling of test execution order, use:

```sh
fossil-test shuffle enable
```

To disable shuffling of test execution order, use:

```sh
fossil-test shuffle disable
```

To perform a dry run, use:

```sh
fossil-test dry-run enable
```

To disable dry run mode, use:

```sh
fossil-test dry-run disable
```

To repeat the test suite a specified number of times, use:

```sh
fossil-test repeat=<number>
```

---
| `--info` | Displays detailed information about the test run. | Includes information such as test count, duration, and configuration. |
| `reverse [enable/disable]` | Enables or disables reverse order of test execution. | Useful for debugging or ensuring the tests don't depend on execution order. |
| `shuffle [enable/disable]` | Enables or disables shuffling of test execution order. | Helps identify order-dependent issues in the test suite. |
| `dry-run [enable/disable]` | Enables or disables dry run mode, showing which tests will execute without running them. | Ideal for verifying test selection criteria before actual execution. |
| `repeat <number>` | Repeats the test suite a specified number of times. | Handy for stress-testing or reproducing intermittent failures. |
| `color [enable/disable]` | Enables or disables colored output. | Enhances readability in supported terminals. |
| `format <plain, ci, jellyfish>` | Selects the output format for test results. | Affects how test data is displayed; useful for visual or machine-parsed output. |
| `summary <plain, ci, jellyfish>` | Sets the level of summary output after test execution. | `ci` is minimal, `jellyfish` is smart test mode, and `plain` is default classic. |

## Configure Build Options

Expand Down
104 changes: 85 additions & 19 deletions code/logic/fossil/test/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,51 @@

#define MAX_NAME_LENGTH 256

// Color codes
#define FOSSIL_TEST_COLOR_RESET "\033[0m" // Reset
#define FOSSIL_TEST_COLOR_GREEN "\033[32m" // Green
#define FOSSIL_TEST_COLOR_RED "\033[31m" // Red
#define FOSSIL_TEST_COLOR_YELLOW "\033[33m" // Yellow
#define FOSSIL_TEST_COLOR_BLUE "\033[34m" // Blue
#define FOSSIL_TEST_COLOR_MAGENTA "\033[35m" // Magenta
#define FOSSIL_TEST_COLOR_CYAN "\033[36m" // Cyan
#define FOSSIL_TEST_COLOR_WHITE "\033[97m" // White
#define FOSSIL_TEST_COLOR_PURPLE "\033[35m" // Purple
#define FOSSIL_TEST_COLOR_ORANGE "\033[38;5;208m" // Orange

#define FOSSIL_TEST_ATTR_BOLD "\033[1m" // Bold
#define FOSSIL_TEST_ATTR_DIM "\033[2m" // Dim
#define FOSSIL_TEST_ATTR_UNDERLINE "\033[4m" // Underline
#define FOSSIL_TEST_ATTR_ITALIC "\033[3m" // Italic
#define FOSSIL_TEST_ATTR_REVERSE "\033[7m" // Reverse
#define FOSSIL_TEST_ATTR_STRIKETHROUGH "\033[9m" // Strikethrough

#include <setjmp.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>
#include <float.h>

// Define color codes for output
#define FOSSIL_TEST_COLOR_RESET "\033[0m"
#define FOSSIL_TEST_COLOR_RED "\033[31m"
#define FOSSIL_TEST_COLOR_GREEN "\033[32m"
#define FOSSIL_TEST_COLOR_YELLOW "\033[33m"
#define FOSSIL_TEST_COLOR_BLUE "\033[34m"
#define FOSSIL_TEST_COLOR_MAGENTA "\033[35m"
#define FOSSIL_TEST_COLOR_CYAN "\033[36m"
#define FOSSIL_TEST_COLOR_WHITE "\033[37m"

// Define text attributes
#define FOSSIL_TEST_ATTR_BOLD "\033[1m"
#define FOSSIL_TEST_ATTR_UNDERLINE "\033[4m"
#define FOSSIL_TEST_ATTR_REVERSED "\033[7m"
#define FOSSIL_TEST_ATTR_BLINK "\033[5m"
#define FOSSIL_TEST_ATTR_HIDDEN "\033[8m"
#define FOSSIL_TEST_ATTR_NORMAL "\033[22m"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
FOSSIL_TEST_FORMAT_PLAIN,
FOSSIL_TEST_FORMAT_CI,
FOSSIL_TEST_FORMAT_JELLYFISH
} fossil_test_format_t;

typedef enum {
FOSSIL_TEST_SUMMARY_PLAIN,
FOSSIL_TEST_SUMMARY_CI,
FOSSIL_TEST_SUMMARY_JELLYFISH
} fossil_test_summary_t;

/**
* @struct fossil_test_options_t
* @brief Structure to hold various options for fossil testing.
Expand Down Expand Up @@ -79,6 +92,14 @@ extern "C" {
* @var fossil_test_options_t::dry_run
* Flag to indicate if the tests should be run in dry-run mode (no actual execution).
*
* @var fossil_test_options_t::fail_fast
* Flag to enable fail-fast behavior, stopping test execution after the first failure.
*
* @var fossil_test_options_t::quiet
* Flag to suppress most non-essential output for minimal console logging.
*
* @var fossil_test_options_t::color_output
* Flag to enable or disable colorized output in the console.
*/
typedef struct {
bool show_version;
Expand All @@ -89,8 +110,53 @@ typedef struct {
int32_t repeat_count;
bool shuffle_enabled;
bool dry_run;
bool color_output;
fossil_test_summary_t summary; // Replaces 'quiet'
fossil_test_format_t format; // Store the format type
} fossil_test_options_t;

/**
* Prints a string to the output.
*
* @param str The string to be printed.
*/
void internal_test_puts(const char *str);

/**
* Prints a formatted string to the output.
*
* @param format The format string.
* @param ... The additional arguments to be formatted.
*/
void internal_test_printf(const char *format, ...);

/**
* Prints a string to the output with a specified color.
*
* @param color The color code to be applied.
* @param format The format string.
* @param ... The additional arguments to be formatted.
*/
void internal_test_print_color(const char *color, const char *format, ...);

/**
* Prints a character to the output.
*
* @param c The character to be printed.
*/
void internal_test_putchar(char c);

/**
* Prints a character to the output with a specified color.
*
* @param c The character to be printed.
* @param color The color code to be applied.
*/
void internal_test_putchar_color(char c, const char *color);

// Set global color output flag
void internal_test_set_color_output(bool enabled);

#ifdef __cplusplus
}
#endif
Expand Down
5 changes: 1 addition & 4 deletions code/logic/fossil/test/marking.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
#ifndef FOSSIL_MARK_BENCHMARK_H
#define FOSSIL_MARK_BENCHMARK_H

#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <float.h>
#include "internal.h"

#ifdef __cplusplus
extern "C" {
Expand Down
6 changes: 1 addition & 5 deletions code/logic/fossil/test/mocking.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
#ifndef FOSSIL_MOCK_MOCKUP_H
#define FOSSIL_MOCK_MOCKUP_H

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include "internal.h"

#ifdef __cplusplus
extern "C" {
Expand Down
Loading
Loading