Removes old json.hpp, adds argument to show time.

This commit is contained in:
Deukhoofd 2021-08-28 16:53:05 +02:00
parent f2188930f4
commit 651fff3292
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
2 changed files with 12 additions and 22876 deletions

22875
extern/json.hpp vendored

File diff suppressed because it is too large Load Diff

View File

@ -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;
} }