File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed
Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,20 @@ row_count()
1616 echo " SELECT COUNT(1) FROM blog;" | sqlite3 $DBFILE
1717}
1818
19+ # Cleanup
20+ cleanup ()
21+ {
22+ # Cleanup
23+ cd $APPROOT
24+ $TREEFROG -k abort
25+
26+ cd $BASEDIR
27+ rm -rf $WORKDIR
28+ rm -rf $APPNAME
29+ }
30+
1931# # Main ##
32+ trap ' cleanup' 2 3 15 EXIT
2033
2134# Create app
2235cd $BASEDIR
@@ -40,7 +53,7 @@ make || exit
4053# Start Check
4154$TREEFROG -e dev -d || exit
4255sleep 1
43- $TREEFROG -k abort || exit
56+ $TREEFROG -k stop || exit
4457sleep 1
4558$TREEFROG -e dev -d || exit
4659sleep 1
@@ -49,9 +62,7 @@ sleep 1
4962mkdir -p $WORKDIR
5063cd $WORKDIR
5164wget http://localhost:8800/blog/index || exit
52- wget http://localhost:8800/blog/entry || exit
53- wget http://localhost:8800/fuga/index || exit
54-
65+ wget http://localhost:8800/blog/create || exit
5566
5667# POST method
5768# create1
@@ -82,14 +93,6 @@ curl --data-urlencode 'dummy' http://localhost:8800/blog/remove/2 > remove2 |
8293[ ` row_count` = " 0" ] || exit
8394
8495
85- # Cleanup
86- cd $APPROOT
87- $TREEFROG -k stop || exit
88-
89- cd $BASEDIR
90- rm -rf $WORKDIR
91- rm -rf $APPNAME
92-
9396echo
9497echo " Test completed."
9598echo " Congratulations!"
You can’t perform that action at this time.
0 commit comments