int main(int argc, char** argv) { bool showColors = false; bool isQuiet = false; QString seed; QStack<QString> reporterFiles; int c, index; while ((c = getopt(argc, argv, "cr:s:q")) != -1) { switch(c) { case 'c': showColors = true; break; case 'q': isQuiet = true; break; case 'r': reporterFiles.push(QString(optarg)); break; case 's': seed = QString(optarg); break; } } if (optind == argc) { std::cerr << "Run Jasmine's SpecRunner headlessly" << std::endl << std::endl; std::cerr << " specrunner [-c] [-s seed] [-r report file ...] specrunner.html ..." << std::endl; return 1; } QApplication app(argc, argv); app.setApplicationName("jasmine-headless-webkit"); Runner runner; runner.setColors(showColors); runner.setQuiet(isQuiet); runner.setReportFiles(reporterFiles); runner.setSeed(seed); for (index = optind; index < argc; index++) { runner.addFile(QString::fromLocal8Bit(argv[index])); } runner.go(); return app.exec(); }
int main(int argc, char** argv) { char *reporter = NULL; char showColors = false; int c, index; while ((c = getopt(argc, argv, "cr:")) != -1) { switch(c) { case 'c': showColors = true; break; case 'r': reporter = optarg; break; } } if (optind == argc) { std::cerr << "Run Jasmine's SpecRunner headlessly" << std::endl << std::endl; std::cerr << " specrunner [-c] [-r <report file>] specrunner.html ..." << std::endl; return 1; } QApplication app(argc, argv); app.setApplicationName("jasmine-headless-webkit"); Runner runner; runner.setColors(showColors); runner.reportFile(reporter); for (index = optind; index < argc; index++) { runner.addFile(QString::fromLocal8Bit(argv[index])); } runner.go(); return app.exec(); }