~ubuntu-branches/ubuntu/utopic/ctioga2/utopic-proposed

« back to all changes in this revision

Viewing changes to tests/tests2montage

  • Committer: Bazaar Package Importer
  • Author(s): Vincent Fourmond
  • Date: 2011-01-24 21:36:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110124213606-9ettx0ugl83z0bzp
Tags: upstream-0.1
ImportĀ upstreamĀ versionĀ 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if [ -d ../.git -o -d ../.svn ]; then
 
4
    if [ -d ../.git ]; then
 
5
        prefix="git "
 
6
    fi
 
7
    revision=$($prefix svn info | grep Revision: | egrep -o '[0-9]+')
 
8
    revision=$(printf '%04d' $revision)
 
9
 
 
10
    echo "Generating images for revision $revision"
 
11
fi
 
12
 
 
13
# A dir specific for outputs
 
14
mkdir -p outputs
 
15
    
 
16
for f in "$@"; do
 
17
    echo "Running $f";
 
18
 
 
19
    if [ "$revision" ]; then
 
20
        output=outputs/${f%%.sh}-$revision
 
21
    else
 
22
        output=outputs/${f%%.sh}
 
23
    fi
 
24
    basepdf=${f%%.sh}
 
25
 
 
26
    export CT_ADD="--name ${basepdf}-%03d"
 
27
    NOXPDF=1 sh $f
 
28
    if [ -r ${basepdf}-000.pdf ]; then
 
29
        echo "There are outputs"
 
30
        echo " -> producing montage outputs"
 
31
    
 
32
        if [ -z $BIG ]; then
 
33
            geometry=340x340+4+4
 
34
            density=150
 
35
        else
 
36
            geometry=500x500+4+4
 
37
            density=250
 
38
        fi
 
39
        montage -label %f -frame 5 -background '#336699' \
 
40
            -geometry $geometry -density $density ${basepdf}-*.pdf ${output}.png
 
41
        if [ -z $KEEP ]; then
 
42
            echo " -> removing PDF files"
 
43
            rm -f ${basepdf}-*.pdf
 
44
        fi
 
45
        display ${output}.png &
 
46
    fi
 
47
done