/tests/*/*.golden
/tests/*/*.png
/tests/*/*.bmp
+/tests/performance
# vi files
*.h~
--- /dev/null
+# How to measure performance of testcases.
+
+This documents is for describing how to measure performance of testcase.
+
+Three features will be supported.
+
+- Tracing(TBD)
+- Debugging
+- Profiling(TBD)
+
+refer: https://github.sec.samsung.net/STAR/nnstreamer/issues/67
+
+## Tracing
+
+Not implemented yet.
+
+## Debugging
+
+### Pre-requirements
+
+- eog
+- gsteamer1.0-tools
+- graphviz(dot)
+
+```bash
+sudo apt install graphviz
+```
+
+- Build with cmake in nnstreamer/build folder.
+
+### How to
+
+```bash
+nnstreamer/test$ ./testAll.sh 1
+nnstreamer/test$ cd performance/debug/tensor_convertor
+$ eog ${number_of_test_case}.png
+```
+
+then, you can see elements and caps in pipeline.
+
+## Profiling
+
+Not implemented yet.
lfail=$((lfail+1))
log="${log}$RED[FAILED] gst-launch with case $2$NC\n"
fi
+ if [[ $PERFORMANCE -eq 1 ]]; then
+ dot -Tpng $GST_DEBUG_DUMP_DOT_DIR/*.PLAYING_PAUSED.dot > $GST_DEBUG_DUMP_DOT_DIR/$base/$2.png
+ rm $GST_DEBUG_DUMP_DOT_DIR/*.dot
+ fi
}
##
#!/usr/bin/env bash
-dirpath=`dirname $0`
+dirpath="$( cd "$( dirname "$0")" && pwd )"
-source $dirpath/testAPI.sh
+if [[ $1 -eq 1 ]]; then
+export GST_DEBUG_DUMP_DOT_DIR=$dirpath/performance/debug
+export PERFORMANCE=1
+mkdir -p $GST_DEBUG_DUMP_DOT_DIR
+fi
+shift 1
+source $dirpath/testAPI.sh
+if [[ $PERFORMANCE -eq 1 ]]; then
+ checkDependency dot
+fi
checkDependency dirname
checkDependency basename
checkDependency sed
while IFD= read -r -d $'\0' line; do
dir=$(dirname "${line}")
- base=$(basename ${dir})
+ export base=$(basename ${dir})
+
+ if [[ $PERFORMANCE -eq 1 ]]; then
+ mkdir -p $GST_DEBUG_DUMP_DOT_DIR/$base
+ fi
log="${log}=================================================\n"
log="${log}${BLUE}Testing${NC}: ${PURPLE}${base}${NC}\n"