diff --git a/conf/units/all_test.units b/conf/units/all_test.units index 126a978..f3abb05 100644 --- a/conf/units/all_test.units +++ b/conf/units/all_test.units @@ -1,7 +1,16 @@ { "units": [ { - "name": "independent test", + "name": "independent test 1", + "target": "/bin/pwd", + "output": "pass", + "rectifier": "/bin/pwd", + "active": true, + "required": true, + "rectify": true + }, + { + "name": "independent test 2", "target": "/bin/pwd", "output": "pass", "rectifier": "/bin/pwd", diff --git a/src/loaders/Task.cpp b/src/loaders/Task.cpp index c242ab1..dbb1860 100644 --- a/src/loaders/Task.cpp +++ b/src/loaders/Task.cpp @@ -39,9 +39,21 @@ void Task::load_root(Json::Value loader_root, bool verbose ) } } +/// Task::get_name - Retrieves the name of the current Task. std::string Task::get_name() { return this->name; } - +/// Task::load_definition - Loads a unit to a local member. Used to tie Units to Tasks. +/// +/// \param selected_unit - The unit to attach. +/// \param verbose - Whether to print to STDOUT. +void Task::load_definition( Unit selected_unit, bool verbose ) +{ + this->definition = selected_unit; + if ( verbose ) + { + std::cout << "Loaded definition \"" << selected_unit.get_name() << "\" for task \"" << this->get_name() << "\"." << std::endl; + } +} \ No newline at end of file diff --git a/src/loaders/Task.h b/src/loaders/Task.h index d80016a..d4efd08 100644 --- a/src/loaders/Task.h +++ b/src/loaders/Task.h @@ -28,12 +28,8 @@ class Task // load a json::value into task members (second stage deserialization) void load_root( Json::Value loader_root, bool verbose ); - // register a dependency - void add_dependency( std::string dependency_name ); - // appends definition unit as child member - void load_definition( Unit definition ); - + void load_definition( Unit definition, bool verbose ); bool is_complete();