/auto-unit-test

No writing unit tests again!

Primary LanguagePython

auto-unit-test CircleCI codecov Codacy Badge

No writing unit tests again!

Goals

  • Generate unit tests from a given JSON file which contains the test.
    • This project is currently at this stage.
  • Generate the above JSON file automatically by parsing the code.
  • Given the current state, execute the unit tests, take a snapshot and save it for later comparison.

Generating and running a test

  • To generate a unit-test for all suites
make all
  • To run all unit tests generated.
make test-all
  • To generate a unit-test for a suite, say examples/C/simple-functions/simple-functions-test.json
make c-unit-tests test=examples/C/simple-functions/simple-functions-test
  • To run a unit test.
make test-c-unit-tests test=examples/C/simple-functions/simple-functions-test

Current State.

Functionality Status Library Code Auto Generated Unit Test
Simple C function working. Simple C function Simple C function Unit Test
C functions which takes struct argument. Simple Struct function Simple Struct function Unit Test
C functions which takes nested struct argument. Nested Struct function Nested Struct function Unit Test
C functions which returns nested struct value. Struct Return function Struct Return function Unit Test
C functions which takes pointer arguments. Pointer Function Pointer Function Unit Test
C functions which returns pointer. Pointer Function Pointer Function Unit Test
Support for all primitive data-types. Data Type Function Data Type Unit Test
C functions which takes arrays (through pointer)
Monitoring side-effects and global changes