forked from LibreDWG/libredwg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.in
63 lines (61 loc) · 1.66 KB
/
log.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!@BASH@
# -*- mode: sh -*-
# create -v4 logs for DWGs, you can override -v?
srcdir="@srcdir@"
top_builddir="@top_builddir@"
make -s -j4 -C src
make -s -j4 -C programs dwgread
@DSYMUTIL@ programs/dwgread
v=-v4
# dummy to please shellcheck
test -z "$v" && echo $top_builddir
ob="$b"
log=
for d in "$@"; do
# we do use bash
case $d in
-v*) v="$d"
;;
-l*) log="$(cut "$d" -c2-)"
;;
*)
if [ ! -f "$d" ]; then
if [ -f "$srcdir/test/test-data/$d" ]
then
d="$srcdir/test/test-data/$d";
else
if [ -f "$srcdir/test/test-data/$d.dwg" ]
then
d="$srcdir/test/test-data/$d.dwg"
fi
fi
fi
xd=$(dirname "$d")
dir=_$(basename "$xd")
if [ -z "$log" ]; then
case "$d" in
*to/*)
x1=$(dirname "$xd")
dir=_$(basename "$xd")_$(basename "$x1")
;;
*test-old/*)
x1=$(dirname "$xd")
dir=_$(basename "$xd")_$(basename "$x1")
;;
esac
fi
if [ "$dir" = "_test-data" ]; then dir=""; fi
if [ "$dir" = "_td" ]; then dir=""; fi
if [ "$dir" = "_." ]; then dir=""; fi
b=$(basename "$d" .dwg)
[ -z "$log" ] && log="$b$dir.log"
echo "@TIMEOUT_10@ @LTEXEC@ programs/dwgread $v $d 2>$log"
# (sleep 12s; killall dwgread 2>/dev/null) &
@TIMEOUT_10@ @LTEXEC@ programs/dwgread "$v" "$d" 2>"$log"
tail -n2 "$log"
log=
;;
esac
done
v=
b="$ob"