Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctest

A tiny testing framework image

  • ~160 lines of C99
  • Zero-allocations
  • Fixtures Support

Usage

ctest is dead simple:

#include "ctest.h"

void test_add(ctest_ctx_t *ctx) {
  int a = 21, b = 21;

  int got = a + b;
  int want = 42;

  if (got != want) {
    ctest_failf(ctx, "wanted %d, got %d", want, got);
  }
}

int main(void) {
  ctest_test_t tests[] = {
      {"Test Add", test_add},
      {NULL, NULL},
  };
  return ctest_run(tests, NULL, NULL);
}

See the demo folder for further usage examples.

License

This is free and unencumbered software released into the public domain. See LICENSE for details.

About

A tiny testing framework for c

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages