update
This commit is contained in:
parent
e13bcbb5f4
commit
5215cdc0ad
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
# ---> C++
|
||||
/tests
|
||||
/build
|
||||
/.xmake
|
||||
/.vscode
|
||||
|
14
src/main.cpp
14
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 :"<<endl<<#a<<":"<<(a)<<endl<<#b<<":"<<(b)<<endl;exit(1);}}
|
||||
#define AS_NE(a,b){if((a)==(b)){cerr<<"assert not eq failed :"<<endl<<#a<<":"<<(a)<<endl<<#b<<":"<<(b)<<endl;exit(1);}}
|
||||
@ -40,9 +40,9 @@ using std::cerr,std::endl,std::cout,std::ifstream,std::string,std::vector,std::q
|
||||
GetSystemInfo( &sysInfo );
|
||||
return sysInfo.dwNumberOfProcessors;
|
||||
}
|
||||
#elif
|
||||
#else
|
||||
unsigned long getCpuNums(){
|
||||
return sysconf(_SC_NPROCESSORS_ONLN)
|
||||
return sysconf(_SC_NPROCESSORS_ONLN);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -60,8 +60,8 @@ struct Test{
|
||||
};
|
||||
|
||||
struct ProgramRet{
|
||||
time_point<steady_clock> start;
|
||||
time_point<steady_clock> end;
|
||||
time_point<system_clock> start;
|
||||
time_point<system_clock> end;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@ -135,6 +135,10 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
queue<std::function<ProgramRet()>> 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){
|
||||
|
@ -1 +0,0 @@
|
||||
1
|
@ -7,7 +7,7 @@
|
||||
],
|
||||
"tests":[
|
||||
{
|
||||
"in":"1.in",
|
||||
"in":"a.in",
|
||||
"ans":"1.ans"
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user