summaryrefslogtreecommitdiff
path: root/tests/projects/other/autogen_codedep
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_codedep
parent039cd576af844dc146b7517160648765b90b81b1 (diff)
move autogen tests
Diffstat (limited to 'tests/projects/other/autogen_codedep')
-rw-r--r--tests/projects/other/autogen_codedep/.gitignore8
-rw-r--r--tests/projects/other/autogen_codedep/src/autogen.cpp28
-rw-r--r--tests/projects/other/autogen_codedep/src/data.in1
-rw-r--r--tests/projects/other/autogen_codedep/src/main.cpp10
-rw-r--r--tests/projects/other/autogen_codedep/test.lua3
-rw-r--r--tests/projects/other/autogen_codedep/xmake.lua35
6 files changed, 0 insertions, 85 deletions
diff --git a/tests/projects/other/autogen_codedep/.gitignore b/tests/projects/other/autogen_codedep/.gitignore
deleted file mode 100644
index 152105761..000000000
--- a/tests/projects/other/autogen_codedep/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Xmake cache
-.xmake/
-build/
-
-# MacOS Cache
-.DS_Store
-
-
diff --git a/tests/projects/other/autogen_codedep/src/autogen.cpp b/tests/projects/other/autogen_codedep/src/autogen.cpp
deleted file mode 100644
index cf556ad99..000000000
--- a/tests/projects/other/autogen_codedep/src/autogen.cpp
+++ /dev/null
@@ -1,28 +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_codedep/src/data.in b/tests/projects/other/autogen_codedep/src/data.in
deleted file mode 100644
index a04238969..000000000
--- a/tests/projects/other/autogen_codedep/src/data.in
+++ /dev/null
@@ -1 +0,0 @@
-hello world!
diff --git a/tests/projects/other/autogen_codedep/src/main.cpp b/tests/projects/other/autogen_codedep/src/main.cpp
deleted file mode 100644
index 3241308f7..000000000
--- a/tests/projects/other/autogen_codedep/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_codedep/test.lua b/tests/projects/other/autogen_codedep/test.lua
deleted file mode 100644
index b57362078..000000000
--- a/tests/projects/other/autogen_codedep/test.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-function main(t)
- t:build()
-end
diff --git a/tests/projects/other/autogen_codedep/xmake.lua b/tests/projects/other/autogen_codedep/xmake.lua
deleted file mode 100644
index 5f2c76d67..000000000
--- a/tests/projects/other/autogen_codedep/xmake.lua
+++ /dev/null
@@ -1,35 +0,0 @@
-add_rules("mode.debug", "mode.release")
-
-rule("autogen")
- set_extensions(".in")
- before_buildcmd_file(function (target, batchcmds, sourcefile, opt)
- local sourcefile_cx = path.join(target:autogendir(), "rules", "autogen", path.basename(sourcefile) .. ".cpp")
- local objectfile = target:objectfile(sourcefile_cx)
- table.insert(target:objectfiles(), objectfile)
-
- batchcmds:show_progress(opt.progress, "${color.build.object}compiling.autogen %s", sourcefile)
- batchcmds:mkdir(path.directory(sourcefile_cx))
- batchcmds:vrunv(target:dep("autogen"):targetfile(), {sourcefile, sourcefile_cx})
- batchcmds:compile(sourcefile_cx, objectfile)
-
- batchcmds:add_depfiles(sourcefile, target:dep("autogen"):targetfile())
- batchcmds:set_depmtime(os.mtime(objectfile))
- batchcmds:set_depcache(target:dependfile(objectfile))
- end)
-
-target("autogen")
- set_default(false)
- set_kind("binary")
- set_plat(os.host())
- set_arch(os.arch())
- add_files("src/autogen.cpp")
- set_languages("c++11")
- set_policy("build.fence", true)
-
-target("test")
- set_kind("binary")
- add_deps("autogen")
- add_rules("autogen")
- add_files("src/main.cpp")
- add_files("src/*.in")
-