From 625d9a7f326f028ea434ab96aa7fd1f8694828f4 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 26 Apr 2022 18:21:53 -0400 Subject: [PATCH] test: gocr by font --- tests/gocr/by_font/Makefile | 10 +++---- tests/gocr/by_font/run.sh | 10 +++---- tests/gocr/by_font/spec.json | 56 ++++++++++++++++++------------------ 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/gocr/by_font/Makefile b/tests/gocr/by_font/Makefile index 92fa8f8..dbd5fac 100644 --- a/tests/gocr/by_font/Makefile +++ b/tests/gocr/by_font/Makefile @@ -12,12 +12,12 @@ run: debug: LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert --eval-command="run spec.json" -client-dejavu_sans_mono: +client-mono: mkdir -p tmp shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt pango-view --font="DejaVu Sans Mono" -qo tmp/10_words.png tmp/10_words.txt pngtopnm tmp/10_words.png > tmp/10_words.pnm - curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000" + curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000/gocr_mono" rm -rf tmp client-roboto: @@ -25,13 +25,13 @@ client-roboto: shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt pango-view --font="Roboto" -qo tmp/10_words.png tmp/10_words.txt pngtopnm tmp/10_words.png > tmp/10_words.pnm - curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000" + curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000/gocr_roboto" rm -rf tmp -client-cascadia_code: +client-cascadia: mkdir -p tmp shuf -n10 /usr/share/dict/american-english > tmp/10_words.txt pango-view --font="Cascadia Code" -qo tmp/10_words.png tmp/10_words.txt pngtopnm tmp/10_words.png > tmp/10_words.pnm - curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000" + curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary "@tmp/10_words.pnm" "${HOSTNAME}:10000/gocr_cascadia" rm -rf tmp diff --git a/tests/gocr/by_font/run.sh b/tests/gocr/by_font/run.sh index 81c3eaf..4b47645 100755 --- a/tests/gocr/by_font/run.sh +++ b/tests/gocr/by_font/run.sh @@ -34,10 +34,10 @@ experiment_client() { # Perform Experiments printf "Running Experiments\n" local -ra fonts=("DejaVu Sans Mono" "Roboto" "Cascadia Code") - local -Ar font_to_port=( - ["DejaVu Sans Mono"]=10000 - ["Roboto"]=10001 - ["Cascadia Code"]=10002 + local -Ar font_to_path=( + ["DejaVu Sans Mono"]=/gocr_mono + ["Roboto"]=/gocr_roboto + ["Cascadia Code"]=/gocr_cascadia ) local words for ((i = 1; i <= iteration_count; i++)); do @@ -49,7 +49,7 @@ experiment_client() { pango-view --font="$font" -qo "${font_file}_words.png" -t "$words" || exit 1 pngtopnm "${font_file}_words.png" > "${font_file}_words.pnm" - result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${font_file}_words.pnm" "$hostname:${font_to_port[$font]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${font_file}_time.txt") + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${font_file}_words.pnm" "$hostname:10000${font_to_path[$font]}" --silent -w "%{stderr}%{time_total}\n" 2>> "$results_directory/${font_file}_time.txt") rm "${font_file}"_words.png "${font_file}"_words.pnm diff --git a/tests/gocr/by_font/spec.json b/tests/gocr/by_font/spec.json index ace3711..70baa4d 100644 --- a/tests/gocr/by_font/spec.json +++ b/tests/gocr/by_font/spec.json @@ -1,32 +1,32 @@ [ { - "name": "gocr_mono", - "path": "gocr.wasm.so", + "name": "gwu", "port": 10000, - "expected-execution-us": 5000, - "relative-deadline-us": 36000, - "http-req-size": 5335057, - "http-resp-size": 5335057, - "http-resp-content-type": "text/plain" - }, - { - "name": "gocr_urw_gothic", - "path": "gocr.wasm.so", - "port": 10001, - "expected-execution-us": 5000, - "relative-deadline-us": 36000, - "http-req-size": 5335057, - "http-resp-size": 5335057, - "http-resp-content-type": "text/plain" - }, - { - "name": "gocr_lobster_2", - "path": "gocr.wasm.so", - "port": 10002, - "expected-execution-us": 5000, - "relative-deadline-us": 36000, - "http-req-size": 5335057, - "http-resp-size": 5335057, - "http-resp-content-type": "text/plain" + "routes": [ + { + "route": "/gocr_mono", + "path": "gocr.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 36000, + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" + }, + { + "route": "/gocr_roboto", + "path": "gocr.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 36000, + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" + }, + { + "route": "/gocr_cascadia", + "path": "gocr.wasm.so", + "expected-execution-us": 5000, + "relative-deadline-us": 36000, + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" + } + ] } -] +] \ No newline at end of file