Ceedling and Sublime

So, you're a fan of Sublime? Well guess what? There is a handy Sublime plugin for Ceedling! How convenient is that? It should work in Sublime Text 2 or 3. If you're already using Sublime Package Control (and you should be), then you can install it easily with that. If not, you can install the plugin from the SublimeText Ceedling project on github. You'll also need to install Rake for SublimeText to go with it.

So what can it do? BUILD!

First, it automatically can trigger builds using Sublime's built-in builder utility. Just point it at Ceedling and you're ready to go.

It comes with a bunch of hotkeys that you can define (many of which have useful defaults already. Let's look at a few:

  • Ceedling: Clean Project (ctrl+alt+shift+x)
  • Ceedling: Test Current Module (f7)
  • Ceedling: Test Changed Modules (ctrl+f7) OR (super+ctrl+b)
  • Ceedling: Test All Modules (ctrl+alt+f7)
  • Ceedling: Build Release (f5)
  • Ceedling: Default Build

More Hotkeys!

There are also hotkeys for file open convenience. If you're looking at a source module, wouldn't it be nice to automatically open the header for it? Maybe open the test for it? What if you're looking at a test and want the source module associated with it? No problem!

  • Ceedling: Open Test And Source (ctrl+alt+.)
  • Ceedling: Open Next Module File (ctrl+.)
  • Ceedling: Open Module Header (ctrl+alt+h)
  • Ceedling: Open Module Source (ctrl+alt+s)
  • Ceedling: Open Module Test (ctrl+alt+t)

Maybe you want to work on a higher level project basis?

  • Ceedling: Edit Project Configuration (f1)
  • Ceedling: Create New Module (ctrl+alt+m)
  • Ceedling: Complete Active Module 

Lots of Snippets

It has LOTS of snippets built-in. For example, try some of these assertions:

  • ae - TEST_ASSERT_EQUAL
  • aem - TEST_ASSERT_EQUAL_MESSAGE
  • ah - TEST_ASSERT_EQUAL_HEX
  • ahm - TEST_ASSERT_EQUAL_HEX_MESSAGE
  • ah8 - TEST_ASSERT_EQUAL_HEX8
  • ah8m - TEST_ASSERT_EQUAL_HEX8_MESSAGE
  • ah16 - TEST_ASSERT_EQUAL_HEX16
  • ah16m - TEST_ASSERT_EQUAL_HEX16_MESSAGE
  • at - TEST_ASSERT_TRUE
  • atm - TEST_ASSERT_TRUE_MESSAGE
  • af - TEST_ASSERT_FALSE
  • afm - TEST_ASSERT_FALSE_MESSAGE
  • am - TEST_ASSERT_EQUAL_MEMORY
  • amm - TEST_ASSERT_EQUAL_MEMORY_MESSAGE
  • ig - TEST_IGNORE
  • igm - TEST_IGNORE_MESSAGE

Or maybe try these test templates:

  • test - create a unit test method template
  • testi - create a unit test method template with TEST_IGNORE(message)
  • testf - create a unit test method template with TEST_FAIL(message)

CMock also gets in on the action! Type the name of a function, then type one of the following:

  • Name.e - automatically turns it into Name_Expect
  • Name.er - automatically turns it into Name_ExpectAndReturn