There are numerous ways of getting into it. My preference is to clone ceedling (git clone https://github.com/ThrowTheSwitch/Ceedling.git && git submodule update --init --recursive
) and run an example to see how it works.
To make the examples/temp_sensor work you need to make three modifications:
- project.yml - plugins, load_paths should be
../../plugins
- rakefile.rb - PROJECT_CEEDLING_ROOT should be
"../.."
- lib/ceedling/rakefile.rb - add a line referencing
diy/test
Here is a diff with the modifications I made on master (git commit 09a04cb55a86):
diff --git a/examples/temp_sensor/project.yml b/examples/temp_sensor/project.yml
index ec9a45e..a327f5b 100644
--- a/examples/temp_sensor/project.yml
+++ b/examples/temp_sensor/project.yml
@@ -58,7 +58,7 @@
:plugins:
:load_paths:
- - vendor/ceedling/plugins
+ - ../../plugins
:enabled:
- stdout_pretty_tests_report
- module_generator
diff --git a/examples/temp_sensor/rakefile.rb b/examples/temp_sensor/rakefile.rb
index 1b534d2..82d2e64 100755
--- a/examples/temp_sensor/rakefile.rb
+++ b/examples/temp_sensor/rakefile.rb
@@ -1,4 +1,4 @@
-PROJECT_CEEDLING_ROOT = "vendor/ceedling"
+PROJECT_CEEDLING_ROOT = "../.."
load "#{PROJECT_CEEDLING_ROOT}/lib/ceedling.rb"
Ceedling.load_project
diff --git a/lib/ceedling/rakefile.rb b/lib/ceedling/rakefile.rb
index 37001ba..be6b620 100644
--- a/lib/ceedling/rakefile.rb
+++ b/lib/ceedling/rakefile.rb
@@ -9,6 +9,7 @@ CEEDLING_RELEASE = File.join(CEEDLING_ROOT, 'release')
$LOAD_PATH.unshift( CEEDLING_LIB )
$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'unity/auto') )
$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'diy/lib') )
+$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'diy/test') )
$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'cmock/lib') )
$LOAD_PATH.unshift( File.join(CEEDLING_VENDOR, 'deep_merge/lib') )
Run the example by running rake test
from within examples/temp_sensor
.
You need ruby (for rake) and gcc installed for the temp_sensor example.
Once you've worked out the format of the example/temp_sensor/rakefile.rb
and example/temp_sensor/project.yml
file the key work is within the examples/temp_sensor/test/Test...
files.