Removes old json.hpp, adds argument to show time.
This commit is contained in:
parent
f2188930f4
commit
651fff3292
File diff suppressed because it is too large
Load Diff
13
src/main.cpp
13
src/main.cpp
|
@ -19,6 +19,7 @@ int main(int argc, char** argv) {
|
||||||
args::HelpFlag helpFlag(parser, "help", "Display this help menu", {'h', "help"});
|
args::HelpFlag helpFlag(parser, "help", "Display this help menu", {'h', "help"});
|
||||||
args::ValueFlag<std::string> workingDirFlag(parser, "Working Directory", "Which work directory to use.",
|
args::ValueFlag<std::string> workingDirFlag(parser, "Working Directory", "Which work directory to use.",
|
||||||
{"workdir"});
|
{"workdir"});
|
||||||
|
args::Flag logTimeFlag(parser, "time-log", "Whether to show time logging.", {'t', "time-log"});
|
||||||
try {
|
try {
|
||||||
parser.ParseCLI(argc, argv);
|
parser.ParseCLI(argc, argv);
|
||||||
} catch (args::Help&) {
|
} catch (args::Help&) {
|
||||||
|
@ -51,16 +52,26 @@ int main(int argc, char** argv) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Globals::Library = BuildLibrary::Build("", initialize);
|
Globals::Library = BuildLibrary::Build("", initialize);
|
||||||
|
std::chrono::steady_clock::time_point end_build = std::chrono::steady_clock::now();
|
||||||
if (!Globals::Library.HasValue()) {
|
if (!Globals::Library.HasValue()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (logTimeFlag.Get()) {
|
||||||
|
std::cout << "Finished building library in: "
|
||||||
|
<< std::chrono::duration_cast<std::chrono::milliseconds>(end_build - begin).count() << "ms"
|
||||||
|
<< std::endl;
|
||||||
|
BuildLibrary::LogBuildTimes();
|
||||||
|
std::cout << std::endl;
|
||||||
|
}
|
||||||
auto* scriptResolver = dynamic_cast<AngelScriptResolver*>(Globals::Library.GetValue()->GetScriptResolver().get());
|
auto* scriptResolver = dynamic_cast<AngelScriptResolver*>(Globals::Library.GetValue()->GetScriptResolver().get());
|
||||||
auto testRunner = TestRunner(scriptResolver);
|
auto testRunner = TestRunner(scriptResolver);
|
||||||
auto* engine = scriptResolver->GetBuilder().GetEngine();
|
auto* engine = scriptResolver->GetBuilder().GetEngine();
|
||||||
|
std::chrono::steady_clock::time_point beginTests = std::chrono::steady_clock::now();
|
||||||
auto v = testRunner.RunAll(engine);
|
auto v = testRunner.RunAll(engine);
|
||||||
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
|
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
|
||||||
std::cout << std::endl
|
std::cout << std::endl
|
||||||
<< "Total Run time: " << std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count()
|
<< "Total Run time: " << std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count()
|
||||||
<< "ms" << std::endl;
|
<< "ms (of which " << std::chrono::duration_cast<std::chrono::milliseconds>(end - beginTests).count()
|
||||||
|
<< " ms was test runs)" << std::endl;
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
Loading…
Reference in New Issue