Skip to content

Commit 5bd1bf3

Browse files
committed
test 1
1 parent 78c2946 commit 5bd1bf3

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

test/test_interpreter.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,39 @@ TEST_SUITE("execute_request")
9999
REQUIRE(result["status"] == "ok");
100100
}
101101

102+
#if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
103+
TEST_CASE("headers found in sysroot/include/compat")
104+
{
105+
std::vector<const char*> Args = {};
106+
xcpp::interpreter interpreter((int)Args.size(), Args.data());
107+
std::string code = "#include <xlocale.h>";
108+
nl::json user_expressions = nl::json::object();
109+
xeus::execute_request_config config;
110+
config.silent = false;
111+
config.store_history = false;
112+
config.allow_stdin = false;
113+
nl::json header = nl::json::object();
114+
xeus::xrequest_context::guid_list id = {};
115+
xeus::xrequest_context context(header, id);
116+
117+
std::promise<nl::json> promise;
118+
std::future<nl::json> future = promise.get_future();
119+
auto callback = [&promise](nl::json result) {
120+
promise.set_value(result);
121+
};
122+
123+
interpreter.execute_request(
124+
std::move(context),
125+
std::move(callback),
126+
code,
127+
std::move(config),
128+
user_expressions
129+
);
130+
nl::json result = future.get();
131+
REQUIRE(result["status"] == "ok");
132+
}
133+
#endif
134+
102135
TEST_CASE("fetch_documentation")
103136
{
104137
std::vector<const char*> Args = {/*"-v", "resource-dir", "....."*/};
@@ -1135,37 +1168,4 @@ TEST_CASE("C and C++ stdout/stderr capture")
11351168
REQUIRE(captured_out.find("C++ stdout") != std::string::npos);
11361169
REQUIRE(captured_err.find("C stderr") != std::string::npos);
11371170
REQUIRE(captured_err.find("C++ stderr") != std::string::npos);
1138-
}
1139-
1140-
#if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
1141-
TEST_CASE("headers found in sysroot/include/compat")
1142-
{
1143-
std::vector<const char*> Args = {};
1144-
xcpp::interpreter interpreter((int)Args.size(), Args.data());
1145-
std::string code = "#include <xlocale.h>";
1146-
nl::json user_expressions = nl::json::object();
1147-
xeus::execute_request_config config;
1148-
config.silent = false;
1149-
config.store_history = false;
1150-
config.allow_stdin = false;
1151-
nl::json header = nl::json::object();
1152-
xeus::xrequest_context::guid_list id = {};
1153-
xeus::xrequest_context context(header, id);
1154-
1155-
std::promise<nl::json> promise;
1156-
std::future<nl::json> future = promise.get_future();
1157-
auto callback = [&promise](nl::json result) {
1158-
promise.set_value(result);
1159-
};
1160-
1161-
interpreter.execute_request(
1162-
std::move(context),
1163-
std::move(callback),
1164-
code,
1165-
std::move(config),
1166-
user_expressions
1167-
);
1168-
nl::json result = future.get();
1169-
REQUIRE(result["status"] == "ok");
1170-
}
1171-
#endif
1171+
}

0 commit comments

Comments
 (0)