From eb8284e82de1413e7e1aa20fa3bedbdf83fcd350 Mon Sep 17 00:00:00 2001 From: SPeak Date: Sun, 15 Sep 2024 23:42:33 +0800 Subject: [PATCH] use xlings build/manager (#40) * use xlings build/manager * update * update * update readme * update readme * rm tools and courses --- .gitignore | 3 +- .gitmodules | 6 +- README.md | 33 +-- book/src/Instroduction.md | 12 +- book/src/chapter_06_embedded_dlist.md | 6 +- book/src/dslings.md | 8 +- book/src/other/1_cpp_base.template.md | 6 +- book/src/other/2_cpp_base.rangefor.md | 4 +- common/d2ds.lua | 48 ---- common/dslings.lua | 262 ------------------ config.xlings | 4 + courses | 1 - {common => dslings/common}/common.hpp | 4 +- {common => dslings/common}/dslings_config.hpp | 0 {common => dslings/common}/honly_logger.hpp | 0 dstruct => dslings/dstruct | 0 dslings/exercises/dslings.hpp | 1 - dslings/tests/array/array.0.cpp | 2 +- dslings/tests/array/array.1.cpp | 2 +- dslings/tests/array/array.2.cpp | 2 +- dslings/tests/array/array.3.cpp | 2 +- dslings/tests/array/array.4.cpp | 2 +- dslings/tests/array/array.5.cpp | 2 +- dslings/tests/array/array.6.cpp | 2 +- dslings/tests/dslings.0.cpp | 2 +- dslings/tests/dslings.1.cpp | 2 +- dslings/tests/dslings.2.cpp | 2 +- .../tests/embedded-list/embedded-dlist.0.cpp | 2 +- .../tests/embedded-list/embedded-dlist.1.cpp | 2 +- .../tests/embedded-list/embedded-dlist.2.cpp | 2 +- .../tests/embedded-list/embedded-dlist.3.cpp | 2 +- .../tests/embedded-list/embedded-dlist.4.cpp | 2 +- .../tests/embedded-list/embedded-slist.0.cpp | 2 +- .../tests/embedded-list/embedded-slist.1.cpp | 2 +- .../tests/embedded-list/embedded-slist.2.cpp | 2 +- .../tests/embedded-list/embedded-slist.3.cpp | 2 +- .../tests/embedded-list/embedded-slist.4.cpp | 2 +- dslings/tests/other/cpp-base/range_for.0.cpp | 2 +- dslings/tests/other/cpp-base/range_for.1.cpp | 2 +- dslings/tests/other/cpp-base/range_for.2.cpp | 2 +- dslings/tests/other/cpp-base/range_for.3.cpp | 2 +- dslings/tests/other/cpp-base/template.0.cpp | 2 +- dslings/tests/other/cpp-base/template.1.cpp | 2 +- dslings/tests/other/cpp-base/template.2.cpp | 2 +- dslings/tests/slinked-list/slist.0.cpp | 2 +- dslings/tests/slinked-list/slist.1.cpp | 2 +- dslings/tests/slinked-list/slist.2.cpp | 2 +- dslings/tests/slinked-list/slist.3.cpp | 2 +- dslings/tests/slinked-list/slist.4.cpp | 2 +- dslings/tests/slinked-list/slist.5.cpp | 2 +- dslings/tests/slinked-list/slist.6.cpp | 2 +- dslings/tests/slinked-list/slist.7.cpp | 2 +- dslings/tests/slinked-list/slist.8.cpp | 2 +- dslings/tests/slinked-list/slist.it.0.cpp | 2 +- dslings/tests/slinked-list/slist.it.1.cpp | 2 +- dslings/tests/slinked-list/slist.it.2.cpp | 2 +- dslings/tests/slinked-list/slist.it.3.cpp | 2 +- dslings/tests/slinked-list/slist.it.4.cpp | 2 +- dslings/tests/slinked-list/slist.it.5.cpp | 2 +- dslings/tests/vector/vector.0.0.cpp | 2 +- dslings/tests/vector/vector.0.1.cpp | 2 +- dslings/tests/vector/vector.0.cpp | 2 +- dslings/tests/vector/vector.1.0.cpp | 2 +- dslings/tests/vector/vector.1.1.cpp | 2 +- dslings/tests/vector/vector.1.2.cpp | 2 +- dslings/tests/vector/vector.1.cpp | 2 +- dslings/tests/vector/vector.2.cpp | 2 +- dslings/tests/vector/vector.3.0.cpp | 2 +- dslings/tests/vector/vector.3.cpp | 2 +- dslings/tests/vector/vector.4.cpp | 2 +- dslings/tests/vector/vector.5.cpp | 2 +- dslings/xmake.lua | 8 + tools/clear_screen.bat | 2 - tools/install.unix.sh | 41 --- tools/install.win.bat | 80 ------ xmake.lua | 34 --- 76 files changed, 102 insertions(+), 569 deletions(-) delete mode 100644 common/d2ds.lua delete mode 100644 common/dslings.lua create mode 100644 config.xlings delete mode 160000 courses rename {common => dslings/common}/common.hpp (97%) rename {common => dslings/common}/dslings_config.hpp (100%) rename {common => dslings/common}/honly_logger.hpp (100%) rename dstruct => dslings/dstruct (100%) delete mode 100644 tools/clear_screen.bat delete mode 100755 tools/install.unix.sh delete mode 100644 tools/install.win.bat delete mode 100644 xmake.lua diff --git a/.gitignore b/.gitignore index 286ed3b..18e5c6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .xmake build -.vscode \ No newline at end of file +.vscode +.xlings \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 46662c6..99943a7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ [submodule "dstruct"] - path = dstruct + path = dslings/dstruct url = https://github.com/Sunrisepeak/DStruct - -[submodule "courses"] - path = courses - url = git@github.com:Sunrisepeak/d2ds-courses.git diff --git a/README.md b/README.md index 5424612..681e751 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Dive into Data Structures - 强调**动手实践**的**数据结构**学习项 | ------------------------------------------------------------ | | [d2ds-book](https://sunrisepeak.github.io/d2ds) - [d2ds-courses](https://sunrisepeak.github.io/d2ds-courses) - [d2ds-dslings](dslings) - [dstruct](https://github.com/Sunrisepeak/dstruct) | +**项目已经使用xlings重构 - 文档待更新** + --- ## 目标 @@ -30,38 +32,29 @@ Dive into Data Structures - 强调**动手实践**的**数据结构**学习项 ## d2ds-dslings | 练习 -通过使用dslings自动化检测的**编译器驱动开发模式**来进行代码练习 - -[环境配置&使用指南](book/src/dslings.md) - -```bash -git clone --recursive git@github.com:Sunrisepeak/d2ds.git -``` +通过使用[xlings](https://github.com/d2learn/xlings)下载项目并运行自动化检测的**编译器驱动开发模式**来进行代码练习 -### 配置环境 +> 注: [xlings安装文档](https://github.com/d2learn/xlings) -**linux/macos** - -> 使用bash执行tools目录下的安装脚本 +### 获取练习代码 ```bash -bash tools/install.unix.sh +xlings drepo d2ds ``` -**windows** +### 执行dslings进入练习 -> 执行tools目录下的安装脚本 或 直接双击运行 +> 进入d2ds目录, 执行dslings开始练习 ```bash -tools\install.win.bat +cd d2ds +xlings dslings ``` -### 执行dslings进入练习 - -> 更多详情见[dslings使用指南](book/src/dslings.md) +### 打开电子书 ```bash -xmake dslings +xlings book ``` ## 社区 | 交流 @@ -86,4 +79,4 @@ xmake dslings - **参与社区交流:** 反馈问题、参与社区问题讨论 - **参与项目开发:** 通过[开发看板](https://github.com/users/Sunrisepeak/projects/10), 参与社区中问题处理、修复Bug、开发&优化新功能/模块 -- **参与知识库的建设:** 对d2ds中的一些内容做技术解读, 丰富知识库, 以至于帮助到更多同学 +- **参与[知识库](https://github.com/Sunrisepeak/d2ds/issues/32)的建设:** 对d2ds中的一些内容做技术解读, 丰富知识库, 以至于帮助到更多同学 diff --git a/book/src/Instroduction.md b/book/src/Instroduction.md index 61e8046..f52f47c 100644 --- a/book/src/Instroduction.md +++ b/book/src/Instroduction.md @@ -19,7 +19,7 @@ - dslings自动检测 - 错误提示 - 代码通过提示 - - D2DS_WAIT - dslings等待标志 + - XLINGS_WAIT - dslings等待标志 - 总结 --- @@ -83,7 +83,7 @@ int main() { d2ds_assert_eq(mVal.get(), maxVal); - D2DS_WAIT + XLINGS_WAIT return 0; } @@ -106,7 +106,7 @@ Output: [D2DS LOGI]: - ✅ | mVal.get() == 2 (2 == 2) [D2DS LOGI]: - ✅ | mVal.get() == 100 (100 == 100) [D2DS LOGI]: - ✅ | mVal.get() == maxVal (191 == 191) -[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the D2DS_WAIT to continue... +[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the XLINGS_WAIT to continue... ==================== @@ -328,15 +328,15 @@ Book: https://sunrisepeak.github.io/d2ds ``` -**D2DS_WAIT - dslings等待标志** +**XLINGS_WAIT - dslings等待标志** 当完整完成一个小节的练习的时候, dslings检测程序会进入等待状态, 并且打印出类似如下的提示消息 ```bash -[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the D2DS_WAIT to continue... +[D2DS LOGW]: main: tests/dslings.2.cpp:46 - Delete the XLINGS_WAIT to continue... ``` -按照消息中给出的文件地址, 选择注释掉(或删除)程序中的`D2DS_WAIT`标志, dslings就会进入下一个练习并开启自动检测 +按照消息中给出的文件地址, 选择注释掉(或删除)程序中的`XLINGS_WAIT`标志, dslings就会进入下一个练习并开启自动检测 ## 总结 diff --git a/book/src/chapter_06_embedded_dlist.md b/book/src/chapter_06_embedded_dlist.md index c30728b..28879ea 100644 --- a/book/src/chapter_06_embedded_dlist.md +++ b/book/src/chapter_06_embedded_dlist.md @@ -191,7 +191,7 @@ int main() { d2ds_assert(head.next == &head); - D2DS_WAIT + XLINGS_WAIT return 0; } @@ -270,7 +270,7 @@ int main() { d2ds_assert(head.next == &head); - D2DS_WAIT + XLINGS_WAIT return 0; } @@ -363,7 +363,7 @@ int main() { d2ds_assert(head.next() == &head); - D2DS_WAIT + XLINGS_WAIT return 0; } diff --git a/book/src/dslings.md b/book/src/dslings.md index 21cc914..4502f56 100644 --- a/book/src/dslings.md +++ b/book/src/dslings.md @@ -111,7 +111,7 @@ int main() { HONLY_LOGI_P("Hello D2DS!"); - D2DS_WAIT + XLINGS_WAIT return 0; } @@ -134,14 +134,14 @@ Output: ==================== [D2DS LOGI]: - ✅ | mVal.get() == 2 (2 == 2) [D2DS LOGI]: - Hello D2DS! -[D2DS LOGW]: main: tests/dslings.0.cpp:26 - 🥳 Delete the D2DS_WAIT to continue... +[D2DS LOGW]: main: tests/dslings.0.cpp:26 - 🥳 Delete the XLINGS_WAIT to continue... ==================== Homepage: https://github.com/Sunrisepeak/d2ds-courses ``` -### 第四步: 注释D2DS_WAIT, 进入下一个练习 +### 第四步: 注释XLINGS_WAIT, 进入下一个练习 根据dslings在控制台的提示信息, 找到`tests/dslings.0.cpp:26`, 并进行注释或者删除。 dslings就会进入下一个练习并进行检测 @@ -155,7 +155,7 @@ int main() { HONLY_LOGI_P("Hello D2DS!"); - D2DS_WAIT + XLINGS_WAIT return 0; } diff --git a/book/src/other/1_cpp_base.template.md b/book/src/other/1_cpp_base.template.md index c9d418c..3e97106 100644 --- a/book/src/other/1_cpp_base.template.md +++ b/book/src/other/1_cpp_base.template.md @@ -84,7 +84,7 @@ Output: [D2DS LOGI]: - ✅ | d2ds::max(a, b) == dstruct::max(a, b) (1 == 1) [D2DS LOGI]: - ✅ | d2ds::max(a, b) == dstruct::max(a, b) (4294967295 == 4294967295) [D2DS LOGI]: - ✅ | d2ds::max(a, b) == dstruct::max(a, b) (3.100000 == 3.100000) -[D2DS LOGW]: main: tests/other/cpp-base/template.0.cpp:35 - Delete the D2DS_WAIT to continue... +[D2DS LOGW]: main: tests/other/cpp-base/template.0.cpp:35 - Delete the XLINGS_WAIT to continue... ==================== @@ -191,7 +191,7 @@ int main() { d2ds_assert(box.get_value() == dstruct::String("Hello, d2ds!")); } - D2DS_WAIT + XLINGS_WAIT return 0; } @@ -212,7 +212,7 @@ Output: ==================== [D2DS LOGI]: - ✅ | box.get_value() == 2 (2 == 2) [D2DS LOGI]: - ✅ | box.get_value() == dstruct::String("Hello, d2ds!") -[D2DS LOGW]: main: tests/other/cpp-base/template.2.cpp:33 - Delete the D2DS_WAIT to continue... +[D2DS LOGW]: main: tests/other/cpp-base/template.2.cpp:33 - Delete the XLINGS_WAIT to continue... ==================== diff --git a/book/src/other/2_cpp_base.rangefor.md b/book/src/other/2_cpp_base.rangefor.md index 26cd5e6..45bad60 100644 --- a/book/src/other/2_cpp_base.rangefor.md +++ b/book/src/other/2_cpp_base.rangefor.md @@ -192,7 +192,7 @@ int main() { } } - D2DS_WAIT + XLINGS_WAIT return 0; } @@ -244,7 +244,7 @@ Output: [D2DS LOGI]: - ✅ | val == index (35 == 35) [D2DS LOGI]: - ✅ | val == index (40 == 40) [D2DS LOGI]: - ✅ | val == index (45 == 45) -[D2DS LOGW]: main: tests/other/cpp-base/range_for.3.cpp:35 - Delete the D2DS_WAIT to continue... +[D2DS LOGW]: main: tests/other/cpp-base/range_for.3.cpp:35 - Delete the XLINGS_WAIT to continue... ==================== diff --git a/common/d2ds.lua b/common/d2ds.lua deleted file mode 100644 index b6bbea7..0000000 --- a/common/d2ds.lua +++ /dev/null @@ -1,48 +0,0 @@ -import("core.base.option") - -local d2ds_repo = "https://github.com/Sunrisepeak/d2ds" - -function d2ds_useage() - print("Useage\n") - --d2ds - print("$ xmake d2ds [update | info | help]") - print("\ncommand list:") - print("\tupdate\t sync/update d2ds's repository code") - print("\tinfo\t version info") - print("\thelp\t useage...") - --dsligs - print("") - print("$ xmake dslings [command] [target_name]") - print("\ncommand list:") - print("\t-s, target_name\t execute from target_name(support fuzzy match)") -end - -function d2ds_info() - print("d2ds version: pre-v0.0.1") - print("dslings version: pre-v0.0.1") - print(string.format("repo: %s", d2ds_repo)) -end - -function sync_repo() - cmd = string.format("git pull %s main --rebase", d2ds_repo) - print("start sync mian-repo...") - os.exec(cmd) - print("start update submodule...") - os.exec("git submodule init") - os.exec("git submodule update") -end - -function main() - local command = option.get("command") - if command == "update" then - sync_repo() - elseif command == "help" then - d2ds_useage(); - elseif command == "info" then - d2ds_info(); - else - d2ds_info(); - print("--------------------------------------") - d2ds_useage(); - end -end \ No newline at end of file diff --git a/common/dslings.lua b/common/dslings.lua deleted file mode 100644 index ff657cb..0000000 --- a/common/dslings.lua +++ /dev/null @@ -1,262 +0,0 @@ -import("core.project.project") -import("core.project.target") -import("core.base.global") -import("core.base.option") - --- TODO: optimze -target_to_code_file = { - ["0.dslings-0"] = "dslings/exercises/dslings.hpp", - ["0.dslings-1"] = "dslings/exercises/dslings.hpp", - ["0.dslings-2"] = "dslings/exercises/dslings.hpp", - ["1.template-0"] = "dslings/exercises/other/cpp-base/Template.hpp", - ["1.template-1"] = "dslings/exercises/other/cpp-base/Template.hpp", - ["1.template-2"] = "dslings/exercises/other/cpp-base/Template.hpp", - ["2.range_for-0"] = "dslings/exercises/other/cpp-base/RangeFor.hpp", - ["2.range_for-1"] = "dslings/exercises/other/cpp-base/RangeFor.hpp", - ["2.range_for-2"] = "dslings/exercises/other/cpp-base/RangeFor.hpp", - ["2.range_for-3"] = "dslings/exercises/other/cpp-base/RangeFor.hpp", - ["3.array-0"] = "dslings/exercises/array/Array.hpp", - ["3.array-1"] = "dslings/exercises/array/Array.hpp", - ["3.array-2"] = "dslings/exercises/array/Array.hpp", - ["3.array-3"] = "dslings/exercises/array/Array.hpp", - ["3.array-4"] = "dslings/exercises/array/Array.hpp", - ["3.array-5"] = "dslings/exercises/array/Array.hpp", - ["3.array-6"] = "dslings/exercises/array/Array.hpp", - ["4.vector-0-0"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-0-1"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-0-all"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-1-0"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-1-1"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-1-2"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-1-all"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-2"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-3-0"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-3-all"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-4"] = "dslings/exercises/array/Vector.hpp", - ["4.vector-5"] = "dslings/exercises/array/Vector.hpp", - ["5.embedded-slist-0"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["5.embedded-slist-1"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["5.embedded-slist-2"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["5.embedded-slist-3"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["5.embedded-slist-4"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["6.slinked-list-0"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-1"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-2"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-3"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-4"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-5"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-6"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-7"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["6.slinked-list-8"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["7.slinked-list-iterator-0"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["7.slinked-list-iterator-1"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["7.slinked-list-iterator-2"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["7.slinked-list-iterator-3"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["7.slinked-list-iterator-4"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["7.slinked-list-iterator-5"] = "dslings/exercises/linked-list/SLinkedList.hpp", - ["8.embedded-dlist-0"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["8.embedded-dlist-1"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["8.embedded-dlist-2"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["8.embedded-dlist-3"] = "dslings/exercises/linked-list/EmbeddedList.hpp", - ["8.embedded-dlist-4"] = "dslings/exercises/linked-list/EmbeddedList.hpp", -} - -function clear_screen() - if os.host() == "windows" then - os.exec("tools\\clear_screen.bat") - else - os.exec("clear") - end -end - -function print_info(target_name, built_targets, total_targets, current_file_path, output, status) - - clear_screen() - - -- print progress_bar - local progress_bar_length = total_targets - local arrow_count = built_targets - local dash_count = progress_bar_length - arrow_count - local progress_bar = string.format( - "🌏Progress: [%s>%s] %d/%d", - string.rep("=", arrow_count), - string.rep("-", dash_count), - arrow_count, progress_bar_length - ) - print(progress_bar) - - print(string.format("\n[Target: %s]\n", target_name)) - - -- print status - if status then - print(string.format("✅ Successfully ran %s!", current_file_path)) - print("\n🎉 The code is compiling! 🎉\n") - else - print(string.format("❌ Error: Compilation/Running failed for %s:", current_file_path)) - print("\n The code exist some error!\n") - end - - -- print output - print("Output:") - print("====================") - print(output) - print("====================") - - print("\nHomepage: https://github.com/Sunrisepeak/d2ds-courses") -end - -function build_with_error_handling(target) - local output, err - local build_success = true - - try - { - function() - os.iorunv("xmake", {"build", target}) - --os.iorunv("xmake", {"build", "-v", name}) - end, - catch - { - -- After an exception occurs, it is executed - function (e) - output = e - build_success = false - end - } - } - - return output, build_success -end - --- TODO: optimze capture stdout + stderr -function run_with_error_handling(target) - local output, err - local run_success = true - - try { - function () - output, err = os.iorunv("xmake", {"r", target}, {timeout = 2000}) - end, - catch - { - function (e) - output = e.stdout .. e.stderr -- .. e.errors - run_success = false - end - }, -[[-- - finally { - function (ok, outdata, errdata) - output = outdata .. errdata - end - } ---]] - } - - return output, run_success -end - --- main start -function main() - local checker_pass = false - local start_target = option.get("start_target") - - clear_screen() - - local base_dir = os.projectdir() - - -- 获取 project 中所有 target - local targets = project.targets() - --local targets = {"d2ds_array", "d2ds_array1"} - --local total_targets = #targets -- - -- TODO: optimize total_targets - local total_targets = 0 - local built_targets = 0 - local sorted_targets = {} - for name, _ in pairs(targets) do - total_targets = total_targets + 1 - table.insert(sorted_targets, name) - end - - table.sort(sorted_targets) - - local skip = true - for _, name in pairs(sorted_targets) do - - if skip and (name == start_target or string.find(name, start_target)) then - skip = false; - end - - if not skip then - local files = targets[name]:sourcefiles() - for _, file in ipairs((files)) do - local relative_path = path.relative(file, base_dir) - local build_success = false - local sleep_sec = 1000 * 0.1 - local output = "" - - local file_modify_time - local compile_bypass_counter = 0 - - while not build_success do - local curr_file_mtime = os.mtime(file) - if target_to_code_file[name] then - curr_file_mtime = curr_file_mtime + os.mtime(target_to_code_file[name]) - end - - if file_modify_time ~= curr_file_mtime then - --build_success = task.run("build", {target = name}) - build_success = true - - output, build_success = build_with_error_handling(name) - - if build_success then - output, build_success = run_with_error_handling(name) - end - - local status = build_success - - if type(output) == "string" then - if string.find(output, "❌") then - status = false - build_success = false - elseif string.find(output, "D2DS_WAIT") or string.find(output, "D2DS_RETURN") then - build_success = false - end - end - - if build_success then - built_targets = built_targets + 1 - else - sleep_sec = 1000 * 1 - end - - print_info(name, built_targets, total_targets, relative_path, output, status) - output = "" - else - compile_bypass_counter = compile_bypass_counter + 1 - end - - file_modify_time = curr_file_mtime - if compile_bypass_counter > 20 then - compile_bypass_counter = 0 - file_modify_time = nil - end - os.sleep(sleep_sec) - - end - end - else - built_targets = built_targets + 1 - end - end - - local bingo = "\ - Bingo! 🎉🎉🎉\n \ -You have completed all exercises\n \ -Next: https://github.com/Sunrisepeak/dstruct\ -" - - print_info("D2DS", total_targets, total_targets, "...", bingo, true) - -end \ No newline at end of file diff --git a/config.xlings b/config.xlings new file mode 100644 index 0000000..0ae2810 --- /dev/null +++ b/config.xlings @@ -0,0 +1,4 @@ +xlings_name = "dslings" +xlings_lang = "cpp" +xlings_editor = "vscode" +--xlings_llm_config = ".xlings/llm.config.xlings" \ No newline at end of file diff --git a/courses b/courses deleted file mode 160000 index e77302f..0000000 --- a/courses +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e77302ffa59088f3677c669ef86087d5d3e033f2 diff --git a/common/common.hpp b/dslings/common/common.hpp similarity index 97% rename from common/common.hpp rename to dslings/common/common.hpp index ff5c645..2feaa38 100644 --- a/common/common.hpp +++ b/dslings/common/common.hpp @@ -35,8 +35,8 @@ } \ } -#define D2DS_WAIT HONLY_LOGW("🥳 Delete the D2DS_WAIT to continue..."); -#define D2DS_RETURN HONLY_LOGW("🥳 Delete the D2DS_RETURN to continue..."); return 0; +#define XLINGS_WAIT HONLY_LOGW("🥳 Delete the XLINGS_WAIT to continue..."); +#define D2DS_RETURN HONLY_LOGW("🥳 Delete the XLINGS_RETURN to continue..."); return 0; #define D2DS_SELF_ASSIGNMENT_CHECKER if (this == &dsObj) return *this; diff --git a/common/dslings_config.hpp b/dslings/common/dslings_config.hpp similarity index 100% rename from common/dslings_config.hpp rename to dslings/common/dslings_config.hpp diff --git a/common/honly_logger.hpp b/dslings/common/honly_logger.hpp similarity index 100% rename from common/honly_logger.hpp rename to dslings/common/honly_logger.hpp diff --git a/dstruct b/dslings/dstruct similarity index 100% rename from dstruct rename to dslings/dstruct diff --git a/dslings/exercises/dslings.hpp b/dslings/exercises/dslings.hpp index 7cbd060..247f9a7 100644 --- a/dslings/exercises/dslings.hpp +++ b/dslings/exercises/dslings.hpp @@ -5,7 +5,6 @@ namespace d2ds { // show your code - /* class MaxValue { public: diff --git a/dslings/tests/array/array.0.cpp b/dslings/tests/array/array.0.cpp index 3bc6d28..4ddbe41 100644 --- a/dslings/tests/array/array.0.cpp +++ b/dslings/tests/array/array.0.cpp @@ -17,7 +17,7 @@ int main() { d2ds::Array intArr; d2ds::Array doubleArr; - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/array/array.1.cpp b/dslings/tests/array/array.1.cpp index af5f163..f4597aa 100644 --- a/dslings/tests/array/array.1.cpp +++ b/dslings/tests/array/array.1.cpp @@ -16,7 +16,7 @@ int main() { d2ds::Array intArr { 5, 4, 3, 2 /*, 1*/ }; - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/array/array.2.cpp b/dslings/tests/array/array.2.cpp index 21a570c..5354cf6 100644 --- a/dslings/tests/array/array.2.cpp +++ b/dslings/tests/array/array.2.cpp @@ -51,7 +51,7 @@ int main() { d2ds_assert(BigFiveTest::destructor()); //BigFiveTest::print_status(); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/array/array.3.cpp b/dslings/tests/array/array.3.cpp index fb129c2..e394803 100644 --- a/dslings/tests/array/array.3.cpp +++ b/dslings/tests/array/array.3.cpp @@ -24,7 +24,7 @@ int main() { intArr[4] = intArr[0]; d2ds_assert_eq(intArr[0], intArr[4]); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/array/array.4.cpp b/dslings/tests/array/array.4.cpp index 7bd1a25..80275b7 100644 --- a/dslings/tests/array/array.4.cpp +++ b/dslings/tests/array/array.4.cpp @@ -22,7 +22,7 @@ int main() { d2ds_assert_eq(4, intArr.back()); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/array/array.5.cpp b/dslings/tests/array/array.5.cpp index b0d3bba..4bad937 100644 --- a/dslings/tests/array/array.5.cpp +++ b/dslings/tests/array/array.5.cpp @@ -24,7 +24,7 @@ int main() { val++; } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/array/array.6.cpp b/dslings/tests/array/array.6.cpp index e9d46ac..7beebb5 100644 --- a/dslings/tests/array/array.6.cpp +++ b/dslings/tests/array/array.6.cpp @@ -22,7 +22,7 @@ int main() { d2ds_assert_eq(intArr[2], intArr[-2]); d2ds_assert_eq(intArr[3], intArr[-1]); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/dslings.0.cpp b/dslings/tests/dslings.0.cpp index c75a3d4..a996f57 100644 --- a/dslings/tests/dslings.0.cpp +++ b/dslings/tests/dslings.0.cpp @@ -23,7 +23,7 @@ int main() { HONLY_LOGI_P("Hello D2DS!"); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/dslings.1.cpp b/dslings/tests/dslings.1.cpp index e640feb..98b01f8 100644 --- a/dslings/tests/dslings.1.cpp +++ b/dslings/tests/dslings.1.cpp @@ -27,7 +27,7 @@ int main() { mVal.set(100); d2ds_assert_eq(mVal.get(), 100); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/dslings.2.cpp b/dslings/tests/dslings.2.cpp index 67f4071..67e5c79 100644 --- a/dslings/tests/dslings.2.cpp +++ b/dslings/tests/dslings.2.cpp @@ -43,7 +43,7 @@ int main() { d2ds_assert_eq(mVal.get(), maxVal); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-dlist.0.cpp b/dslings/tests/embedded-list/embedded-dlist.0.cpp index 4dc75c1..ebe0610 100644 --- a/dslings/tests/embedded-list/embedded-dlist.0.cpp +++ b/dslings/tests/embedded-list/embedded-dlist.0.cpp @@ -19,7 +19,7 @@ int main() { d2ds::DoublyLink::init(&dLink); d2ds_assert(dLink.next == dLink.prev); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-dlist.1.cpp b/dslings/tests/embedded-list/embedded-dlist.1.cpp index cb76d82..8f9f4cc 100644 --- a/dslings/tests/embedded-list/embedded-dlist.1.cpp +++ b/dslings/tests/embedded-list/embedded-dlist.1.cpp @@ -34,7 +34,7 @@ int main() { d2ds_assert_eq(cnt, 10); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-dlist.2.cpp b/dslings/tests/embedded-list/embedded-dlist.2.cpp index 4e89667..388c5d7 100644 --- a/dslings/tests/embedded-list/embedded-dlist.2.cpp +++ b/dslings/tests/embedded-list/embedded-dlist.2.cpp @@ -66,7 +66,7 @@ int main() { d2ds_assert(head.next == &head); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-dlist.3.cpp b/dslings/tests/embedded-list/embedded-dlist.3.cpp index 83af781..79c16fe 100644 --- a/dslings/tests/embedded-list/embedded-dlist.3.cpp +++ b/dslings/tests/embedded-list/embedded-dlist.3.cpp @@ -63,7 +63,7 @@ int main() { d2ds_assert(head.next == &head); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-dlist.4.cpp b/dslings/tests/embedded-list/embedded-dlist.4.cpp index ed8e4e4..ed7d112 100644 --- a/dslings/tests/embedded-list/embedded-dlist.4.cpp +++ b/dslings/tests/embedded-list/embedded-dlist.4.cpp @@ -77,7 +77,7 @@ int main() { d2ds_assert(head.next() == &head); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-slist.0.cpp b/dslings/tests/embedded-list/embedded-slist.0.cpp index 08bb624..5cb8c01 100644 --- a/dslings/tests/embedded-list/embedded-slist.0.cpp +++ b/dslings/tests/embedded-list/embedded-slist.0.cpp @@ -17,7 +17,7 @@ int main() { d2ds_assert_eq(sizeof(d2ds::SinglyLink), 8); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-slist.1.cpp b/dslings/tests/embedded-list/embedded-slist.1.cpp index 01533c0..cc87169 100644 --- a/dslings/tests/embedded-list/embedded-slist.1.cpp +++ b/dslings/tests/embedded-list/embedded-slist.1.cpp @@ -35,7 +35,7 @@ int main() { d2ds_assert_eq(cnt, 10); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-slist.2.cpp b/dslings/tests/embedded-list/embedded-slist.2.cpp index 1dbb42e..13e494c 100644 --- a/dslings/tests/embedded-list/embedded-slist.2.cpp +++ b/dslings/tests/embedded-list/embedded-slist.2.cpp @@ -41,7 +41,7 @@ int main() { d2ds_assert_eq(cnt, 5); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-slist.3.cpp b/dslings/tests/embedded-list/embedded-slist.3.cpp index eafead3..e7ada72 100644 --- a/dslings/tests/embedded-list/embedded-slist.3.cpp +++ b/dslings/tests/embedded-list/embedded-slist.3.cpp @@ -44,7 +44,7 @@ int main() { d2ds_assert_eq(sum, 0 + 1 + 2 + 3 + 4); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/embedded-list/embedded-slist.4.cpp b/dslings/tests/embedded-list/embedded-slist.4.cpp index ccef568..2dc34c2 100644 --- a/dslings/tests/embedded-list/embedded-slist.4.cpp +++ b/dslings/tests/embedded-list/embedded-slist.4.cpp @@ -49,7 +49,7 @@ int main() { d2ds_assert_eq(sum, 1 + 3 + 5 + 7 + 9); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/range_for.0.cpp b/dslings/tests/other/cpp-base/range_for.0.cpp index 75d3806..360089b 100644 --- a/dslings/tests/other/cpp-base/range_for.0.cpp +++ b/dslings/tests/other/cpp-base/range_for.0.cpp @@ -18,7 +18,7 @@ int main() { d2ds::PyRange(0, 10); d2ds::PyRange(0, 5, 200); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/range_for.1.cpp b/dslings/tests/other/cpp-base/range_for.1.cpp index a332108..5f8d396 100644 --- a/dslings/tests/other/cpp-base/range_for.1.cpp +++ b/dslings/tests/other/cpp-base/range_for.1.cpp @@ -21,7 +21,7 @@ int main() { auto begin = range.begin(); auto end = range.end(); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/range_for.2.cpp b/dslings/tests/other/cpp-base/range_for.2.cpp index 828e0e6..daa8ca9 100644 --- a/dslings/tests/other/cpp-base/range_for.2.cpp +++ b/dslings/tests/other/cpp-base/range_for.2.cpp @@ -27,7 +27,7 @@ int main() { ++begin; d2ds_assert_eq(*begin, 1); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/range_for.3.cpp b/dslings/tests/other/cpp-base/range_for.3.cpp index 5ded494..eb675b2 100644 --- a/dslings/tests/other/cpp-base/range_for.3.cpp +++ b/dslings/tests/other/cpp-base/range_for.3.cpp @@ -40,7 +40,7 @@ int main() { } } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/template.0.cpp b/dslings/tests/other/cpp-base/template.0.cpp index 077a249..bef5257 100644 --- a/dslings/tests/other/cpp-base/template.0.cpp +++ b/dslings/tests/other/cpp-base/template.0.cpp @@ -32,7 +32,7 @@ int main() { d2ds_assert_eq(d2ds::max(a, b), dstruct::max(a, b)); } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/template.1.cpp b/dslings/tests/other/cpp-base/template.1.cpp index 263d301..8e4a6b2 100644 --- a/dslings/tests/other/cpp-base/template.1.cpp +++ b/dslings/tests/other/cpp-base/template.1.cpp @@ -20,7 +20,7 @@ int main() { d2ds::Box intBox; d2ds::Box stringBox; - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/other/cpp-base/template.2.cpp b/dslings/tests/other/cpp-base/template.2.cpp index d763701..4cd9889 100644 --- a/dslings/tests/other/cpp-base/template.2.cpp +++ b/dslings/tests/other/cpp-base/template.2.cpp @@ -30,7 +30,7 @@ int main() { d2ds_assert(box.get_value() == dstruct::String("Hello, d2ds!")); } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.0.cpp b/dslings/tests/slinked-list/slist.0.cpp index 4f3b548..baebe06 100644 --- a/dslings/tests/slinked-list/slist.0.cpp +++ b/dslings/tests/slinked-list/slist.0.cpp @@ -21,7 +21,7 @@ int main() { d2ds_assert(sizeof(intList) > 24); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.1.cpp b/dslings/tests/slinked-list/slist.1.cpp index a3c94f3..7a6479e 100644 --- a/dslings/tests/slinked-list/slist.1.cpp +++ b/dslings/tests/slinked-list/slist.1.cpp @@ -28,7 +28,7 @@ int main() { d2ds::DefaultAllocator::deallocate_counter() ); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.2.cpp b/dslings/tests/slinked-list/slist.2.cpp index 0b2d4c1..a2f1fda 100644 --- a/dslings/tests/slinked-list/slist.2.cpp +++ b/dslings/tests/slinked-list/slist.2.cpp @@ -33,7 +33,7 @@ int main() { d2ds_assert_eq(d2ds::DefaultAllocator::deallocate_counter(), 9); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.3.cpp b/dslings/tests/slinked-list/slist.3.cpp index 7fd40e7..84e6fa2 100644 --- a/dslings/tests/slinked-list/slist.3.cpp +++ b/dslings/tests/slinked-list/slist.3.cpp @@ -35,7 +35,7 @@ int main() { d2ds_assert_eq(d2ds::DefaultAllocator::deallocate_counter(), 3); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.4.cpp b/dslings/tests/slinked-list/slist.4.cpp index cf37b76..faf8660 100644 --- a/dslings/tests/slinked-list/slist.4.cpp +++ b/dslings/tests/slinked-list/slist.4.cpp @@ -25,7 +25,7 @@ int main() { d2ds_assert_eq(intList1.size(), 3); d2ds_assert(!intList1.empty()); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.5.cpp b/dslings/tests/slinked-list/slist.5.cpp index 51eb559..96c9aa6 100644 --- a/dslings/tests/slinked-list/slist.5.cpp +++ b/dslings/tests/slinked-list/slist.5.cpp @@ -20,7 +20,7 @@ int main() { d2ds_assert_eq(intList.front(), 1); d2ds_assert_eq(intList.back(), 3); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.6.cpp b/dslings/tests/slinked-list/slist.6.cpp index 726a4c3..94e9b37 100644 --- a/dslings/tests/slinked-list/slist.6.cpp +++ b/dslings/tests/slinked-list/slist.6.cpp @@ -21,7 +21,7 @@ int main() { d2ds_assert_eq(intList[i], i); } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.7.cpp b/dslings/tests/slinked-list/slist.7.cpp index c5521d1..b85186a 100644 --- a/dslings/tests/slinked-list/slist.7.cpp +++ b/dslings/tests/slinked-list/slist.7.cpp @@ -32,7 +32,7 @@ int main() { d2ds_assert(intList.empty()); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.8.cpp b/dslings/tests/slinked-list/slist.8.cpp index 63fb110..b9c9666 100644 --- a/dslings/tests/slinked-list/slist.8.cpp +++ b/dslings/tests/slinked-list/slist.8.cpp @@ -32,7 +32,7 @@ int main() { d2ds_assert(intList.empty()); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.it.0.cpp b/dslings/tests/slinked-list/slist.it.0.cpp index 19287ca..b875bfc 100644 --- a/dslings/tests/slinked-list/slist.it.0.cpp +++ b/dslings/tests/slinked-list/slist.it.0.cpp @@ -26,7 +26,7 @@ int main() { d2ds_assert_eq(sizeof(iterator1), 8); d2ds_assert_eq(sizeof(iterator2), 8); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.it.1.cpp b/dslings/tests/slinked-list/slist.it.1.cpp index d9dfcca..e9ade82 100644 --- a/dslings/tests/slinked-list/slist.it.1.cpp +++ b/dslings/tests/slinked-list/slist.it.1.cpp @@ -35,7 +35,7 @@ int main() { //d2ds_assert_eq(2.2, node.data.c); // defaul 2.2 is double d2ds_assert_eq(2.2f, node.data.c); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.it.2.cpp b/dslings/tests/slinked-list/slist.it.2.cpp index 81618ff..d293091 100644 --- a/dslings/tests/slinked-list/slist.it.2.cpp +++ b/dslings/tests/slinked-list/slist.it.2.cpp @@ -23,7 +23,7 @@ int main() { d2ds_assert(iterator1 == iterator2); d2ds_assert(iterator2 != iterator3); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.it.3.cpp b/dslings/tests/slinked-list/slist.it.3.cpp index 1b7052c..c9e760d 100644 --- a/dslings/tests/slinked-list/slist.it.3.cpp +++ b/dslings/tests/slinked-list/slist.it.3.cpp @@ -26,7 +26,7 @@ int main() { d2ds_assert(iterator2++ != iterator3); d2ds_assert(iterator2 == iterator3); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.it.4.cpp b/dslings/tests/slinked-list/slist.it.4.cpp index 52fc5a0..cc91f39 100644 --- a/dslings/tests/slinked-list/slist.it.4.cpp +++ b/dslings/tests/slinked-list/slist.it.4.cpp @@ -33,7 +33,7 @@ int main() { tmp--; } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/slinked-list/slist.it.5.cpp b/dslings/tests/slinked-list/slist.it.5.cpp index 0daf2a7..18308e5 100644 --- a/dslings/tests/slinked-list/slist.it.5.cpp +++ b/dslings/tests/slinked-list/slist.it.5.cpp @@ -37,7 +37,7 @@ int main() { std::cout << std::endl; - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.0.0.cpp b/dslings/tests/vector/vector.0.0.cpp index 23a1840..ab7cb42 100644 --- a/dslings/tests/vector/vector.0.0.cpp +++ b/dslings/tests/vector/vector.0.0.cpp @@ -23,7 +23,7 @@ int main() { d2ds::Vector intVec; d2ds_assert(sizeof(intVec) >= sizeof(DataMember)); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.0.1.cpp b/dslings/tests/vector/vector.0.1.cpp index 7e59604..732e6a8 100644 --- a/dslings/tests/vector/vector.0.1.cpp +++ b/dslings/tests/vector/vector.0.1.cpp @@ -60,7 +60,7 @@ int main() { d2ds::Vector charVecByStack; d2ds::Vector doubleVec; - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.0.cpp b/dslings/tests/vector/vector.0.cpp index da2a4da..a6376c9 100644 --- a/dslings/tests/vector/vector.0.cpp +++ b/dslings/tests/vector/vector.0.cpp @@ -53,7 +53,7 @@ int main() { d2ds_assert_eq(d2ds::DefaultAllocator::allocate_counter(), 1); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.1.0.cpp b/dslings/tests/vector/vector.1.0.cpp index ee24c15..b0aa97e 100644 --- a/dslings/tests/vector/vector.1.0.cpp +++ b/dslings/tests/vector/vector.1.0.cpp @@ -26,7 +26,7 @@ int main() { d2ds_assert(BigFiveTest::destructor()); d2ds_assert_eq(1,d2ds::DefaultAllocator::deallocate_counter()); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.1.1.cpp b/dslings/tests/vector/vector.1.1.cpp index 179db30..c574ba7 100644 --- a/dslings/tests/vector/vector.1.1.cpp +++ b/dslings/tests/vector/vector.1.1.cpp @@ -36,7 +36,7 @@ int main() { d2ds_assert(BigFiveTest::destructor(true)); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.1.2.cpp b/dslings/tests/vector/vector.1.2.cpp index 86162e7..39b5e83 100644 --- a/dslings/tests/vector/vector.1.2.cpp +++ b/dslings/tests/vector/vector.1.2.cpp @@ -37,7 +37,7 @@ int main() { d2ds_assert(BigFiveTest::self_assignment()); d2ds_assert(BigFiveTest::destructor(true)); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.1.cpp b/dslings/tests/vector/vector.1.cpp index 38e8ac1..8163fba 100644 --- a/dslings/tests/vector/vector.1.cpp +++ b/dslings/tests/vector/vector.1.cpp @@ -60,7 +60,7 @@ int main() { d2ds_assert(BigFiveTest::self_assignment()); d2ds_assert(BigFiveTest::destructor(true)); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.2.cpp b/dslings/tests/vector/vector.2.cpp index 54c68b1..857d84b 100644 --- a/dslings/tests/vector/vector.2.cpp +++ b/dslings/tests/vector/vector.2.cpp @@ -31,7 +31,7 @@ int main() { intArr3[0] = constIntArr3[1] * intArr3[2]; d2ds_assert_eq(intArr3[0], 2 * -3); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.3.0.cpp b/dslings/tests/vector/vector.3.0.cpp index 0680123..7fbf911 100644 --- a/dslings/tests/vector/vector.3.0.cpp +++ b/dslings/tests/vector/vector.3.0.cpp @@ -55,7 +55,7 @@ int main() { d2ds_assert_eq(intArr2.capacity(), 0); } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.3.cpp b/dslings/tests/vector/vector.3.cpp index b8260d7..5f7d940 100644 --- a/dslings/tests/vector/vector.3.cpp +++ b/dslings/tests/vector/vector.3.cpp @@ -44,7 +44,7 @@ int main() { d2ds_assert_eq(intArr.capacity(), 4); } - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.4.cpp b/dslings/tests/vector/vector.4.cpp index 46a499f..4a9469d 100644 --- a/dslings/tests/vector/vector.4.cpp +++ b/dslings/tests/vector/vector.4.cpp @@ -32,7 +32,7 @@ int main() { d2ds_assert_eq(sum, (4 + 3 + 2 + 1) * 2); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/tests/vector/vector.5.cpp b/dslings/tests/vector/vector.5.cpp index d81cab1..ea55e0e 100644 --- a/dslings/tests/vector/vector.5.cpp +++ b/dslings/tests/vector/vector.5.cpp @@ -24,7 +24,7 @@ int main() { d2ds_assert(OQ + QP == OP); d2ds_assert(OP - OQ == QP); - D2DS_WAIT + XLINGS_WAIT return 0; } \ No newline at end of file diff --git a/dslings/xmake.lua b/dslings/xmake.lua index 7f6adad..2ee18b0 100644 --- a/dslings/xmake.lua +++ b/dslings/xmake.lua @@ -1,3 +1,11 @@ +add_rules("mode.debug") + +set_languages("cxx11") +add_includedirs(".") + +-- verify lib +add_includedirs("dstruct") + target("0.dslings-0") set_kind("binary") add_files("tests/dslings.0.cpp") diff --git a/tools/clear_screen.bat b/tools/clear_screen.bat deleted file mode 100644 index a8d42b8..0000000 --- a/tools/clear_screen.bat +++ /dev/null @@ -1,2 +0,0 @@ -:: https://github.com/Sunrisepeak/d2ds/issues/11 -cls \ No newline at end of file diff --git a/tools/install.unix.sh b/tools/install.unix.sh deleted file mode 100755 index 95f9e10..0000000 --- a/tools/install.unix.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -# ANSI color codes -RED='\033[31m' -GREEN='\033[32m' -YELLOW='\033[33m' -BLUE='\033[34m' -PURPLE='\033[35m' -CYAN='\033[36m' -RESET='\033[0m' - -# check xmake status -echo -e "${PURPLE}[d2ds]: start detect environment and try to auto config...${RESET}" -if ! command -v xmake &> /dev/null -then - echo -e "${PURPLE}[d2ds]: start install xmake...${RESET}" - curl -fsSL https://xmake.io/shget.text | bash -else - echo -e "${GREEN}[d2ds]: xmake installed${RESET}" -fi - -if code --list-extensions | grep -q ms-vscode.cpptools -then - echo -e "${GREEN}[d2ds]: vscode c++ extension installed${RESET}" -else - echo -e "${PURPLE}[d2ds]: start install vscode c++ extension...${RESET}" - code --install-extension ms-vscode.cpptools -fi - -echo -e "${PURPLE}[d2ds]: auto config done.${RESET}" -echo -e "" -echo -e "${YELLOW}\tDive into Data Structures pre-v0.0.1 - open-sources${RESET}" -echo -e "" -echo -e "${CYAN} - main-repo: https://github.com/Sunrisepeak/d2ds${RESET}" -echo -e "${CYAN} - ebook: https://sunrisepeak.github.io/d2ds${RESET}" -echo -e "${CYAN} - courses: https://sunrisepeak.github.io/d2ds-courses${RESET}" -echo -e "${CYAN} - dstruct: https://github.com/Sunrisepeak/dstruct${RESET}" -echo -e "${CYAN} - issues: https://github.com/Sunrisepeak/d2ds/issues${RESET}" -echo -e "" -echo -e "[d2ds]: Try running ${RED}xmake dslings${RESET} to start your d2ds coding..." -echo -e "[d2ds]: run ${RED}xmake d2ds${RESET} get more info" \ No newline at end of file diff --git a/tools/install.win.bat b/tools/install.win.bat deleted file mode 100644 index 794af58..0000000 --- a/tools/install.win.bat +++ /dev/null @@ -1,80 +0,0 @@ -@Echo off -Setlocal -::EchoANSI.cmd -cls -:: Display a sample of all the ANSI colours. -:: Requires windows 1909 or newer - -:: Define foreground and background ANSI colors: -Set _FBLACK= -Set _BBLACK= -Set _FRED= -Set _BRED= -Set _FGREEN= -Set _BGREEN= -Set _FYELLOW= -Set _BYELLOW= -Set _FBLUE= -Set _BBLUE= -Set _FMAG= -Set _BMAG= -Set _FCYAN= -Set _BCYAN= -Set _FLGRAY= -Set _BLGRAY= -Set _FDGRAY= -Set _BDGRAY= -Set _FBRED= -Set _BBRED= -Set _FBGREEN= -Set _BBGREEN= -Set _FBYELLOW= -Set _BBYELLOW= -Set _FBBLUE= -Set _BBBLUE= -Set _FBMAG= -Set _BBMAG= -Set _FBCYAN= -Set _BBCYAN= -Set _FBWHITE= -Set _BBWHITE= -Set _RESET= - -echo %_FBMAG%[d2ds]: start detect environment and try to auto config... - -REM Check if xmake is installed -where xmake >nul 2>&1 - -IF %ERRORLEVEL% EQU 0 ( - echo %_FBGREEN%[d2ds]: xmake installed -) else ( - REM xmake is not installed, downloading and running install script using PowerShell - echo %_FBMAG%[d2ds]: start install xmake...%_RESET% - powershell -Command "Invoke-Expression ((Invoke-WebRequest 'https://xmake.io/psget.text' -UseBasicParsing).Content)" -) - -REM Check if the extension is already installed -code --list-extensions | findstr /I /C:"ms-vscode.cpptools" >nul -if %ERRORLEVEL% equ 0 ( - echo %_FBGREEN%[d2ds]: vscode c++ extension installed -) else ( - echo %_FBMAG%[d2ds]: start install vscode c++ extension...%_RESET% - call code --install-extension ms-vscode.cpptools -) - -REM Colored echo -echo %_FBMAG%[d2ds]: auto config done. -echo. -echo %_FYELLOW% Dive into Data Structures pre-v0.0.1 - open-sources -echo. -Echo %_FCYAN% -echo - main-repo: https://github.com/Sunrisepeak/d2ds -echo - ebook: https://sunrisepeak.github.io/d2ds -echo - courses: https://sunrisepeak.github.io/d2ds-courses -echo - dstruct: https://github.com/Sunrisepeak/dstruct -echo - issues: https://github.com/Sunrisepeak/d2ds/issues -Echo %_RESET% -echo [d2ds]: Try running %_FRED%xmake dslings%_RESET% to start your d2ds coding... -echo [d2ds]: run %_FRED%xmake d2ds%_RESET% get more info - -:END diff --git a/xmake.lua b/xmake.lua deleted file mode 100644 index cc42eb1..0000000 --- a/xmake.lua +++ /dev/null @@ -1,34 +0,0 @@ -add_rules("mode.debug") - -set_languages("cxx11") -add_includedirs(".") -add_includedirs("dslings") - --- verify lib -add_includedirs("dstruct") - --- dslings exercises target list -includes("dslings/xmake.lua") - -add_moduledirs("common") - -task("d2ds") - on_run("d2ds") - set_menu { - usage = "xmake d2ds [command]", - description = "info | update | help", - options = { - {nil, "command", "v", nil, "d2ds's quick command"}, - } - } - --- dslings: auto checker and update status for exercises -task("dslings") - on_run("dslings") - set_menu{ - usage = "xmake dslings [options] [arguments]", - description = "exercises-code compile-time & runtime checker", - options = { - {'s', "start_target", "kv", "0.dslings-0", "check from start_target"}, - } - } \ No newline at end of file