Skip to content

ThibautMT/mdst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mdst

mdst is a static library for testing.

Installation

To install, run :

$ make && sudo make install

Use

To use, simply include in your test file:

#include <mdst.h>

Specify test name

To specify a test name, use :

#define test_name "whateveryouwant"

By default, test name value is "undefined_test_name"

Compile

Where main.c is your source file and exec the output executable :

$ gcc -static main.c -lmdst -o exec

Example

// file.h
int ret_zero();

// file.c
int ret_zero()
{
  return -1; // Failing test.
}

// test_file.c

#include <stdio.h>
#include <stdlib.h>

#define test_name "test_if_eq_zero"
#include <mdst.h>
#include "file.h"

int main(int argc, char *argv[])
{
  m_assert(ret_zero() == 0, "error : `" test_name "` failed.");
  return EXIT_SUCCESS;
}
$ gcc -static file.c test_file.c -lmdst -o exec

About

Static library for testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published