/** * @author Edouard DUPIN * @copyright 2017, Edouard DUPIN, all right reserved * @license MPL-2 (see license file) */ #include #include #include #include #include #include int main(int _argc, const char** _argv) { // the only one init for etk: etest::init(_argc, _argv); for (int32_t iii=1; iii<_argc ; ++iii) { etk::String data = _argv[iii]; if ( data == "-h" || data == "--help") { ETEST_PRINT("Help : "); ETEST_PRINT(" ./xxx [options]"); ETEST_PRINT(" File to test"); ETEST_PRINT(" -h/--help: this help"); exit(0); } } return RUN_ALL_TESTS(); } TEST(testrestyle, test1) { estyle::Generator interface; etk::String source = "/* simple comment */\n" "int32_t hello = \"plouf \\n\";" "\n"; etk::String output = interface.process(source); TEST_INFO("source:\n" << source); TEST_INFO("output:\n" << output); } TEST(testrestyle, test2) { estyle::Generator interface; etk::String source = "if (plop == \"plop\" || (kikou != 363464564 && !tree)) { int32_t coucou; int64_t hello = 456; } else if (lol==345 && UNO == why) {/* nothing to do*/} else DEBUG_INFO(\"kjlkj\" << 456346.6 << \" \" << 0xabcdef123);"; etk::String output = interface.process(source); TEST_INFO("source:\n" << source); TEST_INFO("output:\n" << output); }