summaryrefslogtreecommitdiff
path: root/tests/projects/other/autogen_binary_module
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-25 00:54:13 +0800
committerruki <[email protected]>2024-07-25 00:54:13 +0800
commitc7c412f6458f5aceeb02e9bfc292dc7aac0852d3 (patch)
tree90fc1076e7dd5a2971d7033bee28825a80e59477 /tests/projects/other/autogen_binary_module
parent039cd576af844dc146b7517160648765b90b81b1 (diff)
move autogen tests
Diffstat (limited to 'tests/projects/other/autogen_binary_module')
-rw-r--r--tests/projects/other/autogen_binary_module/.gitignore8
-rw-r--r--tests/projects/other/autogen_binary_module/modules/autogen/foo/.gitignore8
-rw-r--r--tests/projects/other/autogen_binary_module/modules/autogen/foo/src/main.cpp29
-rw-r--r--tests/projects/other/autogen_binary_module/modules/autogen/foo/xmake.lua6
-rw-r--r--tests/projects/other/autogen_binary_module/src/data.in1
-rw-r--r--tests/projects/other/autogen_binary_module/src/main.cpp10
-rw-r--r--tests/projects/other/autogen_binary_module/test.lua3
-rw-r--r--tests/projects/other/autogen_binary_module/xmake.lua32
8 files changed, 0 insertions, 97 deletions
diff --git a/tests/projects/other/autogen_binary_module/.gitignore b/tests/projects/other/autogen_binary_module/.gitignore
deleted file mode 100644
index 152105761..000000000
--- a/tests/projects/other/autogen_binary_module/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Xmake cache
-.xmake/
-build/
-
-# MacOS Cache
-.DS_Store
-
-
diff --git a/tests/projects/other/autogen_binary_module/modules/autogen/foo/.gitignore b/tests/projects/other/autogen_binary_module/modules/autogen/foo/.gitignore
deleted file mode 100644
index 152105761..000000000
--- a/tests/projects/other/autogen_binary_module/modules/autogen/foo/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Xmake cache
-.xmake/
-build/
-
-# MacOS Cache
-.DS_Store
-
-
diff --git a/tests/projects/other/autogen_binary_module/modules/autogen/foo/src/main.cpp b/tests/projects/other/autogen_binary_module/modules/autogen/foo/src/main.cpp
deleted file mode 100644
index c5150cdbd..000000000
--- a/tests/projects/other/autogen_binary_module/modules/autogen/foo/src/main.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <iostream>
-#include <fstream>
-#include <vector>
-
-using namespace std;
-
-int main(int argc, char** argv) {
- ifstream src_file(argv[1], ios::in | ios::binary);
- if (!src_file) {
- return 1;
- }
- vector<char> buffer(istreambuf_iterator<char>(src_file), {});
- src_file.close();
-
- ofstream dst_file(argv[2], ios::out);
- if (!dst_file) {
- return 1;
- }
-
- dst_file << "unsigned char g_codegen_data[] = {";
- for (auto byte : buffer) {
- dst_file << "0x" << hex << (int)(unsigned char)byte << ",";
- }
- dst_file << "0};" << endl;
- dst_file.close();
- return 0;
-}
-
-
diff --git a/tests/projects/other/autogen_binary_module/modules/autogen/foo/xmake.lua b/tests/projects/other/autogen_binary_module/modules/autogen/foo/xmake.lua
deleted file mode 100644
index 677da3e2d..000000000
--- a/tests/projects/other/autogen_binary_module/modules/autogen/foo/xmake.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-add_rules("mode.debug", "mode.release")
-
-target("generate")
- add_rules("module.binary")
- add_files("src/*.cpp")
- set_languages("c++11")
diff --git a/tests/projects/other/autogen_binary_module/src/data.in b/tests/projects/other/autogen_binary_module/src/data.in
deleted file mode 100644
index a04238969..000000000
--- a/tests/projects/other/autogen_binary_module/src/data.in
+++ /dev/null
@@ -1 +0,0 @@
-hello world!
diff --git a/tests/projects/other/autogen_binary_module/src/main.cpp b/tests/projects/other/autogen_binary_module/src/main.cpp
deleted file mode 100644
index 3241308f7..000000000
--- a/tests/projects/other/autogen_binary_module/src/main.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-#include <iostream>
-
-using namespace std;
-
-extern unsigned char g_codegen_data[];
-
-int main(int argc, char** argv) {
- cout << (const char*)g_codegen_data << endl;
- return 0;
-}
diff --git a/tests/projects/other/autogen_binary_module/test.lua b/tests/projects/other/autogen_binary_module/test.lua
deleted file mode 100644
index b57362078..000000000
--- a/tests/projects/other/autogen_binary_module/test.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-function main(t)
- t:build()
-end
diff --git a/tests/projects/other/autogen_binary_module/xmake.lua b/tests/projects/other/autogen_binary_module/xmake.lua
deleted file mode 100644
index b1617e543..000000000
--- a/tests/projects/other/autogen_binary_module/xmake.lua
+++ /dev/null
@@ -1,32 +0,0 @@
-add_rules("mode.debug", "mode.release")
-
-add_moduledirs("modules")
-
-rule("autogen")
- set_extensions(".in")
- before_build_file(function (target, sourcefile, opt)
- import("utils.progress")
- import("core.project.depend")
- import("core.tool.compiler")
- import("autogen.foo", {always_build = true})
-
- local sourcefile_cx = path.join(target:autogendir(), "rules", "autogen", path.basename(sourcefile) .. ".cpp")
- local objectfile = target:objectfile(sourcefile_cx)
- table.insert(target:objectfiles(), objectfile)
-
- depend.on_changed(function ()
- progress.show(opt.progress, "${color.build.object}compiling.autogen %s", sourcefile)
- os.mkdir(path.directory(sourcefile_cx))
- foo.generate(sourcefile, sourcefile_cx)
- compiler.compile(sourcefile_cx, objectfile, {target = target})
- end, {dependfile = target:dependfile(objectfile),
- files = sourcefile,
- changed = target:is_rebuilt()})
- end)
-
-target("test")
- set_kind("binary")
- add_rules("autogen")
- add_files("src/main.cpp")
- add_files("src/*.in")
-