From 284101c7a0600ea7007478ca8a7e161266a27a51 Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Tue, 11 Mar 2014 21:20:35 +0100 Subject: [PATCH] THRIFT-2029 Port C++ tests to Windows THRIFT-847 Test Framework harmonization across all languages fix compact protocol test within TestServer.cpp and TestClient.cpp remove stuff that breaks the cross language test suite - TestServer.cpp: cin read - test.sh: mkfifo Reported-by: Chamila Wijayarathna --- test/cpp/src/TestClient.cpp | 1 + test/cpp/src/TestServer.cpp | 11 ++++++++--- test/test.sh | 5 +---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp index 591d19da..01951392 100755 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -127,6 +127,7 @@ int main(int argc, char** argv) { try { if (!protocol_type.empty()) { if (protocol_type == "binary") { + } else if (protocol_type == "compact") { } else if (protocol_type == "json") { } else { throw invalid_argument("Unknown protocol type "+protocol_type); diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp index ad7df070..11ed3599 100755 --- a/test/cpp/src/TestServer.cpp +++ b/test/cpp/src/TestServer.cpp @@ -545,13 +545,14 @@ int main(int argc, char **argv) { if (!protocol_type.empty()) { if (protocol_type == "binary") { + } else if (protocol_type == "compact") { } else if (protocol_type == "json") { } else { throw invalid_argument("Unknown protocol type "+protocol_type); } } - if (!transport_type.empty()) { + if (!transport_type.empty()) { if (transport_type == "buffered") { } else if (transport_type == "framed") { } else if (transport_type == "http") { @@ -689,8 +690,12 @@ int main(int argc, char **argv) { boost::shared_ptr thread = factory.newThread(serverThreadRunner); thread->start(); - cout<<"Press enter to stop the server."<stop(); thread->join(); diff --git a/test/test.sh b/test/test.sh index 48a2804c..60a38173 100755 --- a/test/test.sh +++ b/test/test.sh @@ -57,12 +57,9 @@ do_test () { testname=${client_server}_${protocol}_${transport} server_timeout=$((${server_startup_time}+${client_delay})) printf "%-16s %-11s %-17s" ${client_server} ${protocol} ${transport} - mkfifo thrift_test_communication - timeout $server_timeout $server_exec < thrift_test_communication > log/${testname}_server.log 2>&1 & + timeout $server_timeout $server_exec > log/${testname}_server.log 2>&1 & sleep $server_startup_time $client_exec > log/${testname}_client.log 2>&1 - echo "done" > thrift_test_communication - rm -f thrift_test_communication if [ "$?" -eq "0" ]; then echo " success" -- 2.17.1