Test command: ctest -V (you can do after 'make', -V means log output)
- ./CMakeLists.txt: add subdirectory and enable test
- test/CMakeLists.txt: add unit test
- testAll.sh: using `dirname $0` to solve path problem
- testAPI.sh: same as testAll.sh
- debian/control: add dependency for unit testing
Signed-off-by: Sewon Oh <sewon.oh@samsung.com>
ADD_SUBDIRECTORY(gst/tensor_sink)
ADD_SUBDIRECTORY(nnstreamer_example)
ADD_SUBDIRECTORY(tests/nnstreamer_tensors/tensors_test)
+enable_testing()
+ADD_SUBDIRECTORY(tests)
CONFIGURE_FILE(nnstreamer.pc.in nnstreamer.pc @ONLY)
Maintainer: MyungJoo Ham <myungjoo.ham@samsung.com>
Build-Depends: gcc, cmake, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, libglib2.0-dev,
libgtest-dev,
- debhelper (>=9)
+ debhelper (>=9),
+ gstreamer1.0-tools, gstreamer1.0-plugins-base, gstreamer1.0-plugins-good,
+ python-pil
Standards-Version: 3.9.6
Homepage: https://github.sec.samsung.net/STAR/nnstreamer
--- /dev/null
+ADD_TEST(unit_test ${CMAKE_CURRENT_SOURCE_DIR}/testAll.sh)
#!/usr/bin/env bash
if [[ $# -eq 0 ]]; then
- PATH_TO_PLUGIN="$PWD/../build/gst/tensor_converter:$PWD/../build/gst/tensor_filter:$PWD/../build/gst/tensor_decoder"
+ dirpath="$( cd "$( dirname "$0")" && pwd )"
+ PATH_TO_PLUGIN="$dirpath/../build/gst/tensor_converter:$dirpath/../build/gst/tensor_filter:$dirpath/../build/gst/tensor_decoder"
else
PATH_TO_PLUGIN="$1"
fi
#!/usr/bin/env bash
-source ./testAPI.sh
+dirpath=`dirname $0`
+
+source $dirpath/testAPI.sh
sopath=""
log=""
summary="${summary}$RED[FAILED] ${PURPLE}$base ${BLUE}(${lsucc} Passed / ${lfail} Failed of ${ltotal} Cases)${NC}\n"
fi
popd > /dev/null
-done < <(find . -name "runTest.sh" -print0)
+done < <(find $dirpath -name "runTest.sh" -print0)
printf "\n\n\n"
printf "$log"