Skip to content

Commit 787fe4d

Browse files
committed
trial 6
1 parent a77aff6 commit 787fe4d

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

test/test_interpreter.cpp

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,43 +68,43 @@ class StreamRedirectRAII {
6868

6969
TEST_SUITE("execute_request")
7070
{
71-
// TEST_CASE("stl")
72-
// {
73-
// #if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
74-
// std::vector<const char*> Args = {
75-
// "-v",
76-
// "-Xclang", "-iwithsysroot/include/compat"
77-
// };
78-
// #else
79-
// std::vector<const char*> Args = {/*"-v", "resource-dir", "....."*/};
80-
// #endif
81-
// xcpp::interpreter interpreter((int)Args.size(), Args.data());
82-
// std::string code = "#include <vector>";
83-
// nl::json user_expressions = nl::json::object();
84-
// xeus::execute_request_config config;
85-
// config.silent = false;
86-
// config.store_history = false;
87-
// config.allow_stdin = false;
88-
// nl::json header = nl::json::object();
89-
// xeus::xrequest_context::guid_list id = {};
90-
// xeus::xrequest_context context(header, id);
71+
TEST_CASE("stl")
72+
{
73+
#if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
74+
std::vector<const char*> Args = {
75+
"-v",
76+
"-Xclang", "-iwithsysroot/include/compat"
77+
};
78+
#else
79+
std::vector<const char*> Args = {/*"-v", "resource-dir", "....."*/};
80+
#endif
81+
xcpp::interpreter interpreter((int)Args.size(), Args.data());
82+
std::string code = "#include <vector>";
83+
nl::json user_expressions = nl::json::object();
84+
xeus::execute_request_config config;
85+
config.silent = false;
86+
config.store_history = false;
87+
config.allow_stdin = false;
88+
nl::json header = nl::json::object();
89+
xeus::xrequest_context::guid_list id = {};
90+
xeus::xrequest_context context(header, id);
9191

92-
// std::promise<nl::json> promise;
93-
// std::future<nl::json> future = promise.get_future();
94-
// auto callback = [&promise](nl::json result) {
95-
// promise.set_value(result);
96-
// };
92+
std::promise<nl::json> promise;
93+
std::future<nl::json> future = promise.get_future();
94+
auto callback = [&promise](nl::json result) {
95+
promise.set_value(result);
96+
};
9797

98-
// interpreter.execute_request(
99-
// std::move(context),
100-
// std::move(callback),
101-
// code,
102-
// std::move(config),
103-
// user_expressions
104-
// );
105-
// nl::json result = future.get();
106-
// REQUIRE(result["status"] == "ok");
107-
// }
98+
interpreter.execute_request(
99+
std::move(context),
100+
std::move(callback),
101+
code,
102+
std::move(config),
103+
user_expressions
104+
);
105+
nl::json result = future.get();
106+
REQUIRE(result["status"] == "ok");
107+
}
108108

109109
// TEST_CASE("headers found in sysroot/include/compat")
110110
// {

0 commit comments

Comments
 (0)