update
This commit is contained in:
parent
3d3d36da0d
commit
daf3d5003c
28
src/main.cpp
28
src/main.cpp
@ -1,7 +1,29 @@
|
||||
#include<bits/stdc++.h>
|
||||
#include <cstdlib>
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include<json/json.h>
|
||||
|
||||
#define AS_EQ(a,b){if((a)!=(b)){cerr<<"assert failed :"<<endl<<#a<<":"}}
|
||||
using std::cerr,std::endl,std::cout;
|
||||
|
||||
#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);}}
|
||||
#define LOG(a){cout<<"[LOG]"<<(a)<<endl;}
|
||||
#define AS_EM(a,b,m){if((a)!=(b)){cerr<<"assert eq failed :"<<endl<<#a<<":"<<(a)<<endl<<#b<<":"<<(b)<<endl<<"message:"<<(m)<<endl;exit(1);}}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
std::cout << "hello world!" << std::endl;
|
||||
LOG("Zengtudor OI test tools . loading files .. please add a json file in arg");
|
||||
LOG("arg[0]")
|
||||
LOG(argv[0])
|
||||
AS_EQ(argc,2)
|
||||
std::filesystem::path p(argv[1]);
|
||||
if (!p.is_absolute()) {
|
||||
LOG("The path is not absolute, changing it")
|
||||
p = std::filesystem::current_path()/p;
|
||||
}
|
||||
LOG("getting json files current dir")
|
||||
LOG(p.string())
|
||||
LOG("will use g++ compiler")
|
||||
LOG("checking g++ compiler version")
|
||||
int sys_ret = system("g++ --version");
|
||||
AS_EM(sys_ret,0,"get g++ --version failed")
|
||||
}
|
9
tests/main.cpp
Normal file
9
tests/main.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
string s;
|
||||
cin>>s;
|
||||
cout<<s<<endl;
|
||||
}
|
14
tests/xj.json
Normal file
14
tests/xj.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"files":[
|
||||
"main.cpp"
|
||||
],
|
||||
"args":[
|
||||
"-O3"
|
||||
],
|
||||
"tests":[
|
||||
{
|
||||
"in":"1.in",
|
||||
"ans":"1.ans"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
add_requires("jsoncpp")
|
||||
set_languages("c++17")
|
||||
|
||||
target("xj")
|
||||
set_rundir("./")
|
||||
set_kind("binary")
|
||||
add_files("src/*.cpp")
|
||||
|
||||
add_packages("jsoncpp")
|
||||
--
|
||||
-- If you want to known more usage about xmake, please see https://xmake.io
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user