YREA-SLS/SLS_C/include/tests/tests.h

42 lines
935 B
C

// Kyler Olsen
// YREA SLS
// Tests Header
// October 2025
#ifndef SLS_TESTS_H
#define SLS_TESTS_H
#include <stddef.h>
#include "sls/errors.h"
extern const char *TEST_FILE_NAME;
typedef enum {
TEST_ERROR, // The test encountered an error
TEST_LOGIC_FAIL, // The lexer encountered an error
TEST_LOGIC_ERROR_FAIL, // The test failed because of a lexical error reported from the parsed code
TEST_ERROR_FAIL, // The test failed
TEST_PASS, // The test passed
TEST_NOT_IMPLEMENTED, // The test is not implemented
} TestResultType;
typedef struct {
const char *name;
TestResultType status;
union {
char *message; // status in { TEST_LOGIC_FAIL, }
SlsError error; // status in { TEST_ERROR, TEST_ERROR_FAIL, }
};
} TestResult;
typedef struct {
const char *section;
size_t count;
TestResult* tests;
} TestsReport;
TestsReport run_lexer_tests();
#endif // SLS_TESTS_H