Code Monkey home page Code Monkey logo

janit's Introduction

Janit

Janit is a tiny and simple unit test framework for C applications. The test framework is based on MinUnit.

Usage

The test suite usage is very simple. An example project is provided in the example directory. You can run the unit tests for the project with:

make test

One of the tests has been intentionally designed to fail. The basic usage is as follows. You must include "janit.h" in your test file along with tests and a main method to run the tests with. The file structure is shown below:

#include <janit.h>
#include "<name.h>"

// Unit test functions in the form:
static char * test_<test>() {
    ja_assert("<assert string>", <assert>);

    return 0;
}

int main() {
    ja_add_tests(
            // tests to add
            test_<test>,
            ...
    );

    return ja_run_tests("<name>");
}

Where is the file to test, and is the name of a test to perform. The is displayed when the test fails and describes the assert used. The is a boolean which will signify failure when returning false.

Installation

Install on a system using the following command:

make install

Licence

GPLv3

See LICENCE for more information

Authors

Jack Massey [email protected]

janit's People

Contributors

jmassey-jacques avatar massey101 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.