diff options
author | Hyeongseok Oh <hseok82.oh@samsung.com> | 2020-06-25 15:14:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 15:14:01 +0900 |
commit | 1e03fa96c6a7173d4f60b7c4db16b9d7b44c6e65 (patch) | |
tree | faf94fecd5d85f4d301210c99175eec7d17e1e89 | |
parent | 7e9377dd8d9094929b81e18ba95a2f10e0624d48 (diff) | |
download | nnfw-1e03fa96c6a7173d4f60b7c4db16b9d7b44c6e65.tar.gz nnfw-1e03fa96c6a7173d4f60b7c4db16b9d7b44c6e65.tar.bz2 nnfw-1e03fa96c6a7173d4f60b7c4db16b9d7b44c6e65.zip |
[onert] Move nnpkg_test.sh into tests/scripts (#2588)
Move nnpkg_test.sh into tests/script for including in test package
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
-rwxr-xr-x | infra/scripts/common.sh | 4 | ||||
-rwxr-xr-x | infra/scripts/test_arm_nnpkg.sh | 4 | ||||
-rw-r--r-- | tests/scripts/README.md | 44 | ||||
-rw-r--r-- | tests/scripts/list/nnpkg_test_list.armv7l-linux.acl_cl (renamed from tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.acl_cl) | 0 | ||||
-rw-r--r-- | tests/scripts/list/nnpkg_test_list.armv7l-linux.acl_neon (renamed from tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.acl_neon) | 0 | ||||
-rw-r--r-- | tests/scripts/list/nnpkg_test_list.armv7l-linux.cpu (renamed from tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.cpu) | 0 | ||||
-rw-r--r-- | tests/scripts/list/nnpkg_test_list.armv7l-linux.srcn (renamed from tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.srcn) | 0 | ||||
-rw-r--r-- | tests/scripts/list/nnpkg_test_list.noarch.interp (renamed from tools/nnpackage_tool/nnpkg_test/list.noarch.interp) | 0 | ||||
-rwxr-xr-x | tests/scripts/nnpkg_test.sh (renamed from tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh) | 0 | ||||
-rw-r--r-- | tools/nnpackage_tool/nnpkg_test/README.md | 42 | ||||
-rw-r--r-- | tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.md | 20 | ||||
-rw-r--r-- | tools/nnpackage_tool/sth2nnpkgtc/tflite2nnpkgtc.md | 2 |
12 files changed, 59 insertions, 57 deletions
diff --git a/infra/scripts/common.sh b/infra/scripts/common.sh index 35eb307ec..28aa213ec 100755 --- a/infra/scripts/common.sh +++ b/infra/scripts/common.sh @@ -19,7 +19,7 @@ # Run ./tests/scripts/test-driver.sh script unittest # # NNPackageTest $1 $2 -# Run ./tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh script nnpackage test +# Run ./tests/scripts/nnpkg_test.sh script nnpackage test CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_PATH="$(cd ${CURRENT_PATH}/../../ && pwd)" @@ -115,7 +115,7 @@ function NNPackageTest() do for entry in "nnpkg-tcs"/$f; do if [ -e $entry ]; then - BACKENDS="$1" tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh -d -i nnpkg-tcs $(basename "$entry") + BACKENDS="$1" tests/scripts/nnpkg_test.sh -d -i nnpkg-tcs $(basename "$entry") fi done EXITCODE_F=$? diff --git a/infra/scripts/test_arm_nnpkg.sh b/infra/scripts/test_arm_nnpkg.sh index d6561ff6b..68adaf913 100755 --- a/infra/scripts/test_arm_nnpkg.sh +++ b/infra/scripts/test_arm_nnpkg.sh @@ -7,10 +7,10 @@ BACKENDS=("acl_cl" "acl_neon" "cpu") for BACKEND in "${BACKENDS[@]}"; do - NNPackageTest ${BACKEND} "tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.${BACKEND}" + NNPackageTest ${BACKEND} "tests/scripts/list/nnpkg_test_list.armv7l-linux.${BACKEND}" done # Interpreter test export DISABLE_COMPILE=1 -NNPackageTest "interp" "tools/nnpackage_tool/nnpkg_test/list.noarch.interp" +NNPackageTest "interp" "tests/scripts/list/nnpkg_test_list.noarch.interp" unset DISABLE_COMPILE diff --git a/tests/scripts/README.md b/tests/scripts/README.md index 8e7e8085f..7ab9861fa 100644 --- a/tests/scripts/README.md +++ b/tests/scripts/README.md @@ -59,3 +59,47 @@ $ ./tests/scripts/test-driver.sh \ --artifactpath=. \ --verification . ``` + + +# nnpkg_test + +`nnpkg_test` is a tool to run an nnpackage testcase. + +`nnpackage testcase` is an nnpackage with additional data: + +- input.h5 (input data) +- expected.h5 (expected outpute data) + +`nnpkg_test` uses `nnpackage_run` internally to run `nnpackage`. + +Then, it compares through `difftool` (either `i5diff` or `h5diff`). + +`nnpkg_test` returns `0` on success, `non-zero` otherwise. + +## Usage + +``` +$ tests/scripts/nnpkg_test.sh -h +Usage: nnpkg_test.sh [options] nnpackage_test +Run an nnpackage testcase + +Returns + 0 success + non-zero failure + +Options: + -h show this help + -i set input directory (default=.) + -o set output directory (default=.) + -d delete dumped file on failure. + (dumped file are always deleted on success) (default=0) + +Environment variables: + nnpackage_run path to nnpackage_run (default=Product/out/bin/nnpackage_run) + difftool path to i5diff or h5diff (default=h5diff) + +Examples: + nnpkg_test.sh Add_000 => run ./Add_000 and check output + nnpkg_test.sh -i nnpkg-tcs Add_000 => run nnpkg-tcs/Add_000 and check output + +``` diff --git a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.acl_cl b/tests/scripts/list/nnpkg_test_list.armv7l-linux.acl_cl index 866f734e0..866f734e0 100644 --- a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.acl_cl +++ b/tests/scripts/list/nnpkg_test_list.armv7l-linux.acl_cl diff --git a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.acl_neon b/tests/scripts/list/nnpkg_test_list.armv7l-linux.acl_neon index 7e2371b26..7e2371b26 100644 --- a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.acl_neon +++ b/tests/scripts/list/nnpkg_test_list.armv7l-linux.acl_neon diff --git a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.cpu b/tests/scripts/list/nnpkg_test_list.armv7l-linux.cpu index cd765a465..cd765a465 100644 --- a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.cpu +++ b/tests/scripts/list/nnpkg_test_list.armv7l-linux.cpu diff --git a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.srcn b/tests/scripts/list/nnpkg_test_list.armv7l-linux.srcn index a893d59ae..a893d59ae 100644 --- a/tools/nnpackage_tool/nnpkg_test/list.armv7l-linux.srcn +++ b/tests/scripts/list/nnpkg_test_list.armv7l-linux.srcn diff --git a/tools/nnpackage_tool/nnpkg_test/list.noarch.interp b/tests/scripts/list/nnpkg_test_list.noarch.interp index cb865da84..cb865da84 100644 --- a/tools/nnpackage_tool/nnpkg_test/list.noarch.interp +++ b/tests/scripts/list/nnpkg_test_list.noarch.interp diff --git a/tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh b/tests/scripts/nnpkg_test.sh index 00b7a0e40..00b7a0e40 100755 --- a/tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh +++ b/tests/scripts/nnpkg_test.sh diff --git a/tools/nnpackage_tool/nnpkg_test/README.md b/tools/nnpackage_tool/nnpkg_test/README.md deleted file mode 100644 index 916877a3d..000000000 --- a/tools/nnpackage_tool/nnpkg_test/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# nnpkg_test - -`nnpkg_test` is a tool to run an nnpackage testcase. - -`nnpackage testcase` is an nnpackage with additional data: - -- input.h5 (input data) -- expected.h5 (expected outpute data) - -`nnpkg_test` uses `nnpackage_run` internally to run `nnpackage`. - -Then, it compares through `difftool` (either `i5diff` or `h5diff`). - -`nnpkg_test` returns `0` on success, `non-zero` otherwise. - -## Usage - -``` -$ tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh -h -Usage: nnpkg_test.sh [options] nnpackage_test -Run an nnpackage testcase - -Returns - 0 success - non-zero failure - -Options: - -h show this help - -i set input directory (default=.) - -o set output directory (default=.) - -d delete dumped file on failure. - (dumped file are always deleted on success) (default=0) - -Environment variables: - nnpackage_run path to nnpackage_run (default=Product/out/bin/nnpackage_run) - difftool path to i5diff or h5diff (default=h5diff) - -Examples: - nnpkg_test.sh Add_000 => run ./Add_000 and check output - nnpkg_test.sh -i nnpkg-tcs Add_000 => run nnpkg-tcs/Add_000 and check output - -``` diff --git a/tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.md b/tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.md index 9cf6ab141..df90d0aa1 100644 --- a/tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.md +++ b/tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.md @@ -37,16 +37,16 @@ Environment variables: ## example ``` # @ host -$ tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.sh 03_2k.pb img_placeholder conv2d_transpose +$ tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.sh test_model.pb img_placeholder conv2d_transpose # then, nnpkg is generated in {basename}.{outputname} # it contains all of pb, tflite, circle, and golden data. -$ tree 03_2k.conv2d_transpose -03_2k.conv2d_transpose -├── 03_2k.conv2d_transpose.circle -├── 03_2k.conv2d_transpose.pb -├── 03_2k.conv2d_transpose.tflite +$ tree test_model.conv2d_transpose +test_model.conv2d_transpose +├── test_model.conv2d_transpose.circle +├── test_model.conv2d_transpose.pb +├── test_model.conv2d_transpose.tflite └── metadata ├── MANIFEST └── tc @@ -54,8 +54,8 @@ $ tree 03_2k.conv2d_transpose └── input.h5 # @ target -$ OP_BACKEND_ALLOPS=srcn \ -tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh 03_2k.conv2d_transpose -[ Run ] ./03_2k.out Pass -[Compare] ./03_2k.out Pass +$ OP_BACKEND_ALLOPS=cpu \ +tests/scripts/nnpkg_test.sh test_model.conv2d_transpose +[ Run ] ./test_model.out Pass +[Compare] ./test_model.out Pass ``` diff --git a/tools/nnpackage_tool/sth2nnpkgtc/tflite2nnpkgtc.md b/tools/nnpackage_tool/sth2nnpkgtc/tflite2nnpkgtc.md index 582dcd4c1..dab6ba4d7 100644 --- a/tools/nnpackage_tool/sth2nnpkgtc/tflite2nnpkgtc.md +++ b/tools/nnpackage_tool/sth2nnpkgtc/tflite2nnpkgtc.md @@ -42,5 +42,5 @@ nnpkg-tcs/cast # @ target # run nnpkg with nnpackage_run and compare with h5diff -$ tools/nnpackage_tool/nnpkg_test/nnpkg_test.sh -i nnpkg-tcs cast +$ tests/scripts/nnpkg_test.sh -i nnpkg-tcs cast ``` |