File: Test_export.sh

package info (click to toggle)
pcb-rnd 3.1.7b-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,108 kB
  • sloc: ansic: 213,400; yacc: 6,241; sh: 4,698; awk: 3,016; makefile: 2,254; lex: 1,166; python: 519; xml: 261; lisp: 154; tcl: 67; perl: 34; javascript: 6; ruby: 5
file content (49 lines) | stat: -rwxr-xr-x 729 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

# Run the export test on all formats that have refs _and_ are supported
# by our current pcb-rnd executable

tester="./Export.sh -t -a"

# disabled until the rewrite:
#IPC-D-356
# disabled until figuring the rotation:
#dsn
want='
bom
eps
ps
XY  2>/dev/null
png
gerber
svg 2>/dev/null
'

have=`./Export.sh  --list`

export fail=0
echo "$want" | while read fmt args
do
	if test ! -z "$fmt"
	then
		have_=`echo "$have"|grep "^$fmt$"`
		if test ! -z "$have_"
		then
			eval "$tester -f $fmt $args"
			if test "$?" -ne "0"
			then
				fail=1
			fi
		else
			echo "$fmt: SKIP (plugin not enabled)"
		fi
	fi

	# the only way to set the return value of the while()
	if test "$fail" -ne "0"
	then
		false
	else
		true
	fi
done