Skip to content

Unit testing TDD framework for the rapid source code development and verification.

License

Notifications You must be signed in to change notification settings

unittests/unitframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnitFrame Build Status

Unit testing TDD framework for the rapid source code development and verification. It was developed primarily for Python programming language, but C++ is also supported.

Components:

  • uframe.py - Main tool, runs unit tests in a loop
  • gate.py - User's commit gating tool
  • templates/ - Templates directory for new projects/scripts
  • checks/ - Source code lint checks (currently only Pep8 for Python)

License

This is free and unencumbered software released into the public domain. For more information, please refer to http://unlicense.org

Usage requirements

Each program has to support -ut command line switch which is used to enable unit testing mode of a program (always enabled is okay).

Programming languages supported:

  • Python (Windows/Linux)
  • C++ (Windows MinGW only)

It is recommended to use following unit testing libraries with UnitFrame:

  • Python - Unittest from Python standard library
  • C++ - Cppunit C++ Unit testing TDD framework

uframe.py - Runs unit tests in a loop

Will open up default editor and new xterm window for unit tests to be run in a loop. Unit tests will be run each time the project is updated and saved.

usage: uframe.py [-h] [-type TYPE] [-xterm] [-pre PRE] [-args ARGS] proj

UnitFrame script

positional arguments:
  proj        Project name (required argument)

optional arguments:
  -h, --help  show this help message and exit
  -type TYPE  New project template (default p): cf template_contest.py, cfc
              template_contest.cc, p template_program.py, pc
              template_program.cc, s template_script.py
  -xterm      Xterm mode
  -pre PRE    Run a Programm on top of the Project
  -args ARGS  Passing argument to the Project

UnitFrame launching GVIM and terminal window with one Cppunit unit test failing after executing the following command:

> unitframe 574D_blocks.cc

blocks

gate.py - User's commit gating script

Searches for all files supporting unit testing (-ut option) in the specified directory and runs them one by one. All tests must pass for gate script to exit normally.

usage: gate.py [-h] [path]

Gate passing all tests:

GATE: Running Unit Tests for codeforces/574D_blocks.cc
.....
--------------------------------------------------
Ran 5 checks in 0.049s

OK

GATE: Elapsed Time 37.829s
GATE: ALL TESTS PASSED!

Templates for new projects

New project templates available:

  • Basic script template -type c - source Python
  • Program teplate -type p/pc - source Python, C++
  • Contest solution template -type cf/cfc - source Python, C++

About

Unit testing TDD framework for the rapid source code development and verification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published