Ruby/Rake-based build and test system for C projects
Ruby HTML Other
Latest commit 1c9333b Sep 19, 2016 @mvandervoord mvandervoord committed on GitHub Merge pull request #97 from yanma/enable_test_cases
use UnityTestRunnerGenerator to find test cases (Thanks, Hiroaki Yamazoe. I like that we are now using the existing Test Runner Generator!)
Permalink
Failed to load latest commit information.
assets - moved command line support into ceedling executable so that we can … Apr 13, 2016
bin Make the gtest output method a little more robust. Sep 9, 2016
config Normalize line endings, convert CRLF to LF Mar 1, 2016
docs - moved command line support into ceedling executable so that we can … Apr 13, 2016
examples Normalize line endings, convert CRLF to LF Mar 1, 2016
lib use UnityTestRunnerGenerator to find test cases Sep 19, 2016
plugins Fixed bug in generator module changes Aug 12, 2016
spec Finally. we know our documentation needs to be greater than or equal … May 6, 2016
test_graveyard Normalize line endings, convert CRLF to LF Mar 1, 2016
vendor update to latest dependencies Aug 12, 2016
.gitattributes - No more dependency on non-existent CMock version/build.info file Jan 29, 2016
.gitignore Added ignore of .ruby-version file for rbenv since we want the versio… Jul 30, 2014
.gitmodules Added the fake function framework plugin. May 23, 2016
.travis.yml added curses as dependance due to it being a gem in 2.1.0+ Aug 15, 2016
Gemfile Added curses to Gemfile due to it being a gem in ruby 2.1.0+ Aug 15, 2016
Gemfile.lock Make the gtest output method a little more robust. Sep 9, 2016
README.md Cleaned up some installation instructions. Apr 15, 2016
Rakefile Added default to Rakefile to run spec when just using bundle exe Jul 30, 2016
ceedling.gemspec added curses as dependance due to it being a gem in 2.1.0+ Aug 15, 2016
license.txt - moved command line support into ceedling executable so that we can … Apr 13, 2016

README.md

Ceedling - Build/test system for C based on Ruby/Rake

Ceedling Build Status

Ceedling is a build system for C projects that is something of an extension around Ruby’s Rake (make-ish) build system. Ceedling also makes TDD (Test-Driven Development) in C a breeze by integrating CMock, Unity, and CException -- three other awesome open-source projects you can’t live without if you're creating awesomeness in the C language. Ceedling is also extensible with a handy plugin mechanism.

Usage Documentation

Documentation and license info exists in the repo in docs/

Getting Started (Developers)

First make sure Ruby is installed on your system (if it's not already). Then, from a command prompt:

> gem install ceedling

(Alternate Installation for Those Planning to Be Ceedling Developers)

> git clone --recursive https://github.com/throwtheswitch/ceedling.git
> cd ceedling
> bundle install # Ensures you have all RubyGems needed
> bundle execute rake # Run all CMock library tests

If bundler isn't installed on your system or you run into problems, you might have to install it:

> sudo gem install bundler

Using Ceedling inside of a project

Ceedling can deploy all of its guts into a folder. This allows it to be used without having to worry about external dependencies.

ceedling new [your new project name]

Using Ceedling outside of a project as a gem

Ceedling can also be used as a gem. The following Rakefile is the bare minimum required in order to use Ceedling this way:

require 'ceedling'
Ceedling.load_project

If you want to load a Ceedling project YAML file other than the default project.yml (i.e. ./my_config.yml), you can do:

Ceedling.load_project(config: './my_config.yml')

Additionally, a project.yml is required. Here is one to get you started:

---
:project:
  :use_exceptions: FALSE
  :use_test_preprocessor: TRUE
  :use_deep_dependencies: TRUE
  :build_root: build
#  :release_build: TRUE
  :test_file_prefix: test_

#:release_build:
#  :output: MyApp.out
#  :use_assembly: FALSE

:environment:

:extension:
  :executable: .out

:paths:
  :test:
    - +:test/**
    - -:test/support
  :source:
    - src/**
  :support:
    - test/support

:defines:
  # in order to add common defines:
  #  1) remove the trailing [] from the :common: section
  #  2) add entries to the :common: section (e.g. :test: has TEST defined)
  :commmon: &common_defines []
  :test:
    - *common_defines
    - TEST
  :test_preprocess:
    - *common_defines
    - TEST

:cmock:
  :when_no_prototypes: :warn
  :enforce_strict_ordering: TRUE
  :plugins:
    - :ignore
  :treat_as:
    uint8:    HEX8
    uint16:   HEX16
    uint32:   UINT32
    int8:     INT8
    bool:     UINT8

#:tools:
# Ceedling defaults to using gcc for compiling, linking, etc.
# As [:tools] is blank, gcc will be used (so long as it's in your system path)
# See documentation to configure a given toolchain for use

:plugins:
  :load_paths:
    # This is required to use builtin ceedling plugins
    - "#{Ceedling.load_path}"
    # Uncomment this and create the directory in order to use your own
    # custom ceedling plugins
    # - ceedling_plugins
  :enabled:
    # These plugins ship with Ceedling.
    - stdout_pretty_tests_report
    # - stdout_ide_tests_report # IDE parseable output
    # - teamcity_tests_report # TeamCity CI output (only enabled in TeamCity builds)
    - module_generator # Adds tasks for creating code module files
...

Finally, you'll need to create something like the following directory structure. This one matches the project.yml defined above:

./test
./test/support
./src
./project.yml
./Rakefile
./build