Imported Upstream version 1.8.0
[platform/core/ml/nnfw.git] / infra / nncc / command / utcount
1 #!/bin/bash
2
3 import "build.configuration"
4
5 BUILD_WORKSPACE_PATH="${NNCC_PROJECT_PATH}/${BUILD_WORKSPACE_RPATH}"
6
7 if [[ ! -d "${BUILD_WORKSPACE_PATH}" ]]; then
8   echo "'${BUILD_WORKSPACE_RPATH}' does not exist. Please run 'configure' first"
9   exit 255
10 fi
11
12 BUILD_ITEMS="angkor cwrap pepper-str pepper-strcast pp stdex \
13 oops pepper-assert \
14 hermes hermes-std \
15 loco locop locomotiv logo-core logo \
16 foder souschef arser vconone \
17 safemain mio-circle mio-tflite \
18 tflite2circle \
19 luci \
20 luci-interpreter \
21 luci-value-test \
22 record-minmax \
23 circle2circle circle-quantizer"
24
25 function count_all()
26 {
27   local result=`(ctest --verbose | grep -c '\[ RUN      \]') 2>/dev/null`
28   echo $result
29 }
30
31 function count_neg()
32 {
33   local result=`(ctest --verbose | grep '\[ RUN      \]' | grep -c '_NEG') 2>/dev/null`
34   echo $result
35 }
36
37 export CTEST_OUTPUT_ON_FAILURE=0
38
39 for item in $BUILD_ITEMS
40 do
41   cd ${BUILD_WORKSPACE_PATH}/compiler/$item &&
42     printf "$item = " &&
43       res="$(count_all)" && printf "$res " &&
44       res="$(count_neg)" && echo "$res"
45 done