public
Description: Moved to http://github.com/robmyers/frame
Homepage: http://github.com/robmyers/frame
Clone URL: git://github.com/robmyers/art_generators.git
art_generators / test_gem
100755 63 lines (49 sloc) 1.627 kb
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
#!/bin/bash
 
# art_generators - create and manage digital art project directory structures
# Copyright (C) 2008 Rob Myers
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Utility function
 
die(){
    echo $1
    exit $2
}
 
# Install the gem and make a project
 
(test -e art_generator*.gem &&
sudo gem install art_generator) ||
  die "Failed installing gem" 1
 
(rm -rf test && art_project test) ||
  die "Failed making test project" 1
 
# Make a work and make a derivative of it
 
cd test
script/work work.svg && script/work -c work.svg work2.svg
cd ..
 
# Report on the success or failure of these operations
 
echo "Start tests."
 
if [ -e "./test" ]; then
echo ok: make project folder
else
echo FAIL: make test folder
fi
 
if [ "$(ls test/preparatory | grep work)" != "" ]; then
echo ok: make work
else
echo FAIL: make work
fi
 
if [ "$(ls test/preparatory | grep work2)" != "" ]; then
echo ok: Make derivative work
else
echo FAIL: make derivative work
fi
 
echo "Finish tests."