Skip to content

karottenreibe/rake-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rake-tester

http://www.github.com/karottenreibe/rake-tester

An extension of the rake-compiler that allows for automatic compilation of C test suites, e.g. using cmockery.

Features/Limitations

  • Automatically compiles and executes test suites of arbitrary C testing frameworks
  • Can batch-execute all suites or selectively run a single suite
  • Can only compile the tests for your current platform
  • Thus, no cross compilation of the tests
  • Support for running the tests with valgrind or gdb

Installation

gem install rake-tester

Usage

In the Rakefile:

require 'rake/extensiontask'
require 'rake/extensiontesttask'

Rake::ExtensionTask.new(...) do |ext|
    # ... confgure as normal

    ext.test_files          = FileList['test/c/*']
    ext.test_includes       << '/usr/include/frood_stuff'
    ext.test_libraries      << 'zaphods_heads'
    ext.test_lib_folders    << '/usr/lib/floopy'
end

Write your tests.

To test everything:

$ rake test:c

To test one extension:

$ rake test:c:extension

To execute one test suite:

$ rake test:c:extension[test_feature]

To use valgrind:

$ rake test:valgrind:extension[test_feature]

To use gdb:

$ rake test:gdb:extension[test_feature]

Examples

Check out Joker, which user rake-tester in combination with cmockery!

License

Copyright (c) 2009 Fabian Streitel

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

About

rake-tester is an extension to the rake-compiler that maintains C test suites

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages