Loading...
Searching...
No Matches
test.h File Reference
`#include <stdint.h>`
`#include <stdio.h>`

Go to the source code of this file.

## Macros

#define | ARC_TEST_START_MESSAGE(MESSAGE)
#define | ARC_TEST_END_MESSAGE(MESSAGE)
#define | ARC_TEST(MESSAGE)
#define | ARC_CHECK(TEST)

## Functions

void | ARC_Test_SetErrnoStream (void) __attribute__((constructor))
void | ARC_Test_UnsetErrnoStream (void) __attribute__((destructor))

## Variables

uint32_t * | temp_arc_test_num_checks_run__ARC_TEST__
uint32_t * | temp_arc_test_num_checks_passed__ARC_TEST__

## Macro Definition Documentation

## ARC_CHECK

#define ARC_CHECK | ( |  | TEST | ) |

Value:
if(temp_arc_test_num_checks_run__ARC_TEST__ == NULL || temp_arc_test_num_checks_passed__ARC_TEST__ == NULL){ return; }\
printf(" %4u) ", *temp_arc_test_num_checks_run__ARC_TEST__);\
++*temp_arc_test_num_checks_run__ARC_TEST__;\
if(TEST){ printf("PASS\t\n"); ++*temp_arc_test_num_checks_passed__ARC_TEST__; }\
else { printf("FAIL\t%s\n", #TEST); }
temp_arc_test_num_checks_run__ARC_TEST__
uint32_t * temp_arc_test_num_checks_run__ARC_TEST__
Definition test.c:7
temp_arc_test_num_checks_passed__ARC_TEST__
uint32_t * temp_arc_test_num_checks_passed__ARC_TEST__
Definition test.c:8

Definition at line 33 of file test.h.

#define ARC_CHECK(TEST)\
if(temp_arc_test_num_checks_run__ARC_TEST__ == NULL || temp_arc_test_num_checks_passed__ARC_TEST__ == NULL){ return; }\
printf(" %4u) ", *temp_arc_test_num_checks_run__ARC_TEST__);\
++*temp_arc_test_num_checks_run__ARC_TEST__;\
if(TEST){ printf("PASS\t\n"); ++*temp_arc_test_num_checks_passed__ARC_TEST__; }\
else { printf("FAIL\t%s\n", #TEST); }

Referenced by ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), ARC_TEST(), and ARC_TEST().

## ARC_TEST

#define ARC_TEST | ( |  | MESSAGE | ) |

Value:
ARC_TEST_START_MESSAGE(MESSAGE) ARC_TEST_END_MESSAGE(MESSAGE) void ARC_TEST__ ## MESSAGE(void) __attribute__ ((constructor)); void ARC_TEST__ ## MESSAGE (void)
ARC_TEST_START_MESSAGE
#define ARC_TEST_START_MESSAGE(MESSAGE)
Definition test.h:17
ARC_TEST_END_MESSAGE
#define ARC_TEST_END_MESSAGE(MESSAGE)
Definition test.h:26

Definition at line 31 of file test.h.

## ARC_TEST_END_MESSAGE

#define ARC_TEST_END_MESSAGE | ( |  | MESSAGE | ) |

Value:
void ARC_TEST_END_MESSAGE__ ## MESSAGE(void) __attribute__ ((destructor));\
void ARC_TEST_END_MESSAGE__ ## MESSAGE(void){\
printf("[ARC TEST] RUN: %4u, PASSED: %4u, FAILED: %4u, Completed: %s\n", arc_test_num_checks_run__ARC_TEST__ ## MESSAGE, arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE, arc_test_num_checks_run__ARC_TEST__ ## MESSAGE - arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE, #MESSAGE);\
}

Definition at line 26 of file test.h.

#define ARC_TEST_END_MESSAGE(MESSAGE) void ARC_TEST_END_MESSAGE__ ## MESSAGE(void) __attribute__ ((destructor));\
void ARC_TEST_END_MESSAGE__ ## MESSAGE(void){\
printf("[ARC TEST] RUN: %4u, PASSED: %4u, FAILED: %4u, Completed: %s\n", arc_test_num_checks_run__ARC_TEST__ ## MESSAGE, arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE, arc_test_num_checks_run__ARC_TEST__ ## MESSAGE - arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE, #MESSAGE);\
}

## ARC_TEST_START_MESSAGE

#define ARC_TEST_START_MESSAGE | ( |  | MESSAGE | ) |

Value:
void ARC_TEST_START_MESSAGE__ ## MESSAGE(void) __attribute__ ((constructor));\
uint32_t arc_test_num_checks_run__ARC_TEST__ ## MESSAGE = 0;\
uint32_t arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE = 0;\
void ARC_TEST_START_MESSAGE__ ## MESSAGE(void){\
printf("[ARC TEST] Running: %s\n", #MESSAGE);\
temp_arc_test_num_checks_run__ARC_TEST__ = &arc_test_num_checks_run__ARC_TEST__ ## MESSAGE; \
temp_arc_test_num_checks_passed__ARC_TEST__ = &arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE; \
}

Definition at line 17 of file test.h.

#define ARC_TEST_START_MESSAGE(MESSAGE) void ARC_TEST_START_MESSAGE__ ## MESSAGE(void) __attribute__ ((constructor));\
uint32_t arc_test_num_checks_run__ARC_TEST__ ## MESSAGE = 0;\
uint32_t arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE = 0;\
void ARC_TEST_START_MESSAGE__ ## MESSAGE(void){\
printf("[ARC TEST] Running: %s\n", #MESSAGE);\
temp_arc_test_num_checks_run__ARC_TEST__ = &arc_test_num_checks_run__ARC_TEST__ ## MESSAGE; \
temp_arc_test_num_checks_passed__ARC_TEST__ = &arc_test_num_checks_passed__ARC_TEST__ ## MESSAGE; \
}

## Function Documentation

## ARC_Test_SetErrnoStream()

void ARC_Test_SetErrnoStream | ( | void |  | ) | const

Definition at line 10 of file test.c.

{
arc_errno_log_file = fopen("tests/test_error_out.txt", "w");
}

## ARC_Test_UnsetErrnoStream()

void ARC_Test_UnsetErrnoStream | ( | void |  | ) |

Definition at line 14 of file test.c.

{
fclose(arc_errno_log_file);
}

## Variable Documentation

## temp_arc_test_num_checks_passed__ARC_TEST__

uint32_t* temp_arc_test_num_checks_passed__ARC_TEST__

extern

Definition at line 8 of file test.c.

## temp_arc_test_num_checks_run__ARC_TEST__

uint32_t* temp_arc_test_num_checks_run__ARC_TEST__

extern

Definition at line 7 of file test.c.