Skip to content

Commit

Permalink
update run-xxx.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrylucky committed Feb 19, 2020
1 parent 4832dd1 commit d627938
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 133 deletions.
126 changes: 63 additions & 63 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ add_subdirectory(StressDemo)

if(WIN32)
add_custom_target(run-quick-start
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS QuickStartDemo QuickStartDemoClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-quick-start.bat
COMMENT "call quick start: ${CMAKE_BINARY_DIR}")
COMMAND servant/script/busybox.exe bash examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call quick start: ${CMAKE_SOURCE_DIR}")

add_custom_target(run-http
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
Expand All @@ -27,152 +27,152 @@ if(WIN32)
COMMENT "call run http")

add_custom_target(run-auth
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS AuthServer AuthClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-auth.bat
COMMAND servant/script/busybox.exe bash examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run auth")

if(TARS_HTTP2)
add_custom_target(run-http2
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS Http2Server Http2Client
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-http2.bat
COMMAND servant/script/busybox.exe bash examples/scripts/run-http2.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run http2")
endif()

if(TARS_SSL)
add_custom_target(run-ssl
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS SSLServer SSLClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-ssl.bat
COMMAND servant/script/busybox.exe bash examples/scripts/run-ssl.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run ssl")
endif()

add_custom_target(run-co
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-co.bat
COMMAND servant/script/busybox.exe bash examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run co")

add_custom_target(run-custom
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS CustomServer CustomClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-custom.bat
COMMAND servant/script/busybox.exe bash examples/scripts/run-custom.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run custom")

add_custom_target(run-push
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS PushServer PushClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-push.bat
COMMAND servant/script/busybox.exe bash examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run push")

if(TARS_SSL)
add_custom_target(run-all
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient SSLServer SSLClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-quick-start.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-http.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-co.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-push.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-auth.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-ssl.bat
COMMENT "call run all ${CMAKE_BINARY_DIR}")
COMMAND servant/script/busybox.exe bash examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-ssl.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run all ${CMAKE_SOURCE_DIR}")
else()
add_custom_target(run-all
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-quick-start.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-http.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-co.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-push.bat
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-auth.bat
COMMENT "call run all ${CMAKE_BINARY_DIR}")
COMMAND servant/script/busybox.exe bash examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run all ${CMAKE_SOURCE_DIR}")
endif()

add_custom_target(run-kill
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ../servant/script/busybox.exe bash ../examples/scripts/run-kill.bat
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND servant/script/busybox.exe bash examples/scripts/run-kill.sh
COMMENT "call run kill")

else(WIN32)

add_custom_target(run-quick-start
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS QuickStartDemo QuickStartDemoClient
COMMAND sh ../examples/scripts/run-quick-start.sh
COMMAND sh examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call quick start")

add_custom_target(run-http
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS HttpServer HttpClient
COMMAND sh ../examples/scripts/run-http.sh
COMMAND sh examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run http")

add_custom_target(run-auth
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS AuthServer AuthClient
COMMAND sh ../examples/scripts/run-auth.sh
COMMAND sh examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run auth")

if(TARS_HTTP2)
add_custom_target(run-http2
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS Http2Server Http2Client
COMMAND sh ../examples/scripts/run-http2.sh
COMMAND sh examples/scripts/run-http2.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run http2")
endif()

if(TARS_SSL)
add_custom_target(run-ssl
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS SSLServer SSLClient
COMMAND sh ../examples/scripts/run-ssl.sh
COMMAND sh examples/scripts/run-ssl.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run ssl")
endif()

add_custom_target(run-co
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro
COMMAND sh ../examples/scripts/run-co.sh
COMMAND sh examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run co")

add_custom_target(run-custom
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS CustomServer CustomClient
COMMAND sh ../examples/scripts/run-custom.sh
COMMAND sh examples/scripts/run-custom.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run custom")

add_custom_target(run-push
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS PushServer PushClient
COMMAND sh ../examples/scripts/run-push.sh
COMMAND sh examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run push")

if(TARS_SSL)
add_custom_target(run-all
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient SSLServer SSLClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
COMMAND sh ../examples/scripts/run-quick-start.sh
COMMAND sh ../examples/scripts/run-http.sh
COMMAND sh ../examples/scripts/run-co.sh
COMMAND sh ../examples/scripts/run-push.sh
COMMAND sh ../examples/scripts/run-auth.sh
COMMAND sh ../examples/scripts/run-ssl.sh
COMMAND sh examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-ssl.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run all")
else()
add_custom_target(run-all
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS QuickStartDemo QuickStartDemoClient HttpServer HttpClient AuthServer AuthClient CoroutineDemoAServer CoroutineDemoBServer CoroutineDemoClient testCoro testParallelCoro PushServer PushClient
COMMAND sh ../examples/scripts/run-quick-start.sh
COMMAND sh ../examples/scripts/run-http.sh
COMMAND sh ../examples/scripts/run-co.sh
COMMAND sh ../examples/scripts/run-push.sh
COMMAND sh ../examples/scripts/run-auth.sh
COMMAND sh examples/scripts/run-quick-start.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-http.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-co.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-push.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-auth.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run all")
endif()

add_custom_target(run-kill
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND sh ../examples/scripts/run-kill.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND sh examples/scripts/run-kill.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${CMAKE_SOURCE_DIR}
COMMENT "call run kill")
endif(WIN32)
19 changes: 12 additions & 7 deletions examples/scripts/run-auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@

echo "run-auth.sh"

killall -2 AuthServer
EXE_PATH=$1
SRC_PATH=$2

echo ${EXE_PATH} ${SRC_PATH}

killall -9 AuthServer

sleep 1
echo "start server: ./bin/AuthServer --config=../examples/AuthDemo/Server/config.conf &"
echo "start server: ${EXE_PATH}/AuthServer --config=${SRC_PATH}/examples/AuthDemo/Server/config.conf &"

./bin/AuthServer --config=../examples/AuthDemo/Server/config.conf &
${EXE_PATH}/AuthServer --config=${SRC_PATH}/examples/AuthDemo/Server/config.conf &

sleep 1

echo "client: ./bin/AuthClient"
echo "client: ${EXE_PATH}/AuthClient"

./bin/AuthClient --config=../examples/AuthDemo/Client/config.conf --count=10000 --thread=2 --call=sync --buffersize=1000 --netthread=1
./bin/AuthClient --config=../examples/AuthDemo/Client/config.conf --count=10000 --thread=2 --call=async --buffersize=1000 --netthread=1
${EXE_PATH}/AuthClient --config=${SRC_PATH}/examples/AuthDemo/Client/config.conf --count=10000 --thread=2 --call=sync --buffersize=1000 --netthread=1
${EXE_PATH}/AuthClient --config=${SRC_PATH}/examples/AuthDemo/Client/config.conf --count=10000 --thread=2 --call=async --buffersize=1000 --netthread=1

sleep 1

killall -2 AuthServer
killall -9 AuthServer


26 changes: 15 additions & 11 deletions examples/scripts/run-co.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,46 @@

echo "run-co.sh"

EXE_PATH=$1
SRC_PATH=$2

echo ${EXE_PATH} ${SRC_PATH}

killall -2 CoroutineDemoAServer
sleep 1

echo "start server: ./bin/CoroutineDemoAServer --config=../examples/CoroutineDemo/AServer/config.conf &"
echo "start server: ${EXE_PATH}/CoroutineDemoAServer --config=${SRC_PATH}/examples/CoroutineDemo/AServer/config.conf &"

./bin/CoroutineDemoAServer --config=../examples/CoroutineDemo/AServer/config.conf &
${EXE_PATH}/CoroutineDemoAServer --config=${SRC_PATH}/examples/CoroutineDemo/AServer/config.conf &

#-------------------------------------------------------------------------------------------------------

killall -2 CoroutineDemoBServer
sleep 1

echo "start server: ./bin/CoroutineDemoBServer --config=../examples/CoroutineDemo/BServer/config.conf &"
echo "start server: ${EXE_PATH}/CoroutineDemoBServer --config=${SRC_PATH}/examples/CoroutineDemo/BServer/config.conf &"

./bin/CoroutineDemoBServer --config=../examples/CoroutineDemo/BServer/config.conf &
${EXE_PATH}/CoroutineDemoBServer --config=${SRC_PATH}/examples/CoroutineDemo/BServer/config.conf &


#-------------------------------------------------------------------------------------------------------
sleep 1

echo "client: ./bin/CoroutineDemoClient"
echo "client: ${EXE_PATH}/CoroutineDemoClient"

./bin/CoroutineDemoClient --count=10000 --call=serial --thread=2 --buffersize=100 --netthread=2
${EXE_PATH}/CoroutineDemoClient --count=10000 --call=serial --thread=2 --buffersize=100 --netthread=2

./bin/CoroutineDemoClient --count=10000 --call=parallel --thread=2 --buffersize=100 --netthread=2
${EXE_PATH}/CoroutineDemoClient --count=10000 --call=parallel --thread=2 --buffersize=100 --netthread=2

./bin/testCoro 1000
${EXE_PATH}/testCoro 1000

./bin/testParallelCoro 1000
${EXE_PATH}/testParallelCoro 1000

#-------------------------------------------------------------------------------------------------------

sleep 1

killall -2 CoroutineDemoAServer
killall -2 CoroutineDemoBServer
killall -9 CoroutineDemoAServer
killall -9 CoroutineDemoBServer


19 changes: 12 additions & 7 deletions examples/scripts/run-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,29 @@

echo "run-custom.sh"

killall -2 CustomServer
EXE_PATH=$1
SRC_PATH=$2

echo ${EXE_PATH} ${SRC_PATH}

killall -9 CustomServer

sleep 1
echo "start server: ./bin/CustomServer --config=../examples/CustomDemo/CustomServer/config.conf &"
echo "start server: ${EXE_PATH}/CustomServer --config=${SRC_PATH}/examples/CustomDemo/CustomServer/config.conf &"

./bin/CustomServer --config=../examples/CustomDemo/CustomServer/config.conf &
${EXE_PATH}/CustomServer --config=${SRC_PATH}/examples/CustomDemo/CustomServer/config.conf &

sleep 2

#-------------------------------------------------------------------------------------------------------

echo "client: ./bin/CustomClient"
echo "client: ${EXE_PATH}/CustomClient"

./bin/CustomClient --count=10000 --thread=2 --call=sync --netthread=1 --buffersize=100
${EXE_PATH}/CustomClient --count=10000 --thread=2 --call=sync --netthread=1 --buffersize=100

./bin/CustomClient --count=10000 --thread=2 --call=async --netthread=1 --buffersize=100
${EXE_PATH}/CustomClient --count=10000 --thread=2 --call=async --netthread=1 --buffersize=100

killall -2 CustomServer
killall -9 CustomServer



19 changes: 12 additions & 7 deletions examples/scripts/run-http.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@

echo "run-http.sh"

killall -2 HttpServer
EXE_PATH=$1
SRC_PATH=$2

echo ${EXE_PATH} ${SRC_PATH}

killall -9 HttpServer

sleep 1
echo "start server: ./bin/HttpServer --config=../examples/HttpDemo/HttpServer/config.conf &"
echo "start server: ${EXE_PATH}/HttpServer --config=${SRC_PATH}/examples/HttpDemo/HttpServer/config.conf &"

./bin/HttpServer --config=../examples/HttpDemo/HttpServer/config.conf &
${EXE_PATH}/HttpServer --config=${SRC_PATH}/examples/HttpDemo/HttpServer/config.conf &

sleep 1

echo "client: ./bin/HttpClient"
echo "client: ${EXE_PATH}/HttpClient"

./bin/HttpClient --count=10000 --thread=2 --call=basehttp
#./bin/HttpClient --count=10000 --thread=2 --call=synchttp
${EXE_PATH}/HttpClient --count=10000 --thread=2 --call=basehttp
#${EXE_PATH}/HttpClient --count=10000 --thread=2 --call=synchttp

sleep 1

killall -2 HttpServer
killall -9 HttpServer


Loading

0 comments on commit d627938

Please sign in to comment.