Skip to content

Commit b7e3db9

Browse files
authored
Run safari tests for static library, and add instructions to documentation
1 parent 124029d commit b7e3db9

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

.github/workflows/emscripten.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,12 @@ jobs:
707707
emrun --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html
708708
echo "Running DynamicLibraryManagerTests in Google Chrome"
709709
emrun --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
710+
echo "Running CppInterOpTests in Safari"
711+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html &
712+
python browser_tests_safari.py CppInterOpTests.html
713+
echo "Running DynamicLibraryManagerTests in Safari"
714+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html &
715+
python browser_tests_safari.py DynamicLibraryManagerTests.html
710716
else
711717
export ARCHITECHURE=$(uname -m)
712718
if [[ "$ARCHITECHURE" != "aarch64" ]]; then

Emscripten-build-instructions.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ It is possible to run the Emscripten tests in a headless browser. To do this we
215215
cd ./unittests/CppInterOp/
216216
```
217217

218-
We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this on MacOS execute the following
218+
We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this for Chrome and Firefox on MacOS execute the following
219219

220220
```bash
221221
wget "https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US" -O Firefox-latest.dmg
@@ -242,6 +242,19 @@ echo "Running DynamicLibraryManagerTests in Google Chrome"
242242
emrun --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
243243
```
244244

245+
To run tests in Safari you can make use of safaridriver. How to enable this will depend on
246+
your MacOS operating system, and is best to consult [safaridriver](https://developer.apple.com/documentation/webkit/testing-with-webdriver-in-safari). You will also need to install the Selenium
247+
python package. This only needs to be enable once, and then you can execute the following to run the tests in Safari
248+
249+
```bash
250+
echo "Running CppInterOpTests in Safari"
251+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html &
252+
python browser_tests_safari.py CppInterOpTests.html
253+
echo "Running DynamicLibraryManagerTests in Safari"
254+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html &
255+
python browser_tests_safari.py DynamicLibraryManagerTests.html
256+
```
257+
245258
To do this on Ubuntu x86 execute the following
246259

247260
```bash

docs/Emscripten-build-instructions.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ It is possible to run the Emscripten tests in a headless browser. To do this we
238238
239239
cd ./unittests/CppInterOp/
240240
241-
We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this on MacOS execute the following
241+
We will run our tests in a fresh installed browser. Installing the browsers, and running the tests within the installed browsers will be platform dependent. To do this for Chrome and Firefox on MacOS execute the following
242242

243243
.. code:: bash
244244
@@ -265,6 +265,19 @@ We will run our tests in a fresh installed browser. Installing the browsers, and
265265
echo "Running DynamicLibraryManagerTests in Google Chrome"
266266
emrun --browser="Google Chrome" --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html
267267
268+
To run tests in Safari you can make use of safaridriver. How to enable this will depend on
269+
your MacOS operating system, and is best to consult `safaridriver <https://developer.apple.com/documentation/webkit/testing-with-webdriver-in-safari>`_. You will also need to install the Selenium
270+
python package. This only needs to be enable once, and then you can execute the following to run the tests in Safari
271+
272+
.. code:: bash
273+
274+
echo "Running CppInterOpTests in Safari"
275+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" CppInterOpTests.html &
276+
python browser_tests_safari.py CppInterOpTests.html
277+
echo "Running DynamicLibraryManagerTests in Safari"
278+
emrun --no_browser --kill_exit --timeout 60 --browser-args="--headless --no-sandbox" DynamicLibraryManagerTests.html &
279+
python browser_tests_safari.py DynamicLibraryManagerTests.html
280+
268281
To do this on Ubuntu x86 execute the following
269282

270283
.. code:: bash

0 commit comments

Comments
 (0)