Move test-related codes in tools into tests (#4058)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 17 Dec 2018 09:47:44 +0000 (18:47 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 17 Dec 2018 09:47:44 +0000 (18:47 +0900)
Move test-related codes in tools into tests
- nnapi_test
- tflite_run
- tflite_benchmark
- tflite_benchmark_model

Update cmake, root makefile, and spec file

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
29 files changed:
CMakeLists.txt
Makefile
packaging/nnfw.spec
tests/.FORMATCHECKED [moved from tools/tflite_benchmark_model/.FORMATDENY with 100% similarity]
tests/CMakeLists.txt [new file with mode: 0644]
tests/tools/CMakeLists.txt [new file with mode: 0644]
tests/tools/nnapi_test/CMakeLists.txt [moved from tools/nnapi_test/CMakeLists.txt with 100% similarity]
tests/tools/nnapi_test/src/nnapi_test.cc [moved from tools/nnapi_test/src/nnapi_test.cc with 100% similarity]
tests/tools/tflite_benchmark/CMakeLists.txt [moved from tools/tflite_benchmark/CMakeLists.txt with 100% similarity]
tests/tools/tflite_benchmark/src/tflite_benchmark.cc [moved from tools/tflite_benchmark/src/tflite_benchmark.cc with 100% similarity]
tests/tools/tflite_benchmark_model/.FORMATDENY [new file with mode: 0644]
tests/tools/tflite_benchmark_model/CMakeLists.txt [moved from tools/tflite_benchmark_model/CMakeLists.txt with 100% similarity]
tests/tools/tflite_benchmark_model/README.md [moved from tools/tflite_benchmark_model/README.md with 100% similarity]
tests/tools/tflite_benchmark_model/benchmark_tflite_model.cc [moved from tools/tflite_benchmark_model/benchmark_tflite_model.cc with 100% similarity]
tests/tools/tflite_benchmark_model/profile_summarizer.cc [moved from tools/tflite_benchmark_model/profile_summarizer.cc with 100% similarity]
tests/tools/tflite_benchmark_model/stats_calculator.cc [moved from tools/tflite_benchmark_model/stats_calculator.cc with 100% similarity]
tests/tools/tflite_run/CMakeLists.txt [moved from tools/tflite_run/CMakeLists.txt with 100% similarity]
tests/tools/tflite_run/README.md [moved from tools/tflite_run/README.md with 100% similarity]
tests/tools/tflite_run/src/args.cc [moved from tools/tflite_run/src/args.cc with 100% similarity]
tests/tools/tflite_run/src/args.h [moved from tools/tflite_run/src/args.h with 100% similarity]
tests/tools/tflite_run/src/bin_image.cc [moved from tools/tflite_run/src/bin_image.cc with 100% similarity]
tests/tools/tflite_run/src/bin_image.h [moved from tools/tflite_run/src/bin_image.h with 100% similarity]
tests/tools/tflite_run/src/tensor_dumper.cc [moved from tools/tflite_run/src/tensor_dumper.cc with 100% similarity]
tests/tools/tflite_run/src/tensor_dumper.h [moved from tools/tflite_run/src/tensor_dumper.h with 100% similarity]
tests/tools/tflite_run/src/tensor_loader.cc [moved from tools/tflite_run/src/tensor_loader.cc with 100% similarity]
tests/tools/tflite_run/src/tensor_loader.h [moved from tools/tflite_run/src/tensor_loader.h with 100% similarity]
tests/tools/tflite_run/src/tflite_run.cc [moved from tools/tflite_run/src/tflite_run.cc with 100% similarity]
tests/tools/tflite_run/src/tflite_test.cc [moved from tools/tflite_run/src/tflite_test.cc with 100% similarity]
tools/CMakeLists.txt

index e643a5e..122014d 100644 (file)
@@ -69,8 +69,8 @@ if("${TARGET_OS}" STREQUAL "android")
 
   add_subdirectory(libs)
   add_subdirectory(externals)
-  add_subdirectory(tools/nnapi_test)
-  add_subdirectory(tools/tflite_benchmark)
+  add_subdirectory(tests/tools/nnapi_test)
+  add_subdirectory(tests/tools/tflite_benchmark)
 
   add_subdirectory(runtimes)
 
@@ -79,9 +79,10 @@ else("${TARGET_OS}" STREQUAL "android") # General case (non-android build)
   if(NOT OBS_BUILD)
     add_subdirectory(externals)
     add_subdirectory(tools)
+    add_subdirectory(tests)
   else(NOT OBS_BUILD)
-    add_subdirectory(tools/tflite_benchmark)
-    add_subdirectory(tools/nnapi_test)
+    add_subdirectory(tests/tools/tflite_benchmark)
+    add_subdirectory(tests/tools/nnapi_test)
   endif(NOT OBS_BUILD)
 
   add_subdirectory(contrib)
index c4733e1..d484f14 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -211,9 +211,9 @@ test_internal:
 build_test_suite: install_internal
        @echo "packaging test suite"
        @rm -rf $(INSTALL_ROOT)/test-suite.tar.gz
-       # Workaround for CI test: copy test script to old directory path
+# Workaround for CI test: copy test script to old directory path
        @cp -rf tests/scripts tools/test_driver
-       @tar -zcf test-suite.tar.gz tests/ tools/test_driver $(INSTALL_ALIAS) --dereference
+       @tar -zcf test-suite.tar.gz tests/scripts tests/framework tools/test_driver $(INSTALL_ALIAS) --dereference
        @rm -rf tools/test_driver
        @mv test-suite.tar.gz $(INSTALL_ROOT)/.
 
@@ -221,10 +221,10 @@ build_coverage_suite: install_internal
        @echo "packaging test-coverage suite"
        @rm -rf $(INSTALL_ROOT)/coverage-suite.tar.gz
        @find Product -name "*.gcno" > include_lists.txt
-       # Workaround for CI test: copy test script to old directory path
+# Workaround for CI test: copy test script to old directory path
        @cp -rf tests/scripts tools/test_driver
        @pwd | grep -o '/' | wc -l > tools/test_driver/build_path_depth.txt
-       @tar -zcf coverage-suite.tar.gz tests/ tools/test_driver $(INSTALL_ALIAS) --dereference -T include_lists.txt
+       @tar -zcf coverage-suite.tar.gz tests/scripts tests/framework tools/test_driver $(INSTALL_ALIAS) --dereference -T include_lists.txt
        @rm -rf include_lists.txt tools/test_driver/build_path_depth.txt
        @rm -rf tools/test_driver
        @mv coverage-suite.tar.gz $(INSTALL_ROOT)/.
index 915c7d3..3649e8e 100644 (file)
@@ -79,7 +79,7 @@ mv %{buildroot}%{_prefix}/bin %{buildroot}%{test_install_prefix}/Product/out
 cp -rf %{buildroot}%{_libdir} %{buildroot}%{test_install_prefix}/Product/out
 rm -rf %{buildroot}%{_libdir}/pureacl
 ## install tests
-cp -rf ./tests %{buildroot}%{test_install_prefix}/.
+cp -rf ./tests/framework %{buildroot}%{test_install_prefix}/framework
 ## install tools
 mkdir -p %{buildroot}%{test_install_prefix}/tools
 cp -rf ./tests/scripts %{buildroot}%{test_install_prefix}/tools
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f7c6b56
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectory(tools)
diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5ea6cda
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectories()
diff --git a/tests/tools/tflite_benchmark_model/.FORMATDENY b/tests/tools/tflite_benchmark_model/.FORMATDENY
new file mode 100644 (file)
index 0000000..e69de29
index 286261a..9d8e64f 100644 (file)
@@ -1,6 +1,2 @@
-add_subdirectory(tflite_run)
-add_subdirectory(tflite_benchmark)
-add_subdirectory(tflite_benchmark_model)
-add_subdirectory(nnapi_test)
 add_subdirectory(nnapi_quickcheck)
 add_subdirectory(opencl_tool)