Added a simple example file

This commit is contained in:
Adwaith-Rajesh 2025-09-28 13:18:10 +05:30
parent 1bd017adfc
commit 285c736b6c
Signed by: Adwaith-Rajesh
GPG Key ID: 98CC7C030DF895A0

32
examples/basic.c Normal file
View File

@ -0,0 +1,32 @@
#include <stdio.h>
// #define MAX_TEST_FUNCS 0
#include "test.h"
BEFORE({
printf("run before each test.\n");
})
AFTER({
printf("runs after each test\n");
})
SETUP({
printf("runs once at the start\n");
})
TEARDOWN({
printf("runs once at the end\n");
})
TEST(simple_test, {
ASSERT(1 == 1, "");
// ASSERT(0 == 1, "This assertion will fail");
})
TEST(simple_test_2, {
ASSERT(1 == 1, "");
ASSERT(0 == 1, "This assertion will fail");
})
TEST_INIT()