Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9efd75d
add internal header
dreamer-coding Apr 6, 2025
b507b9f
move some parts over
dreamer-coding Apr 6, 2025
8580531
update summary
dreamer-coding Apr 6, 2025
a2aadc0
added no assert count
dreamer-coding Apr 6, 2025
046cdac
added new commentary function
dreamer-coding Apr 6, 2025
296b1b3
Update testing.c
dreamer-coding Apr 6, 2025
a1c407e
Update testing.c
dreamer-coding Apr 6, 2025
40a831b
Update testing.c
dreamer-coding Apr 6, 2025
960bbfc
Update testing.c
dreamer-coding Apr 6, 2025
0e2cdbe
Update testing.c
dreamer-coding Apr 6, 2025
9a6fa84
Update testing.c
dreamer-coding Apr 6, 2025
b2aa35a
Update testing.c
dreamer-coding Apr 6, 2025
bd1c4c5
Update testing.c
dreamer-coding Apr 6, 2025
96a14c3
Update testing.c
dreamer-coding Apr 6, 2025
dafed6b
Update testing.c
dreamer-coding Apr 6, 2025
ae7dede
Update testing.c
dreamer-coding Apr 6, 2025
72cb474
Update testing.c
dreamer-coding Apr 6, 2025
9a2db85
Update testing.c
dreamer-coding Apr 6, 2025
fd94a9a
Update testing.c
dreamer-coding Apr 6, 2025
dbd25cd
Update testing.c
dreamer-coding Apr 6, 2025
d044e9b
Update testing.c
dreamer-coding Apr 6, 2025
7a8ff35
Update testing.c
dreamer-coding Apr 6, 2025
e70822b
Update testing.c
dreamer-coding Apr 6, 2025
d013166
Update testing.c
dreamer-coding Apr 6, 2025
70a0313
Update testing.c
dreamer-coding Apr 6, 2025
c862809
Update testing.c
dreamer-coding Apr 6, 2025
97f269d
Update testing.c
dreamer-coding Apr 6, 2025
4ceba01
Update testing.c
dreamer-coding Apr 6, 2025
0343902
Update testing.h
dreamer-coding Apr 6, 2025
afc7bdb
Update testing.c
dreamer-coding Apr 6, 2025
9509038
Update testing.c
dreamer-coding Apr 6, 2025
c67cb13
Update testing.h
dreamer-coding Apr 6, 2025
336bfe4
Update testing.c
dreamer-coding Apr 6, 2025
a721694
Update testing.h
dreamer-coding Apr 6, 2025
fd20090
Update testing.c
dreamer-coding Apr 7, 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
98 changes: 98 additions & 0 deletions code/logic/fossil/test/internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/*
* -----------------------------------------------------------------------------
* Project: Fossil Logic
*
* This file is part of the Fossil Logic project, which aims to develop high-
* performance, cross-platform applications and libraries. The code contained
* herein is subject to the terms and conditions defined in the project license.
*
* Author: Michael Gene Brockus (Dreamer)
* Date: 07/01/2024
*
* Copyright (C) 2024 Fossil Logic. All rights reserved.
* -----------------------------------------------------------------------------
*/
#ifndef FOSSIL_TEST_CORE_H
#define FOSSIL_TEST_CORE_H

#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 <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @struct fossil_test_options_t
* @brief Structure to hold various options for fossil testing.
*
* This structure contains various flags and parameters that control the behavior of the fossil testing framework.
*
* @var fossil_test_options_t::show_version
* Flag to indicate if the version information should be displayed.
*
* @var fossil_test_options_t::show_help
* Flag to indicate if the help information should be displayed.
*
* @var fossil_test_options_t::show_info
* Flag to indicate if additional information should be displayed.
*
* @var fossil_test_options_t::reverse
* Flag to indicate if the order of tests should be reversed.
*
* @var fossil_test_options_t::repeat_enabled
* Flag to indicate if test repetition is enabled.
*
* @var fossil_test_options_t::repeat_count
* Number of times to repeat the tests if repetition is enabled.
*
* @var fossil_test_options_t::shuffle_enabled
* Flag to indicate if the tests should be shuffled.
*
* @var fossil_test_options_t::dry_run
* Flag to indicate if the tests should be run in dry-run mode (no actual execution).
*
*/
typedef struct {
bool show_version;
bool show_help;
bool show_info;
bool reverse;
bool repeat_enabled;
int32_t repeat_count;
bool shuffle_enabled;
bool dry_run;
} fossil_test_options_t;

#ifdef __cplusplus
}
#endif

#endif // FOSSIL_TEST_CORE_H
80 changes: 5 additions & 75 deletions code/logic/fossil/test/testing.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,84 +12,15 @@
* Copyright (C) 2024 Fossil Logic. All rights reserved.
* -----------------------------------------------------------------------------
*/
#ifndef FOSSIL_TEST_CORE_H
#define FOSSIL_TEST_CORE_H

#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


#include <setjmp.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <time.h>
#ifndef FOSSIL_TEST_INTERNAL_H
#define FOSSIL_TEST_INTERNAL_H

#include "internal.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
* @struct fossil_test_options_t
* @brief Structure to hold various options for fossil testing.
*
* This structure contains various flags and parameters that control the behavior of the fossil testing framework.
*
* @var fossil_test_options_t::show_version
* Flag to indicate if the version information should be displayed.
*
* @var fossil_test_options_t::show_help
* Flag to indicate if the help information should be displayed.
*
* @var fossil_test_options_t::show_info
* Flag to indicate if additional information should be displayed.
*
* @var fossil_test_options_t::reverse
* Flag to indicate if the order of tests should be reversed.
*
* @var fossil_test_options_t::repeat_enabled
* Flag to indicate if test repetition is enabled.
*
* @var fossil_test_options_t::repeat_count
* Number of times to repeat the tests if repetition is enabled.
*
* @var fossil_test_options_t::shuffle_enabled
* Flag to indicate if the tests should be shuffled.
*
* @var fossil_test_options_t::dry_run
* Flag to indicate if the tests should be run in dry-run mode (no actual execution).
*
*/
typedef struct {
bool show_version;
bool show_help;
bool show_info;
bool reverse;
bool repeat_enabled;
int32_t repeat_count;
bool shuffle_enabled;
bool dry_run;
} fossil_test_options_t;

/**
* @enum test_status
* @brief Enumeration to represent the status of a test.
Expand Down Expand Up @@ -364,8 +295,7 @@ void fossil_test_run_all(fossil_test_env_t *env);
*/
#define _FOSSIL_TEST_SKIP(test_name, message) \
test_name##_test_case.status = TEST_STATUS_SKIP; \
test_name##_test_case.failure_message = message; \
printf(FOSSIL_TEST_COLOR_YELLOW "SKIPPED: %s - %s\n" FOSSIL_TEST_COLOR_RESET, #test_name, message); \
test_name##_test_case.failure_message = message;

/**
* @brief Macro to define a test case.
Expand Down
Loading
Loading