Debian Codegraph @

debian/tests/assimp-info

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 runtestscip-shell shell assimp 6.0.5+ds-1 runtest().() {
4 echoscip-shell system . . echo. "===================================================="
5 echoscip-shell system . . echo. "> Trying to open '$1' with assimp"
6 assimp info "$1" 2>&1
7 ret=$?
8 case "${ret}" in
9 0)
10 ;;
11 [1-9]) # assimp failed to open the file, but handled it gracefully
12 ;;
13 *)
14 echoscip-shell system . . echo. "> assimp info '$1' returned $ret"
15 retval=1
16 ;;
17 esac
18 echoscip-shell system . . echo. ""
19 }
20
21 maxmemory=0
22 memoryfile=""
23 while getopts "m:M:" o; do
24 case "${o}" in
25 m)
26 maxmemory=$((OPTARG+0))
27 ;;
28 M)
29 memoryfile=${OPTARG}
30 ;;
31 esac
32 done
33 shift $((OPTIND-1))
34
35 setMaxMemoryscip-shell shell assimp 6.0.5+ds-1 setMaxMemory().() {
36 maxmemory=$(${0%/*}/getAvailableMemory)
37 }
38
39 [scip-shell system . . `[`. -r "${memoryfile}" ] || memoryfile=""
40 if [scip-shell system . . `[`. -n "${memoryfile}" ]; then
41 if [scip-shell system . . `[`. ${maxmemory} -le 0 ]; then
42 setMaxMemoryscip-shell shell assimp 6.0.5+ds-1 setMaxMemory(). 2>&1
43 fi
44 else
45 maxmemory=0
46 fi
47
48 getNeededMemoryscip-shell shell assimp 6.0.5+ds-1 getNeededMemory().() {
49 local f="$1"
50 local size
51 local name
52 catscip-shell system . . cat. "${memoryfile}" \
53 | egrepscip-shell system . . egrep. -v "^#" \
54 | egrepscip-shell system . . egrep. "/${f}$" \
55 | while read size name; do
56 echoscip-shell system . . echo. $size
57 done
58 }
59
60 retval=0
61 for f in "$@"; do
62 if [scip-shell system . . `[`. $maxmemory -gt 0 ]; then
63 m=$(getNeededMemoryscip-shell shell assimp 6.0.5+ds-1 getNeededMemory(). "${f##*/}")
64 if [scip-shell system . . `[`. -n "${m}" ]; then
65 if [scip-shell system . . `[`. "x${m}" = x0 ]; then
66 echoscip-shell system . . echo. "skipping ${f} due to unbound memory"
67 continue
68 fi
69 if [scip-shell system . . `[`. $m -ge $maxmemory ]; then
70 echoscip-shell system . . echo. "skipping ${f} due to memory constraints ($m > $maxmemory)"
71 continue
72 fi
73 fi
74 fi
75 runtestscip-shell shell assimp 6.0.5+ds-1 runtest(). "$f" | sedscip-shell system . . sed. -e '/^ *$/dscip-shell filesystem . . `/^ *$/d`.'
76 done
77 exit $retval