Skip to content

Commit 6490315

Browse files
committed
trial 8
1 parent 71904da commit 6490315

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

test/test_interpreter.cpp

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -106,44 +106,42 @@ TEST_SUITE("execute_request")
106106
REQUIRE(result["status"] == "ok");
107107
}
108108

109-
// TEST_CASE("headers found in sysroot/include/compat")
110-
// {
111-
// #if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
112-
// std::vector<const char*> Args = {
113-
// "-v",
114-
// "-Xclang", "-iwithsysroot/include/compat"
115-
// };
116-
// #else
117-
// std::vector<const char*> Args = {/*"-v", "resource-dir", "....."*/};
118-
// #endif
119-
120-
// xcpp::interpreter interpreter((int)Args.size(), Args.data());
121-
// std::string code = "#include <xlocale.h>";
122-
// nl::json user_expressions = nl::json::object();
123-
// xeus::execute_request_config config;
124-
// config.silent = false;
125-
// config.store_history = false;
126-
// config.allow_stdin = false;
127-
// nl::json header = nl::json::object();
128-
// xeus::xrequest_context::guid_list id = {};
129-
// xeus::xrequest_context context(header, id);
130-
131-
// std::promise<nl::json> promise;
132-
// std::future<nl::json> future = promise.get_future();
133-
// auto callback = [&promise](nl::json result) {
134-
// promise.set_value(result);
135-
// };
136-
137-
// interpreter.execute_request(
138-
// std::move(context),
139-
// std::move(callback),
140-
// code,
141-
// std::move(config),
142-
// user_expressions
143-
// );
144-
// nl::json result = future.get();
145-
// REQUIRE(result["status"] == "ok");
146-
// }
109+
#if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
110+
TEST_CASE("headers found in sysroot/include/compat")
111+
{
112+
std::vector<const char*> Args = {
113+
"-v",
114+
"-Xclang", "-iwithsysroot/include/compat"
115+
};
116+
117+
xcpp::interpreter interpreter((int)Args.size(), Args.data());
118+
std::string code = "#include <xlocale.h>";
119+
nl::json user_expressions = nl::json::object();
120+
xeus::execute_request_config config;
121+
config.silent = false;
122+
config.store_history = false;
123+
config.allow_stdin = false;
124+
nl::json header = nl::json::object();
125+
xeus::xrequest_context::guid_list id = {};
126+
xeus::xrequest_context context(header, id);
127+
128+
std::promise<nl::json> promise;
129+
std::future<nl::json> future = promise.get_future();
130+
auto callback = [&promise](nl::json result) {
131+
promise.set_value(result);
132+
};
133+
134+
interpreter.execute_request(
135+
std::move(context),
136+
std::move(callback),
137+
code,
138+
std::move(config),
139+
user_expressions
140+
);
141+
nl::json result = future.get();
142+
REQUIRE(result["status"] == "ok");
143+
}
144+
#endif
147145

148146
#if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
149147
TEST_CASE("Emscripten Exception Handling")

0 commit comments

Comments
 (0)