From 6198ce284e86a75e7d7545858c776b14b6778313 Mon Sep 17 00:00:00 2001 From: xiaosuGW Date: Tue, 3 Aug 2021 14:39:49 -0400 Subject: [PATCH] add png2bmp function code --- runtime/tests/C-Image-Manip | 1 + runtime/tests/Makefile | 7 +++- runtime/tests/test_image_processing.json | 42 ++++++++++++++++++++++++ runtime/tests/test_png2bmp.json | 14 ++++++++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 160000 runtime/tests/C-Image-Manip create mode 100644 runtime/tests/test_image_processing.json create mode 100644 runtime/tests/test_png2bmp.json diff --git a/runtime/tests/C-Image-Manip b/runtime/tests/C-Image-Manip new file mode 160000 index 0000000..89f1bea --- /dev/null +++ b/runtime/tests/C-Image-Manip @@ -0,0 +1 @@ +Subproject commit 89f1beaabcfe9d3dfc5faba358f1dcfee711f218 diff --git a/runtime/tests/Makefile b/runtime/tests/Makefile index 9c60f28..d744b26 100644 --- a/runtime/tests/Makefile +++ b/runtime/tests/Makefile @@ -1,6 +1,6 @@ include Makefile.inc -TESTS=fibonacci big_fibonacci empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty +TESTS=fibonacci fibonacci2 fibonacci3 big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty TESTSRT=$(TESTS:%=%_rt) @@ -41,6 +41,11 @@ sod: @cp ./sod/bin/license_plate_detection.so ${SLEDGE_BIN_DIR}/lpd_wasm.so @cp ./sod/bin/resize_image.so ${SLEDGE_BIN_DIR}/resize_wasm.so +C-Image-Manip: + @echo "Making and Installing pngPlay" + @make pngPlay.so -C ./C-Image-Manip -f Makefile + @cp ./C-Image-Manip/pngPlay.so ${SLEDGE_BIN_DIR}/pngPlay_wasm.so + %_rt: @mkdir -p ${TMP_DIR} @echo "Compiling $(@:%_rt=%)" diff --git a/runtime/tests/test_image_processing.json b/runtime/tests/test_image_processing.json new file mode 100644 index 0000000..76af309 --- /dev/null +++ b/runtime/tests/test_image_processing.json @@ -0,0 +1,42 @@ +{ + "active": true, + "name": "resize", + "path": "resize_wasm.so", + "port": 10000, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "image/jpeg", + "http-req-size": 1024000, + "http-resp-headers": [], + "http-resp-size": 1024000, + "http-resp-content-type": "image/png" +}, +{ + "active": true, + "name": "png2bmp", + "path": "C-Image-Manip_wasm.so", + "port": 10001, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "image/png", + "http-req-size": 4096000, + "http-resp-headers": [], + "http-resp-size": 4096000, + "http-resp-content-type": "image/bmp" +}, +{ + "active": true, + "name": "cifar10", + "path": "cifar10_wasm.so", + "port": 10002, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "image/bmp", + "http-req-size": 4096000, + "http-resp-headers": [], + "http-resp-size": 1024, + "http-resp-content-type": "text/plain" +} diff --git a/runtime/tests/test_png2bmp.json b/runtime/tests/test_png2bmp.json new file mode 100644 index 0000000..743b1fd --- /dev/null +++ b/runtime/tests/test_png2bmp.json @@ -0,0 +1,14 @@ +{ + "active": true, + "name": "png2bmp", + "path": "C-Image-Manip_wasm.so", + "port": 10000, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "image/png", + "http-req-size": 1024000, + "http-resp-headers": [], + "http-resp-size": 1024000, + "http-resp-content-type": "image/bmp" +}