<commit_before>## TinyUnit

TinyUnit is a minimal unit testing framework for C/C++ self-contained in a
single header file and a single source file. Bigger than minunit, but in other 
aspect, less boilerplate code when running tests.

It provides a way to define tests, test suites and a few handy assertion
types. It reports the summary of the number of tests run, number of assertions
and time elapsed.

Note that this project is based on:
http://www.jera.com/techinfo/jtns/jtn002.html and https://github.com/siu/minunit

## How to use it

This is a minimal test suite written with tinyunit (named with tinyunit_readme_sample.c):``
```
#define TINYUNIT_IMPLEMENTATION
#include "tinyunit.h"

TU_TEST(test_check) {
  tu_check(5 == 7);
}
```

Which will produce the following output:
```
F(global_suite:test_check)
failed at test_check:{FullPath}\tinyunit\tinyunit_readme_sample.c:4:
  5 == 7


1 tests, 1 assertions, 1 failures

Finished in 0.00007300 seconds (real) 34345.94270600 seconds (proc)
```

Check out tinyunit_example.c to see a complete example.
Compile with something like:
```
gcc tinyunit.c tinyunit_example.c -lrt -lm -o tinyunit_example
```

Don't forget to add -lrt for the timer and -lm for linking the function fabs
used in tu_assert_double_eq.

## Setup and teardown functions

One can define setup and teardown functions and
configure the test suite to run them by using the macro
`TU_TEST_SUITE(suite_name, setup_function, teardown_fucntion)`
And for tests belong the suite, using `TU_TEST(suite_name, test_name)`
to creating a binding between the test and suite.

## Using CMake building system

### Windows
```
mkdir build & cd build
cmake -DTINYUNIT_BUILD_TESTS=ON -G "Visual Studio 10 2010" ..
cmake --build . --config RelWithDebInfo
ctest -VV -C RelWithDebInfo
```

### Linux
```
mkdir build
cd build
cmake -DTINYUNIT_BUILD_TESTS=ON ..
cmake --build .
ctest -VV
```

### OSX for iOS:
```
export XCODE_XCCONFIG_FILE=${tinyunit}/cmake/polly/scripts/NoCodeSign.xcconfig
cmake -DTINYUNIT_BUILD_TESTS=ON -G Xcode -DCMAKE_TOOLCHAIN_FILE=../cmake/polly/ios-nocodesign-10-1.cmake ..
cmake --build . --config RelWithDebInfo
ctest -VV -C RelWithDebInfo
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app


```

## Assertion types<commit_msg>revise the README.md<commit_after>## TinyUnit

TinyUnit is a minimal unit testing framework for C/C++ self-contained in a
single header file and a single source file. Bigger than minunit, but in other 
aspect, less boilerplate code when running tests.

It provides a way to define tests, test suites and a few handy assertion
types. It reports the summary of the number of tests run, number of assertions
and time elapsed.

Note that this project is based on:
http://www.jera.com/techinfo/jtns/jtn002.html and https://github.com/siu/minunit

## How to use it

This is a minimal test suite written with tinyunit (named with tinyunit_readme_sample.c):``
```
#define TINYUNIT_IMPLEMENTATION
#include "tinyunit.h"

TU_TEST(test_check) {
  tu_check(5 == 7);
}
```

Which will produce the following output:
```
F(global_suite:test_check)
failed at test_check:{FullPath}\tinyunit\tinyunit_readme_sample.c:4:
  5 == 7


1 tests, 1 assertions, 1 failures

Finished in 0.00007300 seconds (real) 34345.94270600 seconds (proc)
```

Check out tinyunit_example.c to see a complete example.
Compile with something like:
```
gcc tinyunit.c tinyunit_example.c -lrt -lm -o tinyunit_example
```

Don't forget to add -lrt for the timer and -lm for linking the function fabs
used in tu_assert_double_eq.

## Setup and teardown functions

One can define setup and teardown functions and
configure the test suite to run them by using the macro
`TU_TEST_SUITE(suite_name, setup_function, teardown_fucntion)`
And for tests belong the suite, using `TU_TEST(suite_name, test_name)`
to creating a binding between the test and suite.

## Using CMake building system

### Windows
```
mkdir build & cd build
cmake -DBUILD_TESTING:BOOL=TRUE -G "Visual Studio 10 2010" ..
cmake --build . --config RelWithDebInfo
ctest -VV -C RelWithDebInfo
```

### Linux
```
mkdir build
cd build
cmake -DBUILD_TESTING:BOOL=TRUE ..
cmake --build .
ctest -VV
```

### OSX for iOS:
```
export XCODE_XCCONFIG_FILE=${tinyunit}/cmake/polly/scripts/NoCodeSign.xcconfig
cmake -DBUILD_TESTING:BOOL=TRUE -G Xcode -DCMAKE_TOOLCHAIN_FILE=../cmake/polly/ios-nocodesign-10-1.cmake ..
cmake --build . --config RelWithDebInfo
ctest -VV -C RelWithDebInfo
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app


```

## Assertion types
{'fraction_non_alphanumeric': 0.09582148326405601, 'fraction_numerical': 0.018376722817764167, 'mean_word_length': 4.589242053789731, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '34860', 'n_tokens_mistral': 1627, 'n_tokens_neox': 1490, 'n_words': 527}