Running a headless googletest with XHR in a browser

34 views
Skip to first unread message

Jörn Guy Süß

unread,
Jul 22, 2020, 10:58:12 PM7/22/20
to emscripten-discuss

We are building a C++ in-browser project and want to use googletest and ctest for our CI loop to test functionality that requires XHR and Emscripten's -fetch library. In the emscripten code base we find:

emscripten/tests/fetch/example_stream_async_xhr.cpp

We have changed this code and linked it as a test with GTest framework main harness. This gives us a test binary. We can get it to run with emrun and print the GTest test report to stdout if we link with with the -emrun linker flag.

We are aware of the Emscripten test runner but do not know how to combine it with ctest.

We have two questions:

  1. How do you run a test interactively using emrun in a headless browser.
  2. How do you configure emrun so the browser exits after the test exits.

We can provide the test code, but this question is not about the code, but about the configuration of a headless test runtime when a browser is required.

Alon Zakai

unread,
Jul 23, 2020, 10:16:54 AM7/23/20
to emscripte...@googlegroups.com
This is a good question, and I'm curious to see what people suggest, but I see you posted the same question both here and on github - let's please continue the discussion there, so that the conversation isn't split between two places,


In general I think it's best not to post duplicates to multiple places simultaneously. It can be confusing if two separate discussions start up and people need to remember what was said in which. It also makes searching for similar issues harder in the future. Also many people are subscribed to both places and they get duplicate notifications.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/d149c45d-f106-4367-b14c-d06bf54aae23n%40googlegroups.com.

Jörn Guy Süß

unread,
Jul 25, 2020, 7:33:05 AM7/25/20
to emscripten-discuss
Thanks. I understand this issue if the community only uses a single forum. Let us see what the responses on the github issue are. Do you have any suggestions alon?

Best,
JG
Reply all
Reply to author
Forward
0 new messages