Repository: thrift Updated Branches: refs/heads/master 7a66f75da -> 284101c7a
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 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/284101c7 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/284101c7 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/284101c7 Branch: refs/heads/master Commit: 284101c7a0600ea7007478ca8a7e161266a27a51 Parents: 7a66f75 Author: Roger Meier <[email protected]> Authored: Tue Mar 11 21:20:35 2014 +0100 Committer: Roger Meier <[email protected]> Committed: Tue Mar 11 21:20:35 2014 +0100 ---------------------------------------------------------------------- test/cpp/src/TestClient.cpp | 1 + test/cpp/src/TestServer.cpp | 11 ++++++++--- test/test.sh | 5 +---- 3 files changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/284101c7/test/cpp/src/TestClient.cpp ---------------------------------------------------------------------- diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp index 591d19d..0195139 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); http://git-wip-us.apache.org/repos/asf/thrift/blob/284101c7/test/cpp/src/TestServer.cpp ---------------------------------------------------------------------- diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp index ad7df07..11ed359 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<apache::thrift::concurrency::Thread> thread = factory.newThread(serverThreadRunner); thread->start(); - cout<<"Press enter to stop the server."<<endl; - cin.ignore(); //wait until a key is pressed + // HACK: cross language test suite is unable to handle cin properly + // that's why we stay in a endless loop here + while(1){} + // FIXME: find another way to stop the server (e.g. a signal) + // cout<<"Press enter to stop the server."<<endl; + // cin.ignore(); //wait until a key is pressed server->stop(); thread->join(); http://git-wip-us.apache.org/repos/asf/thrift/blob/284101c7/test/test.sh ---------------------------------------------------------------------- diff --git a/test/test.sh b/test/test.sh index 48a2804..60a3817 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"
