Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 97
[rsocket-cpp] Enable tck tests in travis builds#510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
9cd1c062d6999e9cec6533bf46843d659f7242064bFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -37,6 +37,8 @@ int main(int argc, char* argv[]) { | ||
| folly::SocketAddress address; | ||
| address.setFromHostPort(FLAGS_ip, FLAGS_port); | ||
| LOG(INFO) << "Creating client to connect to " << address.describe(); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
| ||
| // create a client which can then make connections below | ||
| auto rsf = RSocket::createClient( | ||
| std::make_unique<TcpConnectionFactory>(std::move(address))); | ||
| @@ -57,7 +59,7 @@ int main(int argc, char* argv[]) { | ||
| std::find(testsToRun.begin(), testsToRun.end(), test.name()) != | ||
| testsToRun.end()) { | ||
| ++ran; | ||
| TestInterpreter interpreter(test, std::move(rs)); | ||
| TestInterpreter interpreter(test, rs.get()); | ||
| bool passing = interpreter.run(); | ||
| if (passing) { | ||
| ++passed; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,19 @@ | ||
| // Copyright 2004-present Facebook. All Rights Reserved. | ||
| #include <fstream> | ||
| #include <future> | ||
| #include <signal.h> | ||
| #include <folly/Memory.h> | ||
| #include <folly/String.h> | ||
| #include <folly/init/Init.h> | ||
| #include <gmock/gmock.h> | ||
| #include "src/RSocket.h" | ||
| #include "src/transports/tcp/TcpConnectionAcceptor.h" | ||
| #include "tck-test/MarbleProcessor.h" | ||
| using namespace ::testing; | ||
| using namespace folly; | ||
| using namespace rsocket; | ||
| using namespace yarpl; | ||
| @@ -119,9 +118,11 @@ class ServerResponder : public RSocketResponder { | ||
| MarbleStore marbles_; | ||
| }; | ||
| [[noreturn]] static void signal_handler(int signal) { | ||
| std::promise<void> terminate; | ||
| static void signal_handler(int signal) { | ||
| LOG(INFO) << "Terminating program after receiving signal " << signal; | ||
| exit(signal); | ||
| terminate.set_value(); | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the chances this is safe to do in a signal handler... Regardless, I don't have a better solution as Any particular reason for | ||
| } | ||
| int main(int argc, char* argv[]) { | ||
| @@ -148,9 +149,7 @@ int main(int argc, char* argv[]) { | ||
| rawRs->startAndPark([responder](auto& setup) { setup.createRSocket(responder); }); | ||
| }); | ||
| // Wait for a newline on the console to terminate the server. | ||
| std::getchar(); | ||
| terminate.get_future().wait(); | ||
| rs->unpark(); | ||
| serverThread.join(); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably have this as
RSocketRequester&, but this is fine too.