File: tests2montage

package info (click to toggle)
ctioga2 0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,340 kB
  • ctags: 1,525
  • sloc: ruby: 15,186; sh: 438; lisp: 58; makefile: 26
file content (54 lines) | stat: -rwxr-xr-x 1,136 bytes parent folder | download
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
#!/bin/sh

if [ -z $OUTPUTS ]; then
    OUTPUTS=outputs
fi

if [ -d ../.git ]; then
    revision=$(git describe --tags)
    revision="$revision""$TEST_SUFFIX"

    echo "Generating images for revision $revision"
fi

# A dir specific for outputs
mkdir -p "$OUTPUTS"
    
for f in "$@"; do
    echo "Running $f";

    if [ "$revision" ]; then
	output="$OUTPUTS"/${f%%.sh}-$revision
    else
	output="$OUTPUTS"/${f%%.sh}
    fi
    basepdf=${f%%.sh}

    export CT_ADD="--name ${basepdf}-%03d"
    NOXPDF=1 sh $f
    if [ -r ${basepdf}-000.pdf ]; then
	echo "PDF files were generated"
	echo " -> producing montage outputs"

        for f in ${basepdf}-*.pdf; do
            pp=${f%%.pdf}.ppm
            pdftoppm $f > $pp
        done
    
	if [ -z $BIG ]; then
	    geometry=340x340+4+4
	    density=150
	else
	    geometry=500x500+4+4
	    density=250
	fi
	montage -label %f -frame 5 -background '#336699' \
	    -geometry $geometry -density $density ${basepdf}-*.ppm ${output}.png
	if [ -z $KEEP ]; then
	    echo " -> removing PDF files"
	    rm -f ${basepdf}-*.pdf
	    rm -f ${basepdf}-*.ppm
	fi
	display ${output}.png &
    fi
done