From 5237e0b1dfc2f2c2d4db25851d4c7da64495ef0c Mon Sep 17 00:00:00 2001 From: ZhuangYumin Date: Wed, 17 Jan 2024 11:57:45 +0000 Subject: [PATCH] Rewrite Using XMake --- .gitignore | 5 +- .vscode/settings.json | 5 - CMakeLists.txt | 34 ---- Testing/Temporary/CTestCostData.txt | 1 - Testing/Temporary/LastTest.log | 3 - data/CMakeLists.txt | 52 ----- src/CMakeLists.txt | 5 - {tester => test}/cases/1.py | 4 +- {tester => test}/cases/2.py | 4 +- {tester => test}/cases/3.py | 4 +- test/config.json | 32 +++ {data => test/data}/Integer1/1.cpp | 0 {data => test/data}/Integer1/1.out | 0 {data => test/data}/Integer1/2.cpp | 0 {data => test/data}/Integer1/2.in | 0 {data => test/data}/Integer1/2.out | 0 {data => test/data}/Integer1/3.cpp | 0 {data => test/data}/Integer1/3.in | 0 {data => test/data}/Integer1/3.out | 0 {data => test/data}/Integer1/4.cpp | 0 {data => test/data}/Integer1/4.in | 0 {data => test/data}/Integer1/4.out | 0 {data => test/data}/Integer1/5.cpp | 0 {data => test/data}/Integer1/5.in | 0 {data => test/data}/Integer1/5.out | 0 {data => test/data}/Integer2/1.cpp | 0 {data => test/data}/Integer2/1.out | 0 {data => test/data}/Integer2/10.cpp | 0 {data => test/data}/Integer2/10.in | 0 {data => test/data}/Integer2/10.out | 0 {data => test/data}/Integer2/11.cpp | 0 {data => test/data}/Integer2/11.in | 0 {data => test/data}/Integer2/11.out | 0 {data => test/data}/Integer2/12.cpp | 0 {data => test/data}/Integer2/12.in | 0 {data => test/data}/Integer2/12.out | 0 {data => test/data}/Integer2/13.cpp | 0 {data => test/data}/Integer2/13.out | 0 {data => test/data}/Integer2/14.cpp | 0 {data => test/data}/Integer2/14.out | 0 {data => test/data}/Integer2/15.cpp | 0 {data => test/data}/Integer2/15.out | 0 {data => test/data}/Integer2/16.cpp | 0 {data => test/data}/Integer2/16.out | 0 {data => test/data}/Integer2/17.cpp | 0 {data => test/data}/Integer2/17.out | 0 {data => test/data}/Integer2/18.cpp | 0 {data => test/data}/Integer2/18.out | 0 {data => test/data}/Integer2/2.cpp | 0 {data => test/data}/Integer2/2.in | 0 {data => test/data}/Integer2/2.out | 0 {data => test/data}/Integer2/3.cpp | 0 {data => test/data}/Integer2/3.in | 0 {data => test/data}/Integer2/3.out | 0 {data => test/data}/Integer2/4.cpp | 0 {data => test/data}/Integer2/4.in | 0 {data => test/data}/Integer2/4.out | 0 {data => test/data}/Integer2/5.cpp | 0 {data => test/data}/Integer2/5.in | 0 {data => test/data}/Integer2/5.out | 0 {data => test/data}/Integer2/6.cpp | 0 {data => test/data}/Integer2/6.out | 0 {data => test/data}/Integer2/7.cpp | 0 {data => test/data}/Integer2/7.out | 0 {data => test/data}/Integer2/8.cpp | 0 {data => test/data}/Integer2/8.in | 0 {data => test/data}/Integer2/8.out | 0 {data => test/data}/Integer2/9.cpp | 0 {data => test/data}/Integer2/9.in | 0 {data => test/data}/Integer2/9.out | 0 {libs => test/deps}/clipp/clipp.h | 0 {libs => test/deps}/json/json.hpp | 0 tester/tester.cpp => test/test-core.cpp | 0 tester/CMakeLists.txt | 11 -- tester/config.json | 32 --- tester/proc.cpp | 10 - xmake.lua | 253 ++++++++++++++++++++++++ 77 files changed, 295 insertions(+), 160 deletions(-) delete mode 100644 .vscode/settings.json delete mode 100644 CMakeLists.txt delete mode 100644 Testing/Temporary/CTestCostData.txt delete mode 100644 Testing/Temporary/LastTest.log delete mode 100644 data/CMakeLists.txt delete mode 100644 src/CMakeLists.txt rename {tester => test}/cases/1.py (89%) rename {tester => test}/cases/2.py (89%) rename {tester => test}/cases/3.py (92%) create mode 100644 test/config.json rename {data => test/data}/Integer1/1.cpp (100%) rename {data => test/data}/Integer1/1.out (100%) rename {data => test/data}/Integer1/2.cpp (100%) rename {data => test/data}/Integer1/2.in (100%) rename {data => test/data}/Integer1/2.out (100%) rename {data => test/data}/Integer1/3.cpp (100%) rename {data => test/data}/Integer1/3.in (100%) rename {data => test/data}/Integer1/3.out (100%) rename {data => test/data}/Integer1/4.cpp (100%) rename {data => test/data}/Integer1/4.in (100%) rename {data => test/data}/Integer1/4.out (100%) rename {data => test/data}/Integer1/5.cpp (100%) rename {data => test/data}/Integer1/5.in (100%) rename {data => test/data}/Integer1/5.out (100%) rename {data => test/data}/Integer2/1.cpp (100%) rename {data => test/data}/Integer2/1.out (100%) rename {data => test/data}/Integer2/10.cpp (100%) rename {data => test/data}/Integer2/10.in (100%) rename {data => test/data}/Integer2/10.out (100%) rename {data => test/data}/Integer2/11.cpp (100%) rename {data => test/data}/Integer2/11.in (100%) rename {data => test/data}/Integer2/11.out (100%) rename {data => test/data}/Integer2/12.cpp (100%) rename {data => test/data}/Integer2/12.in (100%) rename {data => test/data}/Integer2/12.out (100%) rename {data => test/data}/Integer2/13.cpp (100%) rename {data => test/data}/Integer2/13.out (100%) rename {data => test/data}/Integer2/14.cpp (100%) rename {data => test/data}/Integer2/14.out (100%) rename {data => test/data}/Integer2/15.cpp (100%) rename {data => test/data}/Integer2/15.out (100%) rename {data => test/data}/Integer2/16.cpp (100%) rename {data => test/data}/Integer2/16.out (100%) rename {data => test/data}/Integer2/17.cpp (100%) rename {data => test/data}/Integer2/17.out (100%) rename {data => test/data}/Integer2/18.cpp (100%) rename {data => test/data}/Integer2/18.out (100%) rename {data => test/data}/Integer2/2.cpp (100%) rename {data => test/data}/Integer2/2.in (100%) rename {data => test/data}/Integer2/2.out (100%) rename {data => test/data}/Integer2/3.cpp (100%) rename {data => test/data}/Integer2/3.in (100%) rename {data => test/data}/Integer2/3.out (100%) rename {data => test/data}/Integer2/4.cpp (100%) rename {data => test/data}/Integer2/4.in (100%) rename {data => test/data}/Integer2/4.out (100%) rename {data => test/data}/Integer2/5.cpp (100%) rename {data => test/data}/Integer2/5.in (100%) rename {data => test/data}/Integer2/5.out (100%) rename {data => test/data}/Integer2/6.cpp (100%) rename {data => test/data}/Integer2/6.out (100%) rename {data => test/data}/Integer2/7.cpp (100%) rename {data => test/data}/Integer2/7.out (100%) rename {data => test/data}/Integer2/8.cpp (100%) rename {data => test/data}/Integer2/8.in (100%) rename {data => test/data}/Integer2/8.out (100%) rename {data => test/data}/Integer2/9.cpp (100%) rename {data => test/data}/Integer2/9.in (100%) rename {data => test/data}/Integer2/9.out (100%) rename {libs => test/deps}/clipp/clipp.h (100%) rename {libs => test/deps}/json/json.hpp (100%) rename tester/tester.cpp => test/test-core.cpp (100%) delete mode 100644 tester/CMakeLists.txt delete mode 100644 tester/config.json delete mode 100644 tester/proc.cpp create mode 100644 xmake.lua diff --git a/.gitignore b/.gitignore index 8a7551a..30cdc0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ gmon.out -build/* \ No newline at end of file +build/* +.xmake/ +.vscode/ +.devcontainer/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f66631f..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "files.associations": { - "cstring": "cpp" - } -} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 94e6f82..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -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) \ No newline at end of file diff --git a/Testing/Temporary/CTestCostData.txt b/Testing/Temporary/CTestCostData.txt deleted file mode 100644 index ed97d53..0000000 --- a/Testing/Temporary/CTestCostData.txt +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/Testing/Temporary/LastTest.log b/Testing/Temporary/LastTest.log deleted file mode 100644 index 0dc70ba..0000000 --- a/Testing/Temporary/LastTest.log +++ /dev/null @@ -1,3 +0,0 @@ -Start testing: Nov 04 14:44 CST ----------------------------------------------------------- -End testing: Nov 04 14:44 CST diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt deleted file mode 100644 index 3aea297..0000000 --- a/data/CMakeLists.txt +++ /dev/null @@ -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) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index accb036..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -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) \ No newline at end of file diff --git a/tester/cases/1.py b/test/cases/1.py similarity index 89% rename from tester/cases/1.py rename to test/cases/1.py index 5116f91..204b682 100755 --- a/tester/cases/1.py +++ b/test/cases/1.py @@ -8,7 +8,7 @@ this script is used to test + and - operator code_cpp_pre=""" #include -#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") diff --git a/tester/cases/2.py b/test/cases/2.py similarity index 89% rename from tester/cases/2.py rename to test/cases/2.py index dbc07dd..5ab8a6d 100755 --- a/tester/cases/2.py +++ b/test/cases/2.py @@ -11,7 +11,7 @@ sys.set_int_max_str_digits(10000000) code_cpp_pre=""" #include -#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") diff --git a/tester/cases/3.py b/test/cases/3.py similarity index 92% rename from tester/cases/3.py rename to test/cases/3.py index e98dcd2..8f8146b 100755 --- a/tester/cases/3.py +++ b/test/cases/3.py @@ -11,7 +11,7 @@ sys.set_int_max_str_digits(10000000) code_cpp_pre=""" #include -#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") diff --git a/test/config.json b/test/config.json new file mode 100644 index 0000000..2319987 --- /dev/null +++ b/test/config.json @@ -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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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"} + ] +} \ No newline at end of file diff --git a/data/Integer1/1.cpp b/test/data/Integer1/1.cpp similarity index 100% rename from data/Integer1/1.cpp rename to test/data/Integer1/1.cpp diff --git a/data/Integer1/1.out b/test/data/Integer1/1.out similarity index 100% rename from data/Integer1/1.out rename to test/data/Integer1/1.out diff --git a/data/Integer1/2.cpp b/test/data/Integer1/2.cpp similarity index 100% rename from data/Integer1/2.cpp rename to test/data/Integer1/2.cpp diff --git a/data/Integer1/2.in b/test/data/Integer1/2.in similarity index 100% rename from data/Integer1/2.in rename to test/data/Integer1/2.in diff --git a/data/Integer1/2.out b/test/data/Integer1/2.out similarity index 100% rename from data/Integer1/2.out rename to test/data/Integer1/2.out diff --git a/data/Integer1/3.cpp b/test/data/Integer1/3.cpp similarity index 100% rename from data/Integer1/3.cpp rename to test/data/Integer1/3.cpp diff --git a/data/Integer1/3.in b/test/data/Integer1/3.in similarity index 100% rename from data/Integer1/3.in rename to test/data/Integer1/3.in diff --git a/data/Integer1/3.out b/test/data/Integer1/3.out similarity index 100% rename from data/Integer1/3.out rename to test/data/Integer1/3.out diff --git a/data/Integer1/4.cpp b/test/data/Integer1/4.cpp similarity index 100% rename from data/Integer1/4.cpp rename to test/data/Integer1/4.cpp diff --git a/data/Integer1/4.in b/test/data/Integer1/4.in similarity index 100% rename from data/Integer1/4.in rename to test/data/Integer1/4.in diff --git a/data/Integer1/4.out b/test/data/Integer1/4.out similarity index 100% rename from data/Integer1/4.out rename to test/data/Integer1/4.out diff --git a/data/Integer1/5.cpp b/test/data/Integer1/5.cpp similarity index 100% rename from data/Integer1/5.cpp rename to test/data/Integer1/5.cpp diff --git a/data/Integer1/5.in b/test/data/Integer1/5.in similarity index 100% rename from data/Integer1/5.in rename to test/data/Integer1/5.in diff --git a/data/Integer1/5.out b/test/data/Integer1/5.out similarity index 100% rename from data/Integer1/5.out rename to test/data/Integer1/5.out diff --git a/data/Integer2/1.cpp b/test/data/Integer2/1.cpp similarity index 100% rename from data/Integer2/1.cpp rename to test/data/Integer2/1.cpp diff --git a/data/Integer2/1.out b/test/data/Integer2/1.out similarity index 100% rename from data/Integer2/1.out rename to test/data/Integer2/1.out diff --git a/data/Integer2/10.cpp b/test/data/Integer2/10.cpp similarity index 100% rename from data/Integer2/10.cpp rename to test/data/Integer2/10.cpp diff --git a/data/Integer2/10.in b/test/data/Integer2/10.in similarity index 100% rename from data/Integer2/10.in rename to test/data/Integer2/10.in diff --git a/data/Integer2/10.out b/test/data/Integer2/10.out similarity index 100% rename from data/Integer2/10.out rename to test/data/Integer2/10.out diff --git a/data/Integer2/11.cpp b/test/data/Integer2/11.cpp similarity index 100% rename from data/Integer2/11.cpp rename to test/data/Integer2/11.cpp diff --git a/data/Integer2/11.in b/test/data/Integer2/11.in similarity index 100% rename from data/Integer2/11.in rename to test/data/Integer2/11.in diff --git a/data/Integer2/11.out b/test/data/Integer2/11.out similarity index 100% rename from data/Integer2/11.out rename to test/data/Integer2/11.out diff --git a/data/Integer2/12.cpp b/test/data/Integer2/12.cpp similarity index 100% rename from data/Integer2/12.cpp rename to test/data/Integer2/12.cpp diff --git a/data/Integer2/12.in b/test/data/Integer2/12.in similarity index 100% rename from data/Integer2/12.in rename to test/data/Integer2/12.in diff --git a/data/Integer2/12.out b/test/data/Integer2/12.out similarity index 100% rename from data/Integer2/12.out rename to test/data/Integer2/12.out diff --git a/data/Integer2/13.cpp b/test/data/Integer2/13.cpp similarity index 100% rename from data/Integer2/13.cpp rename to test/data/Integer2/13.cpp diff --git a/data/Integer2/13.out b/test/data/Integer2/13.out similarity index 100% rename from data/Integer2/13.out rename to test/data/Integer2/13.out diff --git a/data/Integer2/14.cpp b/test/data/Integer2/14.cpp similarity index 100% rename from data/Integer2/14.cpp rename to test/data/Integer2/14.cpp diff --git a/data/Integer2/14.out b/test/data/Integer2/14.out similarity index 100% rename from data/Integer2/14.out rename to test/data/Integer2/14.out diff --git a/data/Integer2/15.cpp b/test/data/Integer2/15.cpp similarity index 100% rename from data/Integer2/15.cpp rename to test/data/Integer2/15.cpp diff --git a/data/Integer2/15.out b/test/data/Integer2/15.out similarity index 100% rename from data/Integer2/15.out rename to test/data/Integer2/15.out diff --git a/data/Integer2/16.cpp b/test/data/Integer2/16.cpp similarity index 100% rename from data/Integer2/16.cpp rename to test/data/Integer2/16.cpp diff --git a/data/Integer2/16.out b/test/data/Integer2/16.out similarity index 100% rename from data/Integer2/16.out rename to test/data/Integer2/16.out diff --git a/data/Integer2/17.cpp b/test/data/Integer2/17.cpp similarity index 100% rename from data/Integer2/17.cpp rename to test/data/Integer2/17.cpp diff --git a/data/Integer2/17.out b/test/data/Integer2/17.out similarity index 100% rename from data/Integer2/17.out rename to test/data/Integer2/17.out diff --git a/data/Integer2/18.cpp b/test/data/Integer2/18.cpp similarity index 100% rename from data/Integer2/18.cpp rename to test/data/Integer2/18.cpp diff --git a/data/Integer2/18.out b/test/data/Integer2/18.out similarity index 100% rename from data/Integer2/18.out rename to test/data/Integer2/18.out diff --git a/data/Integer2/2.cpp b/test/data/Integer2/2.cpp similarity index 100% rename from data/Integer2/2.cpp rename to test/data/Integer2/2.cpp diff --git a/data/Integer2/2.in b/test/data/Integer2/2.in similarity index 100% rename from data/Integer2/2.in rename to test/data/Integer2/2.in diff --git a/data/Integer2/2.out b/test/data/Integer2/2.out similarity index 100% rename from data/Integer2/2.out rename to test/data/Integer2/2.out diff --git a/data/Integer2/3.cpp b/test/data/Integer2/3.cpp similarity index 100% rename from data/Integer2/3.cpp rename to test/data/Integer2/3.cpp diff --git a/data/Integer2/3.in b/test/data/Integer2/3.in similarity index 100% rename from data/Integer2/3.in rename to test/data/Integer2/3.in diff --git a/data/Integer2/3.out b/test/data/Integer2/3.out similarity index 100% rename from data/Integer2/3.out rename to test/data/Integer2/3.out diff --git a/data/Integer2/4.cpp b/test/data/Integer2/4.cpp similarity index 100% rename from data/Integer2/4.cpp rename to test/data/Integer2/4.cpp diff --git a/data/Integer2/4.in b/test/data/Integer2/4.in similarity index 100% rename from data/Integer2/4.in rename to test/data/Integer2/4.in diff --git a/data/Integer2/4.out b/test/data/Integer2/4.out similarity index 100% rename from data/Integer2/4.out rename to test/data/Integer2/4.out diff --git a/data/Integer2/5.cpp b/test/data/Integer2/5.cpp similarity index 100% rename from data/Integer2/5.cpp rename to test/data/Integer2/5.cpp diff --git a/data/Integer2/5.in b/test/data/Integer2/5.in similarity index 100% rename from data/Integer2/5.in rename to test/data/Integer2/5.in diff --git a/data/Integer2/5.out b/test/data/Integer2/5.out similarity index 100% rename from data/Integer2/5.out rename to test/data/Integer2/5.out diff --git a/data/Integer2/6.cpp b/test/data/Integer2/6.cpp similarity index 100% rename from data/Integer2/6.cpp rename to test/data/Integer2/6.cpp diff --git a/data/Integer2/6.out b/test/data/Integer2/6.out similarity index 100% rename from data/Integer2/6.out rename to test/data/Integer2/6.out diff --git a/data/Integer2/7.cpp b/test/data/Integer2/7.cpp similarity index 100% rename from data/Integer2/7.cpp rename to test/data/Integer2/7.cpp diff --git a/data/Integer2/7.out b/test/data/Integer2/7.out similarity index 100% rename from data/Integer2/7.out rename to test/data/Integer2/7.out diff --git a/data/Integer2/8.cpp b/test/data/Integer2/8.cpp similarity index 100% rename from data/Integer2/8.cpp rename to test/data/Integer2/8.cpp diff --git a/data/Integer2/8.in b/test/data/Integer2/8.in similarity index 100% rename from data/Integer2/8.in rename to test/data/Integer2/8.in diff --git a/data/Integer2/8.out b/test/data/Integer2/8.out similarity index 100% rename from data/Integer2/8.out rename to test/data/Integer2/8.out diff --git a/data/Integer2/9.cpp b/test/data/Integer2/9.cpp similarity index 100% rename from data/Integer2/9.cpp rename to test/data/Integer2/9.cpp diff --git a/data/Integer2/9.in b/test/data/Integer2/9.in similarity index 100% rename from data/Integer2/9.in rename to test/data/Integer2/9.in diff --git a/data/Integer2/9.out b/test/data/Integer2/9.out similarity index 100% rename from data/Integer2/9.out rename to test/data/Integer2/9.out diff --git a/libs/clipp/clipp.h b/test/deps/clipp/clipp.h similarity index 100% rename from libs/clipp/clipp.h rename to test/deps/clipp/clipp.h diff --git a/libs/json/json.hpp b/test/deps/json/json.hpp similarity index 100% rename from libs/json/json.hpp rename to test/deps/json/json.hpp diff --git a/tester/tester.cpp b/test/test-core.cpp similarity index 100% rename from tester/tester.cpp rename to test/test-core.cpp diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt deleted file mode 100644 index cd862a7..0000000 --- a/tester/CMakeLists.txt +++ /dev/null @@ -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) \ No newline at end of file diff --git a/tester/config.json b/tester/config.json deleted file mode 100644 index ae71f03..0000000 --- a/tester/config.json +++ /dev/null @@ -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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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 /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"} - ] -} \ No newline at end of file diff --git a/tester/proc.cpp b/tester/proc.cpp deleted file mode 100644 index 09efbd0..0000000 --- a/tester/proc.cpp +++ /dev/null @@ -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; -} \ No newline at end of file diff --git a/xmake.lua b/xmake.lua new file mode 100644 index 0000000..7ceb286 --- /dev/null +++ b/xmake.lua @@ -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 +-- +