#include #include #include "conexion.h" #include "conexion_ssl.h" #include "config_reader.h" #include "tests.h" #include "msql_acces.h" #define file_config "config" CPPUNIT_TEST_SUITE_REGISTRATION( test_basic ); int main() { //msql_acces data; //data.create_user("otro", "otro", true); //inicio de los tests CPPUNIT_NS::TestResult testresult; CPPUNIT_NS::TestResultCollector collectedresults; testresult.addListener (&collectedresults); CPPUNIT_NS::BriefTestProgressListener progress; testresult.addListener (&progress); CPPUNIT_NS::TestRunner testrunner; testrunner.addTest (CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest ()); testrunner.run(testresult); CPPUNIT_NS::CompilerOutputter compileroutputter(&collectedresults, std::cerr); compileroutputter.write (); config_reader conf = config_reader(file_config); string option; if(conf.get_param("security",option)){ conexion *con=nullptr; if(option=="yes"){ con = new conexion_ssl(conf); }else if(option=="no"){ con = new conexion(conf); }else{ perror("unknow option in security option"); } con->start_server(); }else{ perror("no define security option"); } return 0; }