summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/other/bin2c/src/data.bin2
-rw-r--r--tests/projects/other/bin2c/src/image.png1
-rw-r--r--tests/projects/other/bin2c/src/main.c7
-rw-r--r--tests/projects/other/bin2c/xmake.lua3
4 files changed, 10 insertions, 3 deletions
diff --git a/tests/projects/other/bin2c/src/data.bin b/tests/projects/other/bin2c/src/data.bin
index c499e585b..5d26814ee 100644
--- a/tests/projects/other/bin2c/src/data.bin
+++ b/tests/projects/other/bin2c/src/data.bin
@@ -1 +1 @@
-"hello xmake!"
+hello xmake!
diff --git a/tests/projects/other/bin2c/src/image.png b/tests/projects/other/bin2c/src/image.png
new file mode 100644
index 000000000..d2c2e1ac6
--- /dev/null
+++ b/tests/projects/other/bin2c/src/image.png
@@ -0,0 +1 @@
+fake image
diff --git a/tests/projects/other/bin2c/src/main.c b/tests/projects/other/bin2c/src/main.c
index 650531dcb..d634a917b 100644
--- a/tests/projects/other/bin2c/src/main.c
+++ b/tests/projects/other/bin2c/src/main.c
@@ -4,8 +4,13 @@ static unsigned char g_bin_data[] = {
#include "data.bin.h"
};
+static unsigned char g_png_data[] = {
+ #include "image.png.h"
+};
+
int main(int argc, char** argv)
{
- printf("bin2c: %s\n", g_bin_data);
+ printf("data.bin: %s, size: %d\n", g_bin_data, sizeof(g_bin_data));
+ printf("image.png: %s, size: %d\n", g_png_data, sizeof(g_png_data));
return 0;
}
diff --git a/tests/projects/other/bin2c/xmake.lua b/tests/projects/other/bin2c/xmake.lua
index 4cd6f95ae..b5517a54e 100644
--- a/tests/projects/other/bin2c/xmake.lua
+++ b/tests/projects/other/bin2c/xmake.lua
@@ -2,8 +2,9 @@ add_rules("mode.debug", "mode.release")
target("test")
set_kind("binary")
+ add_rules("utils.bin2c", {linewidth = 16})
add_files("src/*.c")
add_files("src/*.bin")
- add_rules("utils.bin2c")
+ add_files("src/*.png", {rules = "utils.bin2c"})