Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions share/jupyter/kernels/xc11/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"argv": [
"@XEUS_CPP_KERNELSPEC_PATH@xcpp",
"-resource-dir", "/lib/clang/@CPPINTEROP_LLVM_VERSION_MAJOR@",
"-Xclang", "-iwithsysroot/include/compat",
"-xc",
"-std=c11",
"-mllvm", "-enable-emscripten-sjlj",
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xc17/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"argv": [
"@XEUS_CPP_KERNELSPEC_PATH@xcpp",
"-resource-dir", "/lib/clang/@CPPINTEROP_LLVM_VERSION_MAJOR@",
"-Xclang", "-iwithsysroot/include/compat",
"-xc",
"-std=c17",
"-mllvm", "-enable-emscripten-sjlj",
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xc23/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"argv": [
"@XEUS_CPP_KERNELSPEC_PATH@xcpp",
"-resource-dir", "/lib/clang/@CPPINTEROP_LLVM_VERSION_MAJOR@",
"-Xclang", "-iwithsysroot/include/compat",
"-xc",
"-std=c23",
"-mllvm", "-enable-emscripten-sjlj",
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp17/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"argv": [
"@XEUS_CPP_KERNELSPEC_PATH@xcpp",
"-resource-dir", "/lib/clang/@CPPINTEROP_LLVM_VERSION_MAJOR@",
"-Xclang", "-iwithsysroot/include/compat",
"-std=c++17", "-mllvm", "-enable-emscripten-cxx-exceptions",
"-mllvm", "-enable-emscripten-sjlj", "-msimd128"
],
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp20/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"argv": [
"@XEUS_CPP_KERNELSPEC_PATH@xcpp",
"-resource-dir", "/lib/clang/@CPPINTEROP_LLVM_VERSION_MAJOR@",
"-Xclang", "-iwithsysroot/include/compat",
"-std=c++20", "-mllvm", "-enable-emscripten-cxx-exceptions",
"-mllvm", "-enable-emscripten-sjlj", "-msimd128"
],
Expand Down
1 change: 1 addition & 0 deletions share/jupyter/kernels/xcpp23/wasm_kernel.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"argv": [
"@XEUS_CPP_KERNELSPEC_PATH@xcpp",
"-resource-dir", "/lib/clang/@CPPINTEROP_LLVM_VERSION_MAJOR@",
"-Xclang", "-iwithsysroot/include/compat",
"-std=c++23", "-mllvm", "-enable-emscripten-cxx-exceptions",
"-mllvm", "-enable-emscripten-sjlj", "-msimd128"
],
Expand Down
39 changes: 38 additions & 1 deletion test/test_interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,43 @@ TEST_SUITE("execute_request")
REQUIRE(result["status"] == "ok");
}

#if defined(XEUS_CPP_EMSCRIPTEN_WASM_BUILD)
TEST_CASE("headers found in sysroot/include/compat")
{
std::vector<const char*> Args = {
"-v",
"-Xclang", "-iwithsysroot/include/compat"
};

xcpp::interpreter interpreter((int)Args.size(), Args.data());
std::string code = "#include <xlocale.h>";
nl::json user_expressions = nl::json::object();
xeus::execute_request_config config;
config.silent = false;
config.store_history = false;
config.allow_stdin = false;
nl::json header = nl::json::object();
xeus::xrequest_context::guid_list id = {};
xeus::xrequest_context context(header, id);

std::promise<nl::json> promise;
std::future<nl::json> future = promise.get_future();
auto callback = [&promise](nl::json result) {
promise.set_value(result);
};

interpreter.execute_request(
std::move(context),
std::move(callback),
code,
std::move(config),
user_expressions
);
nl::json result = future.get();
REQUIRE(result["status"] == "ok");
}
#endif

TEST_CASE("fetch_documentation")
{
std::vector<const char*> Args = {/*"-v", "resource-dir", "....."*/};
Expand Down Expand Up @@ -1135,4 +1172,4 @@ TEST_CASE("C and C++ stdout/stderr capture")
REQUIRE(captured_out.find("C++ stdout") != std::string::npos);
REQUIRE(captured_err.find("C stderr") != std::string::npos);
REQUIRE(captured_err.find("C++ stderr") != std::string::npos);
}
}
Loading