Skip to content

michalwitwicki/veric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Veric - A Lightweight Testing Framework for C

Pronounced: /ˈvɛrɪk/ (like "ver-ik")


🔍 What is Veric?

Veric is a simple and lightweight testing framework for C projects. With just a handful of intuitive APIs, you can organize your tests into suites, run them with a single command, and get clear feedback on your test results.


🛠️ Key Features

  • Well-documented - Detailed tutorial, many examples, and API reference.
  • Lightweight - Only one .c and one .h file, no dependencies.
  • User-friendly - Minimal, easy-to-use API for effortless test management.
  • Zero maintenance - Automatic suite and test registration.
  • Logging - Save test results to a file.
  • Output capturing - Verify stdout and stderr during tests.
  • DIY assertions - Build your own custom checks.
  • Memory flexibility - Supports both static and dynamic memory policies.

🚀 Quick Start

Ready to VERIfy your C code? Here’s how easy it is:

#include "veric.h"

VRC_SUITE(suite_name)
VRC_TEST(test_name)
{
	// Replace with your actual test logic
	int result = 1 + 1;
	int expected = 2;
	vrc_check(result == expected);
}

int main(void)
{
	return vrc_start();
}

Build and run minimal example with:

make run_minimal_example

Sample output:

[ 1 ] - suite_name
[ 1.1 ] - [ PASS ]
[ 1 ] - [ PASS ]

==============================
Suite stats:
Total:   1
Pass:    1 (100.00%)
Fail:    0
Fatal:   0
Skip:    0
Not run: 0

Test stats:
Total:   1
Pass:    1 (100.00%)
Fail:    0
Fatal:   0
Skip:    0
Not run: 0

Session status: [ PASS ]

Want to try more? Run any example with:

make run_<example_name>

⚙️ Requirements

All you need is a C compiler that supports attribute constructor.

Not sure? Check with:

make test_constructor

Veric is written in the C99 standard and has been tested with GCC and Clang compilers.


📚 Learn More


🚧 Roadmap

  • CLI parameters for test control
  • Colorized output
  • Time tracking for tests and suites
  • Tags for grouping and selective execution
  • TAP support
  • Your ideas? Open an issue or PR!

📄 License

MIT License. See LICENSE for details.


✨ Happy testing!

About

Veric - Verify your C code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published