Skip to content
Newer
Older
100755 51 lines (38 sloc) 1023 Bytes
43e4ae7 @willdurand Fixed reset_tests.sh script
willdurand authored Mar 5, 2012
1 #!/usr/bin/env bash
ff673c0 @willdurand Added a tiny shell script to reset test fixtures
willdurand authored Aug 22, 2011
2 # Reset Propel tests fixtures
3 # 2011 - William Durand <william.durand1@gmail.com>
4
5 CURRENT=`pwd`
6
7 function rebuild
8 {
9 local dir=$1
10
11 echo "[ $dir ]"
12
13 if [ -d "$dir/build" ] ; then
14 rm -rf "$dir/build"
15 fi
16
17 $ROOT/generator/bin/propel-gen $FIXTURES_DIR/$dir main
18 $ROOT/generator/bin/propel-gen $FIXTURES_DIR/$dir insert-sql
19 }
20
21 ROOT_DIR=""
22 FIXTURES_DIR=""
23
24 if [ -d "$CURRENT/fixtures" ] ; then
25 ROOT=".."
26 FIXTURES_DIR="$CURRENT/fixtures"
27 elif [ -d "$CURRENT/test/fixtures" ] ; then
28 ROOT="."
29 FIXTURES_DIR="$CURRENT/test/fixtures"
30 else
31 echo "ERROR: No 'test/fixtures/' directory found !"
32 exit 1
33 fi
34
35 DIRS=`ls $FIXTURES_DIR`
36
37 for dir in $DIRS ; do
38 rebuild $dir
39 done
dd10eec @willdurand [Tests] fixed script to handle reverse fixtures
willdurand authored Aug 25, 2011
40
41 # Special case for reverse fixtures
42
43 REVERSE_DIRS=`ls $FIXTURES_DIR/reverse`
44
45 for dir in $REVERSE_DIRS ; do
43e4ae7 @willdurand Fixed reset_tests.sh script
willdurand authored Mar 5, 2012
46 if [ -f "$FIXTURES_DIR/reverse/$dir/build.properties" ] ; then
47 echo "[ $dir ]"
48 $ROOT/generator/bin/propel-gen $FIXTURES_DIR/reverse/$dir insert-sql
49 fi
dd10eec @willdurand [Tests] fixed script to handle reverse fixtures
willdurand authored Aug 24, 2011
50 done
Something went wrong with that request. Please try again.