From 5215cdc0ad27e002184111a3365a2dbe265d5cc2 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Fri, 16 Aug 2024 14:02:03 +0800 Subject: [PATCH] update --- .gitignore | 1 + src/main.cpp | 14 +++++++++----- tests/1.in | 1 - tests/xj.json | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 tests/1.in diff --git a/.gitignore b/.gitignore index a3e795e..bb01d61 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # ---> C++ +/tests /build /.xmake /.vscode diff --git a/src/main.cpp b/src/main.cpp index 463bee0..6b0d6d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,7 @@ #include "unistd.h" #endif -using std::cerr,std::endl,std::cout,std::ifstream,std::string,std::vector,std::queue,std::filesystem::path,std::thread,std::chrono::time_point,std::chrono::steady_clock,std::chrono::high_resolution_clock; +using std::cerr,std::endl,std::cout,std::ifstream,std::string,std::vector,std::queue,std::filesystem::path,std::thread,std::chrono::time_point,std::chrono::steady_clock,std::chrono::high_resolution_clock,std::chrono::system_clock,std::filesystem::exists; #define AS_EQ(a,b){if((a)!=(b)){cerr<<"assert eq failed :"< start; - time_point end; + time_point start; + time_point end; }; template @@ -135,6 +135,10 @@ int main(int argc, char* argv[]) { } queue> tasks; const auto testsPath = projectPath/"tests"; + if(!exists(testsPath)){ + LOG("creating the test dir") + std::filesystem::create_directory(testsPath); + } printValue(testsPath) const string exePathStr = getProtectPath(exePath); for(auto i:tests){ diff --git a/tests/1.in b/tests/1.in deleted file mode 100644 index 56a6051..0000000 --- a/tests/1.in +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/tests/xj.json b/tests/xj.json index 395b803..2a8e1eb 100644 --- a/tests/xj.json +++ b/tests/xj.json @@ -7,7 +7,7 @@ ], "tests":[ { - "in":"1.in", + "in":"a.in", "ans":"1.ans" } ]