libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
Functions | Variables
unit_testing.c File Reference
#include <stdio.h>
#include <libgen.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stdbool.h>
#include "unit_testing.h"
#include "util/abort.h"

Go to the source code of this file.

Functions

void _PS_BEGIN_UNIT_TESTS (STR file)
 
void PS_END_UNIT_TESTS (void)
 End unit tests.
 
void _PS_UNIT_ASSERT (int result, STR expr, STR func, u64 line, STR msg,...)
 
void _PS_UNIT_SUPPRESS (STR msg, STR func, u64 line)
 
void PS_UNIT_UNSUPPRESS (void)
 Unsuppress unit test output.
 

Variables

STR _ps_this_file
 
bool is_surpressed = false
 
bool surpressed_gave_error = false
 

Function Documentation

◆ _PS_BEGIN_UNIT_TESTS()

void _PS_BEGIN_UNIT_TESTS ( STR  file)

Definition at line 32 of file unit_testing.c.

◆ _PS_UNIT_ASSERT()

void _PS_UNIT_ASSERT ( int  result,
STR  expr,
STR  func,
u64  line,
STR  msg,
  ... 
)

Definition at line 70 of file unit_testing.c.

◆ _PS_UNIT_SUPPRESS()

void _PS_UNIT_SUPPRESS ( STR  msg,
STR  func,
u64  line 
)

Definition at line 109 of file unit_testing.c.

◆ PS_END_UNIT_TESTS()

void PS_END_UNIT_TESTS ( void  )

End unit tests.

Do not call this function directly. Instead, PS_BEGIN_UNIT_TESTS will call this function for you.

Definition at line 56 of file unit_testing.c.

◆ PS_UNIT_UNSUPPRESS()

void PS_UNIT_UNSUPPRESS ( void  )

Unsuppress unit test output.

See also
PS_UNIT_SUPPRESS

Definition at line 119 of file unit_testing.c.

Variable Documentation

◆ _ps_this_file

STR _ps_this_file

Definition at line 13 of file unit_testing.c.

◆ is_surpressed

bool is_surpressed = false

Definition at line 19 of file unit_testing.c.

◆ surpressed_gave_error

bool surpressed_gave_error = false

Definition at line 22 of file unit_testing.c.