2017-12-04 05:46:34 +00:00
|
|
|
/*
|
|
|
|
Examplar - An automation and testing framework.
|
|
|
|
|
|
|
|
© SURRO INDUSTRIES and Chris Punches, 2017.
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
*/
|
2017-04-18 23:04:21 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include "src/json/json.h"
|
2017-04-22 12:07:11 +00:00
|
|
|
#include "src/loaders/loaders.h"
|
2017-04-18 23:04:21 +00:00
|
|
|
|
2017-12-04 05:46:34 +00:00
|
|
|
|
2017-06-09 03:49:13 +00:00
|
|
|
int main( )
|
2017-04-18 23:04:21 +00:00
|
|
|
{
|
2017-06-23 19:24:11 +00:00
|
|
|
bool verbose = true;
|
2017-04-29 21:35:03 +00:00
|
|
|
// A Plan is made up of Tasks, and a Suite is made up of Units.
|
|
|
|
// A Plan declares what units are executed and a Suite declares the definitions of those units.
|
2017-08-06 23:26:51 +00:00
|
|
|
Conf configuration = Conf("/home/phanes/development/internal/Examplar/conf/config.json", verbose );
|
2017-04-19 05:50:34 +00:00
|
|
|
|
2017-04-29 21:35:03 +00:00
|
|
|
// load the configuration file which contains filepaths to definitions of a plan and definitions of units.
|
|
|
|
std::string definitions_file = configuration.get_units_path();
|
|
|
|
std::string plan_file = configuration.get_plan_path();
|
2017-04-19 06:27:54 +00:00
|
|
|
|
2017-06-18 14:39:46 +00:00
|
|
|
Suite available_definitions;
|
2017-06-23 19:24:11 +00:00
|
|
|
available_definitions.load_units_file( definitions_file, verbose );
|
2017-06-11 19:14:45 +00:00
|
|
|
|
2017-06-23 20:02:19 +00:00
|
|
|
Plan plan;
|
2017-06-25 06:28:22 +00:00
|
|
|
plan.load_plan_file( plan_file, verbose );
|
2017-06-11 19:14:45 +00:00
|
|
|
|
2017-06-25 22:50:14 +00:00
|
|
|
plan.load_definitions( available_definitions, verbose );
|
2017-04-19 05:50:34 +00:00
|
|
|
|
2017-06-27 02:27:24 +00:00
|
|
|
std::cout << "Ready to execute all tasks in Plan." << std::endl;
|
|
|
|
|
2017-12-04 02:15:41 +00:00
|
|
|
try {
|
|
|
|
plan.execute( verbose );
|
|
|
|
}
|
|
|
|
catch ( std::exception& e) {
|
|
|
|
std::cerr << e.what() << std::endl;
|
|
|
|
}
|
2017-06-27 02:27:24 +00:00
|
|
|
|
2017-04-18 23:04:21 +00:00
|
|
|
return 0;
|
|
|
|
}
|