ThrowTheSwitch / Ceedling

Ruby-based unit testing and build system for C projects

Home Page:http://throwtheswitch.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How does "default_tasks" section work?

kafkaaaa opened this issue Β· comments

🌱 Hello.

I would like to know "How does :default_tasks section work?"

If I write in :default_tasks section like below,
in project.yml

  :default_tasks:
    - test:all --verbosity=obnoxious

I expect that it is the same as $ ceedling test:all --verbosity=obnoxious

but, result is ...

$ ceedling 
🌱 Loaded project configuration at default location using ./project.yml

🌱 Ceedling set up completed in 297 milliseconds
rake aborted!
Don't know how to build task '--verbosity=obnoxious' (See the list of available tasks with `rake --tasks`)

Tasks: TOP => default
(See full trace by running task with --trace)
πŸͺ² ERROR: Ceedling could not complete operations because of errors

of course, I've read docs, but I need more clarity or example.

I'm very looking forward 🌱 v1.0.0 !

Oh! This is a very good question. The command-line-parsing library Ceedling uses makes a difference between flags (things like --verbosity or -v) and tasks (things like test:all). The :default_tasks section allows you to list multiple tasks to be executed one after another, but it doesn't support flags.

It'd look like this:

:default_tasks:
  - clobber
  - test:all

At the moment, you'd still have to issue flags like so:

ceedling -v=4

which (if you have the very latest) is the same as saying

ceedling --verbosity=obnoxious

which is also the same as the following (because of the default tasks defined above)

ceedling --verbosity=obnoxious clobber test:all

I just pushed a revision to CeedlingPacket that clarifies the meaning and values for :project ↳ :default_tasks.