Rewrite Using XMake
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,5 @@
|
||||
gmon.out
|
||||
build/*
|
||||
.xmake/
|
||||
.vscode/
|
||||
.devcontainer/
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@ -1,5 +0,0 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"cstring": "cpp"
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(Int2048)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(data)
|
||||
add_subdirectory(tester)
|
||||
enable_testing()
|
||||
add_test(NAME /1/1 COMMAND tester/tester -l /1/1)
|
||||
add_test(NAME /1/2 COMMAND tester/tester -l /1/2)
|
||||
add_test(NAME /1/3 COMMAND tester/tester -l /1/3)
|
||||
add_test(NAME /1/4 COMMAND tester/tester -l /1/4)
|
||||
add_test(NAME /1/5 COMMAND tester/tester -l /1/5)
|
||||
add_test(NAME /2/1 COMMAND tester/tester -l /2/1)
|
||||
add_test(NAME /2/2 COMMAND tester/tester -l /2/2)
|
||||
add_test(NAME /2/3 COMMAND tester/tester -l /2/3)
|
||||
add_test(NAME /2/4 COMMAND tester/tester -l /2/4)
|
||||
add_test(NAME /2/5 COMMAND tester/tester -l /2/5)
|
||||
add_test(NAME /2/6 COMMAND tester/tester -l /2/6)
|
||||
add_test(NAME /2/7 COMMAND tester/tester -l /2/7)
|
||||
add_test(NAME /2/8 COMMAND tester/tester -l /2/8)
|
||||
add_test(NAME /2/9 COMMAND tester/tester -l /2/9)
|
||||
add_test(NAME /2/10 COMMAND tester/tester -l /2/10)
|
||||
add_test(NAME /2/11 COMMAND tester/tester -l /2/11)
|
||||
add_test(NAME /2/12 COMMAND tester/tester -l /2/12)
|
||||
add_test(NAME /2/13 COMMAND tester/tester -l /2/13)
|
||||
add_test(NAME /2/14 COMMAND tester/tester -l /2/14)
|
||||
add_test(NAME /2/15 COMMAND tester/tester -l /2/15)
|
||||
add_test(NAME /2/16 COMMAND tester/tester -l /2/16)
|
||||
add_test(NAME /2/17 COMMAND tester/tester -l /2/17)
|
||||
add_test(NAME /2/18 COMMAND tester/tester -l /2/18)
|
||||
add_test(NAME /3/1 COMMAND tester/tester -l /3/1)
|
||||
add_test(NAME /3/2 COMMAND tester/tester -l /3/2)
|
||||
add_test(NAME /3/3 COMMAND tester/tester -l /3/3)
|
||||
set_tests_properties(/1/1 /1/2 /1/3 /1/4 /1/5 PROPERTIES LABELS Interger1)
|
||||
set_tests_properties(/2/1 /2/2 /2/3 /2/4 /2/5 /2/6 /2/7 /2/8 /2/9 /2/10 /2/11 /2/12 /2/13 /2/14 /2/15 /2/16 /2/17 /2/18 PROPERTIES LABELS Interger2)
|
@ -1 +0,0 @@
|
||||
---
|
@ -1,3 +0,0 @@
|
||||
Start testing: Nov 04 14:44 CST
|
||||
----------------------------------------------------------
|
||||
End testing: Nov 04 14:44 CST
|
@ -1,52 +0,0 @@
|
||||
set(PROJECT_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS "-O2")
|
||||
set(ENV{MAKEFLAGS} "-j16")
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
link_directories(${PROJECT_SOURCE_DIR}/src)
|
||||
add_executable(C1T1 Integer1/1.cpp)
|
||||
target_link_libraries(C1T1 int2048)
|
||||
add_executable(C1T2 Integer1/2.cpp)
|
||||
target_link_libraries(C1T2 int2048)
|
||||
add_executable(C1T3 Integer1/3.cpp)
|
||||
target_link_libraries(C1T3 int2048)
|
||||
add_executable(C1T4 Integer1/4.cpp)
|
||||
target_link_libraries(C1T4 int2048)
|
||||
add_executable(C1T5 Integer1/5.cpp)
|
||||
target_link_libraries(C1T5 int2048)
|
||||
add_executable(C2T1 Integer2/1.cpp)
|
||||
target_link_libraries(C2T1 int2048)
|
||||
add_executable(C2T2 Integer2/2.cpp)
|
||||
target_link_libraries(C2T2 int2048)
|
||||
add_executable(C2T3 Integer2/3.cpp)
|
||||
target_link_libraries(C2T3 int2048)
|
||||
add_executable(C2T4 Integer2/4.cpp)
|
||||
target_link_libraries(C2T4 int2048)
|
||||
add_executable(C2T5 Integer2/5.cpp)
|
||||
target_link_libraries(C2T5 int2048)
|
||||
add_executable(C2T6 Integer2/6.cpp)
|
||||
target_link_libraries(C2T6 int2048)
|
||||
add_executable(C2T7 Integer2/7.cpp)
|
||||
target_link_libraries(C2T7 int2048)
|
||||
add_executable(C2T8 Integer2/8.cpp)
|
||||
target_link_libraries(C2T8 int2048)
|
||||
add_executable(C2T9 Integer2/9.cpp)
|
||||
target_link_libraries(C2T9 int2048)
|
||||
add_executable(C2T10 Integer2/10.cpp)
|
||||
target_link_libraries(C2T10 int2048)
|
||||
add_executable(C2T11 Integer2/11.cpp)
|
||||
target_link_libraries(C2T11 int2048)
|
||||
add_executable(C2T12 Integer2/12.cpp)
|
||||
target_link_libraries(C2T12 int2048)
|
||||
add_executable(C2T13 Integer2/13.cpp)
|
||||
target_link_libraries(C2T13 int2048)
|
||||
add_executable(C2T14 Integer2/14.cpp)
|
||||
target_link_libraries(C2T14 int2048)
|
||||
add_executable(C2T15 Integer2/15.cpp)
|
||||
target_link_libraries(C2T15 int2048)
|
||||
add_executable(C2T16 Integer2/16.cpp)
|
||||
target_link_libraries(C2T16 int2048)
|
||||
add_executable(C2T17 Integer2/17.cpp)
|
||||
target_link_libraries(C2T17 int2048)
|
||||
add_executable(C2T18 Integer2/18.cpp)
|
||||
target_link_libraries(C2T18 int2048)
|
@ -1,5 +0,0 @@
|
||||
set(PROJECT_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS "-O2")
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
add_library(int2048 STATIC int2048.cpp)
|
@ -8,7 +8,7 @@ this script is used to test + and - operator
|
||||
|
||||
code_cpp_pre="""
|
||||
#include<iostream>
|
||||
#include "/home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/include/int2048.h"
|
||||
#include "int2048.h"
|
||||
using namespace std;
|
||||
using namespace sjtu;
|
||||
int main()
|
||||
@ -74,7 +74,7 @@ for opt in opt_cpp:
|
||||
print(opt,file=sourc_cpp)
|
||||
print(code_cpp_suf,file=sourc_cpp)
|
||||
sourc_cpp.close()
|
||||
system("g++ /tmp/1.cpp -I /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/include/ -L /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/src/ -lint2048 -o /tmp/1")
|
||||
system("g++ /tmp/1.cpp -I /workspaces/BH-int2048-2023/include -L /workspaces/BH-int2048-2023/build/linux/x86_64/release -lint2048 -o /tmp/1")
|
||||
system("/tmp/1 > /tmp/1_cpp.out")
|
||||
|
||||
sourc_python=open("/tmp/1.py","w")
|
@ -11,7 +11,7 @@ sys.set_int_max_str_digits(10000000)
|
||||
|
||||
code_cpp_pre="""
|
||||
#include<iostream>
|
||||
#include "/home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/include/int2048.h"
|
||||
#include "int2048.h"
|
||||
using namespace std;
|
||||
using namespace sjtu;
|
||||
int main()
|
||||
@ -80,7 +80,7 @@ for opt in opt_cpp:
|
||||
print(opt,file=sourc_cpp)
|
||||
print(code_cpp_suf,file=sourc_cpp)
|
||||
sourc_cpp.close()
|
||||
system("g++ /tmp/2.cpp -I /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/include/ -L /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/src/ -lint2048 -g -o /tmp/2")
|
||||
system("g++ /tmp/2.cpp -I /workspaces/BH-int2048-2023/include -L /workspaces/BH-int2048-2023/build/linux/x86_64/release -lint2048 -g -o /tmp/2")
|
||||
system("/tmp/2 > /tmp/2_cpp.out")
|
||||
|
||||
sourc_python=open("/tmp/2.py","w")
|
@ -11,7 +11,7 @@ sys.set_int_max_str_digits(10000000)
|
||||
|
||||
code_cpp_pre="""
|
||||
#include<iostream>
|
||||
#include "/home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/include/int2048.h"
|
||||
#include "int2048.h"
|
||||
using namespace std;
|
||||
using namespace sjtu;
|
||||
int main()
|
||||
@ -109,7 +109,7 @@ for opt in opt_cpp:
|
||||
print(opt,file=sourc_cpp)
|
||||
print(code_cpp_suf,file=sourc_cpp)
|
||||
sourc_cpp.close()
|
||||
system("g++ /tmp/3.cpp -I /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/include/ -L /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/src/ -lint2048 -g -fsanitize=address -o /tmp/3")
|
||||
system("g++ /tmp/3.cpp -I /workspaces/BH-int2048-2023/include -L /workspaces/BH-int2048-2023/build/linux/x86_64/release -lint2048 -g -fsanitize=address -o /tmp/3")
|
||||
system("/tmp/3 > /tmp/3_cpp.out")
|
||||
|
||||
sourc_python=open("/tmp/3.py","w")
|
32
test/config.json
Normal file
32
test/config.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"StatusInterpreter":{"0":"OK","1":"Wrong Answer","139":"Segmentation fault","137":"(Killed) maybe Time Limit Error"},
|
||||
"Cases":
|
||||
[
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C1T1 >/tmp/C1T1.out && diff -b -B -u /tmp/C1T1.out /workspaces/BH-int2048-2023/test/data/Integer1/1.out >/tmp/diffC1T1","uid":"#1","tid":"/1/1"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C1T2 </workspaces/BH-int2048-2023/test/data/Integer1/2.in >/tmp/C1T2.out && diff -b -B -u /tmp/C1T2.out /workspaces/BH-int2048-2023/test/data/Integer1/2.out >/tmp/diffC1T2","uid":"#2","tid":"/1/2"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C1T3 </workspaces/BH-int2048-2023/test/data/Integer1/3.in >/tmp/C1T3.out && diff -b -B -u /tmp/C1T3.out /workspaces/BH-int2048-2023/test/data/Integer1/3.out >/tmp/diffC1T3","uid":"#3","tid":"/1/3"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C1T4 </workspaces/BH-int2048-2023/test/data/Integer1/4.in >/tmp/C1T4.out && diff -b -B -u /tmp/C1T4.out /workspaces/BH-int2048-2023/test/data/Integer1/4.out >/tmp/diffC1T4","uid":"#4","tid":"/1/4"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C1T5 </workspaces/BH-int2048-2023/test/data/Integer1/5.in >/tmp/C1T5.out && diff -b -B -u /tmp/C1T5.out /workspaces/BH-int2048-2023/test/data/Integer1/5.out >/tmp/diffC1T5","uid":"#5","tid":"/1/5"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T1 >/tmp/C2T1.out && diff -b -B -u /tmp/C2T1.out /workspaces/BH-int2048-2023/test/data/Integer2/1.out >/tmp/diffC2T1","uid":"#11","tid":"/2/1"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T2 </workspaces/BH-int2048-2023/test/data/Integer2/2.in >/tmp/C2T2.out && diff -b -B -u /tmp/C2T2.out /workspaces/BH-int2048-2023/test/data/Integer2/2.out >/tmp/diffC2T2","uid":"#12","tid":"/2/2"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T3 </workspaces/BH-int2048-2023/test/data/Integer2/3.in >/tmp/C2T3.out && diff -b -B -u /tmp/C2T3.out /workspaces/BH-int2048-2023/test/data/Integer2/3.out >/tmp/diffC2T3","uid":"#13","tid":"/2/3"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T4 </workspaces/BH-int2048-2023/test/data/Integer2/4.in >/tmp/C2T4.out && diff -b -B -u /tmp/C2T4.out /workspaces/BH-int2048-2023/test/data/Integer2/4.out >/tmp/diffC2T4","uid":"#14","tid":"/2/4"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T5 </workspaces/BH-int2048-2023/test/data/Integer2/5.in >/tmp/C2T5.out && diff -b -B -u /tmp/C2T5.out /workspaces/BH-int2048-2023/test/data/Integer2/5.out >/tmp/diffC2T5","uid":"#15","tid":"/2/5"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T6 >/tmp/C2T6.out && diff -b -B -u /tmp/C2T6.out /workspaces/BH-int2048-2023/test/data/Integer2/6.out >/tmp/diffC2T6","uid":"#16","tid":"/2/6"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T7 >/tmp/C2T7.out && diff -b -B -u /tmp/C2T7.out /workspaces/BH-int2048-2023/test/data/Integer2/7.out >/tmp/diffC2T7","uid":"#17","tid":"/2/7"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T8 </workspaces/BH-int2048-2023/test/data/Integer2/8.in >/tmp/C2T8.out && diff -b -B -u /tmp/C2T8.out /workspaces/BH-int2048-2023/test/data/Integer2/8.out >/tmp/diffC2T8","uid":"#18","tid":"/2/8"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T9 </workspaces/BH-int2048-2023/test/data/Integer2/9.in >/tmp/C2T9.out && diff -b -B -u /tmp/C2T9.out /workspaces/BH-int2048-2023/test/data/Integer2/9.out >/tmp/diffC2T9","uid":"#19","tid":"/2/9"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T10 </workspaces/BH-int2048-2023/test/data/Integer2/10.in >/tmp/C2T10.out && diff -b -B -u /tmp/C2T10.out /workspaces/BH-int2048-2023/test/data/Integer2/10.out >/tmp/diffC2T10","uid":"#20","tid":"/2/10"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T11 </workspaces/BH-int2048-2023/test/data/Integer2/11.in >/tmp/C2T11.out && diff -b -B -u /tmp/C2T11.out /workspaces/BH-int2048-2023/test/data/Integer2/11.out >/tmp/diffC2T11","uid":"#21","tid":"/2/11"},
|
||||
{"command":"timeout -s 9 2s /workspaces/BH-int2048-2023/build/testcase/C2T12 </workspaces/BH-int2048-2023/test/data/Integer2/12.in >/tmp/C2T12.out && diff -b -B -u /tmp/C2T12.out /workspaces/BH-int2048-2023/test/data/Integer2/12.out >/tmp/diffC2T12","uid":"#22","tid":"/2/12"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T13 >/tmp/C2T13.out && diff -b -B -u /tmp/C2T13.out /workspaces/BH-int2048-2023/test/data/Integer2/13.out >/tmp/diffC2T13","uid":"#23","tid":"/2/13"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T14 >/tmp/C2T14.out && diff -b -B -u /tmp/C2T14.out /workspaces/BH-int2048-2023/test/data/Integer2/14.out >/tmp/diffC2T14","uid":"#24","tid":"/2/14"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T15 >/tmp/C2T15.out && diff -b -B -u /tmp/C2T15.out /workspaces/BH-int2048-2023/test/data/Integer2/15.out >/tmp/diffC2T15","uid":"#25","tid":"/2/15"},
|
||||
{"command":"timeout -s 9 1s /workspaces/BH-int2048-2023/build/testcase/C2T16 >/tmp/C2T16.out && diff -b -B -u /tmp/C2T16.out /workspaces/BH-int2048-2023/test/data/Integer2/16.out >/tmp/diffC2T16","uid":"#26","tid":"/2/16"},
|
||||
{"command":"timeout -s 9 2s /workspaces/BH-int2048-2023/build/testcase/C2T17 >/tmp/C2T17.out && diff -b -B -u /tmp/C2T17.out /workspaces/BH-int2048-2023/test/data/Integer2/17.out >/tmp/diffC2T17","uid":"#27","tid":"/2/17"},
|
||||
{"command":"timeout -s 9 3s /workspaces/BH-int2048-2023/build/testcase/C2T18 >/tmp/C2T18.out && diff -b -B -u /tmp/C2T18.out /workspaces/BH-int2048-2023/test/data/Integer2/18.out >/tmp/diffC2T18","uid":"#28","tid":"/2/18"},
|
||||
{"command":"/workspaces/BH-int2048-2023/test/cases/1.py","uid":"#29","tid":"/3/1"},
|
||||
{"command":"/workspaces/BH-int2048-2023/test/cases/2.py","uid":"#30","tid":"/3/2"},
|
||||
{"command":"/workspaces/BH-int2048-2023/test/cases/3.py","uid":"#31","tid":"/3/3"}
|
||||
]
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
set(PROJECT_NAME ${CMAKE_PROJECT_NAME})
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS "-O2")
|
||||
set(ENV{MAKEFLAGS} "-j16")
|
||||
include_directories(${PROJECT_SOURCE_DIR}/libs)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
link_directories(${PROJECT_SOURCE_DIR}/src)
|
||||
add_executable(tester tester.cpp)
|
||||
target_precompile_headers(tester PUBLIC ${PROJECT_SOURCE_DIR}/libs/clipp/clipp.h ${PROJECT_SOURCE_DIR}/libs/json/json.hpp)
|
||||
add_executable(proc proc.cpp)
|
||||
target_link_libraries(proc int2048)
|
@ -1,32 +0,0 @@
|
||||
{
|
||||
"StatusInterpreter":{"0":"OK","1":"Wrong Answer","139":"Segmentation fault","137":"(Killed) maybe Time Limit Error"},
|
||||
"Cases":
|
||||
[
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C1T1 >/tmp/C1T1.out && diff -b -B -u /tmp/C1T1.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/1.out >/tmp/diffC1T1","uid":"#1","tid":"/1/1"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C1T2 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/2.in >/tmp/C1T2.out && diff -b -B -u /tmp/C1T2.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/2.out >/tmp/diffC1T2","uid":"#2","tid":"/1/2"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C1T3 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/3.in >/tmp/C1T3.out && diff -b -B -u /tmp/C1T3.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/3.out >/tmp/diffC1T3","uid":"#3","tid":"/1/3"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C1T4 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/4.in >/tmp/C1T4.out && diff -b -B -u /tmp/C1T4.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/4.out >/tmp/diffC1T4","uid":"#4","tid":"/1/4"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C1T5 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/5.in >/tmp/C1T5.out && diff -b -B -u /tmp/C1T5.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer1/5.out >/tmp/diffC1T5","uid":"#5","tid":"/1/5"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T1 >/tmp/C2T1.out && diff -b -B -u /tmp/C2T1.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/1.out >/tmp/diffC2T1","uid":"#11","tid":"/2/1"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T2 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/2.in >/tmp/C2T2.out && diff -b -B -u /tmp/C2T2.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/2.out >/tmp/diffC2T2","uid":"#12","tid":"/2/2"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T3 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/3.in >/tmp/C2T3.out && diff -b -B -u /tmp/C2T3.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/3.out >/tmp/diffC2T3","uid":"#13","tid":"/2/3"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T4 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/4.in >/tmp/C2T4.out && diff -b -B -u /tmp/C2T4.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/4.out >/tmp/diffC2T4","uid":"#14","tid":"/2/4"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T5 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/5.in >/tmp/C2T5.out && diff -b -B -u /tmp/C2T5.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/5.out >/tmp/diffC2T5","uid":"#15","tid":"/2/5"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T6 >/tmp/C2T6.out && diff -b -B -u /tmp/C2T6.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/6.out >/tmp/diffC2T6","uid":"#16","tid":"/2/6"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T7 >/tmp/C2T7.out && diff -b -B -u /tmp/C2T7.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/7.out >/tmp/diffC2T7","uid":"#17","tid":"/2/7"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T8 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/8.in >/tmp/C2T8.out && diff -b -B -u /tmp/C2T8.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/8.out >/tmp/diffC2T8","uid":"#18","tid":"/2/8"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T9 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/9.in >/tmp/C2T9.out && diff -b -B -u /tmp/C2T9.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/9.out >/tmp/diffC2T9","uid":"#19","tid":"/2/9"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T10 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/10.in >/tmp/C2T10.out && diff -b -B -u /tmp/C2T10.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/10.out >/tmp/diffC2T10","uid":"#20","tid":"/2/10"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T11 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/11.in >/tmp/C2T11.out && diff -b -B -u /tmp/C2T11.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/11.out >/tmp/diffC2T11","uid":"#21","tid":"/2/11"},
|
||||
{"command":"timeout -s 9 2s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T12 </home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/12.in >/tmp/C2T12.out && diff -b -B -u /tmp/C2T12.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/12.out >/tmp/diffC2T12","uid":"#22","tid":"/2/12"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T13 >/tmp/C2T13.out && diff -b -B -u /tmp/C2T13.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/13.out >/tmp/diffC2T13","uid":"#23","tid":"/2/13"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T14 >/tmp/C2T14.out && diff -b -B -u /tmp/C2T14.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/14.out >/tmp/diffC2T14","uid":"#24","tid":"/2/14"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T15 >/tmp/C2T15.out && diff -b -B -u /tmp/C2T15.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/15.out >/tmp/diffC2T15","uid":"#25","tid":"/2/15"},
|
||||
{"command":"timeout -s 9 1s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T16 >/tmp/C2T16.out && diff -b -B -u /tmp/C2T16.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/16.out >/tmp/diffC2T16","uid":"#26","tid":"/2/16"},
|
||||
{"command":"timeout -s 9 2s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T17 >/tmp/C2T17.out && diff -b -B -u /tmp/C2T17.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/17.out >/tmp/diffC2T17","uid":"#27","tid":"/2/17"},
|
||||
{"command":"timeout -s 9 3s /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/build/data/C2T18 >/tmp/C2T18.out && diff -b -B -u /tmp/C2T18.out /home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/data/Integer2/18.out >/tmp/diffC2T18","uid":"#28","tid":"/2/18"},
|
||||
{"command":"/home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/tester/cases/1.py","uid":"#29","tid":"/3/1"},
|
||||
{"command":"/home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/tester/cases/2.py","uid":"#30","tid":"/3/2"},
|
||||
{"command":"/home/happyzym/CSWorkSpace/Proc/BigHomework/BH-int2048-2023/tester/cases/3.py","uid":"#31","tid":"/3/3"}
|
||||
]
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#include"int2048.h"
|
||||
int main()
|
||||
{
|
||||
using namespace sjtu;
|
||||
int2048 a("1234567871928347194791784918734981");
|
||||
a.print(); puts("");
|
||||
// a.UnsignedMultiplyByInt(2147483647);
|
||||
a.print(); puts("");
|
||||
return 0;
|
||||
}
|
253
xmake.lua
Normal file
253
xmake.lua
Normal file
@ -0,0 +1,253 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
target("int2048")
|
||||
set_kind("static")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("src/int2048.cpp")
|
||||
set_optimize("fastest")
|
||||
|
||||
target("test-core")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/test-core.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C1T1")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer1/1.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C1T2")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer1/2.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C1T3")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer1/3.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C1T4")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer1/4.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C1T5")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer1/5.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T1")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer2/1.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T2")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer2/2.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T3")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_includedirs("$(projectdir)/test/deps")
|
||||
add_files("test/data/Integer2/3.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T4")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/4.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T5")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/5.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T6")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/6.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T7")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/7.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T8")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/8.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T9")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/9.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T10")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/10.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T11")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/11.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T12")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/12.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T13")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/13.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T14")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/14.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T15")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/15.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T16")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/16.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T17")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/17.cpp")
|
||||
add_deps("int2048")
|
||||
|
||||
target("C2T18")
|
||||
set_kind("binary")
|
||||
set_targetdir("$(buildir)/testcase")
|
||||
add_includedirs("$(projectdir)/include")
|
||||
add_files("test/data/Integer2/18.cpp")
|
||||
add_deps("int2048")
|
||||
--
|
||||
-- If you want to known more usage about xmake, please see https://xmake.io
|
||||
--
|
||||
-- ## FAQ
|
||||
--
|
||||
-- You can enter the project directory firstly before building project.
|
||||
--
|
||||
-- $ cd projectdir
|
||||
--
|
||||
-- 1. How to build project?
|
||||
--
|
||||
-- $ xmake
|
||||
--
|
||||
-- 2. How to configure project?
|
||||
--
|
||||
-- $ xmake f -p [macosx|linux|iphoneos ..] -a [x86_64|i386|arm64 ..] -m [debug|release]
|
||||
--
|
||||
-- 3. Where is the build output directory?
|
||||
--
|
||||
-- The default output directory is `./build` and you can configure the output directory.
|
||||
--
|
||||
-- $ xmake f -o outputdir
|
||||
-- $ xmake
|
||||
--
|
||||
-- 4. How to run and debug target after building project?
|
||||
--
|
||||
-- $ xmake run [targetname]
|
||||
-- $ xmake run -d [targetname]
|
||||
--
|
||||
-- 5. How to install target to the system directory or other output directory?
|
||||
--
|
||||
-- $ xmake install
|
||||
-- $ xmake install -o installdir
|
||||
--
|
||||
-- 6. Add some frequently-used compilation flags in xmake.lua
|
||||
--
|
||||
-- @code
|
||||
-- -- add debug and release modes
|
||||
-- add_rules("mode.debug", "mode.release")
|
||||
--
|
||||
-- -- add macro definition
|
||||
-- add_defines("NDEBUG", "_GNU_SOURCE=1")
|
||||
--
|
||||
-- -- set warning all as error
|
||||
-- set_warnings("all", "error")
|
||||
--
|
||||
-- -- set language: c99, c++11
|
||||
-- set_languages("c99", "c++11")
|
||||
--
|
||||
-- -- set optimization: none, faster, fastest, smallest
|
||||
-- set_optimize("fastest")
|
||||
--
|
||||
-- -- add include search directories
|
||||
-- add_includedirs("/usr/include", "/usr/local/include")
|
||||
--
|
||||
-- -- add link libraries and search directories
|
||||
-- add_links("tbox")
|
||||
-- add_linkdirs("/usr/local/lib", "/usr/lib")
|
||||
--
|
||||
-- -- add system link libraries
|
||||
-- add_syslinks("z", "pthread")
|
||||
--
|
||||
-- -- add compilation and link flags
|
||||
-- add_cxflags("-stdnolib", "-fno-strict-aliasing")
|
||||
-- add_ldflags("-L/usr/local/lib", "-lpthread", {force = true})
|
||||
--
|
||||
-- @endcode
|
||||
--
|
||||
|
Reference in New Issue
Block a user