Update test.sh for testing drogon_ctl

This commit is contained in:
antao 2019-03-31 00:27:12 +08:00
parent d0b9ed84ff
commit 7ffd47101f
2 changed files with 49 additions and 2 deletions

View File

@ -153,10 +153,10 @@
"plugins": [{ "plugins": [{
//name: The class name of the plugin //name: The class name of the plugin
//"name": "TestPlugin", //"name": "TestPlugin",
//dependencies: Plugins that the plugin depends on. It's a null object by default. //dependencies: Plugins that the plugin depends on. It can be commented out
"dependencies": [], "dependencies": [],
//config: The configuration of the plugin. This json object is the parameter to initialize the plugin. //config: The configuration of the plugin. This json object is the parameter to initialize the plugin.
//It's a null object by default. //It can be commented out
"config": { "config": {
"heartbeat_interval": 2 "heartbeat_interval": 2
} }

47
test.sh
View File

@ -24,4 +24,51 @@ if [ $? -ne 0 ];then
exit -1 exit -1
fi fi
killall -9 webapp
#Test drogon_ctl
drogon_ctl create project drogon_test
cd drogon_test/controllers
drogon_ctl create controller Test::SimpleCtrl
drogon_ctl create controller -h Test::HttpCtrl
drogon_ctl create controller -w Test::WebsockCtrl
if [ ! -f "Test_SimpleCtrl.h" -o ! -f "Test_SimpleCtrl.cc" -o ! -f "Test_HttpCtrl.h" -o ! -f "Test_HttpCtrl.cc" -o ! -f "Test_WebsockCtrl.h" -o ! -f "Test_WebsockCtrl.cc" ];then
echo "Failed to create controllers"
exit -1
fi
cd ../filters
drogon_ctl create filter Test::TestFilter
if [ ! -f "Test_TestFilter.h" -o ! -f "Test_TestFilter.cc" ];then
echo "Failed to create filters"
exit -1
fi
cd ../build
cmake ..
if [ $? -ne 0 ];then
echo "Error in testing"
exit -1
fi
make
if [ $? -ne 0 ];then
echo "Error in testing"
exit -1
fi
if [ ! -f "drogon_test" ];then
echo "Failed to build drogon_test"
exit -1
fi
echo "Everything is ok!"
exit 0 exit 0