Skip to content

Commit e3f79df

Browse files
hujiajiekripken
authored andcommitted
misc testing/CI tidy-up (#6890)
* remove browser overriding from the interactive test suite The logic has already been in tests/runner.py. * mute a few test warnings * turn on Firefox OffscreenCanvas support in CircleCI OffscreenCanvas is behind the gfx.offscreencanvas.enabled preference. The relevant tests are silently reported as ok if the feature is not enabled. Unfortunately, these tests are still skipped because of several bugs. * enable browser.test_sdl_ttf_render_text_solid on CircleCI ttf-mscorefonts-installer allows for easy installation of the Microsoft True Type Core Fonts for the Web including Arial. The package requires acceptance of an EULA*. Informally speaking: These fonts were provided by Microsoft "in the interest of cross-platform compatibility". This is no longer the case, but they are still available from third parties. You are free to download these fonts and use them for your own use, but you may not redistribute them in modified form, including changes to the file name or packaging format. * http://corefonts.sourceforge.net/eula.htm
1 parent a9be9cb commit e3f79df

File tree

5 files changed

+15
-19
lines changed

5 files changed

+15
-19
lines changed

.circleci/config.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ test-defaults: &test-defaults
2020
apt-get update
2121
# preseed packages so that apt-get won't prompt for user input
2222
echo "keyboard-configuration keyboard-configuration/layoutcode string us" | debconf-set-selections
23+
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
2324
apt-get install -y python3 cmake build-essential openjdk-9-jre-headless $TEST_DEPENDENCY
2425
if [ x"$DISPLAY" != x ]; then
2526
# Start an X session. Openbox might be optional for now, but
@@ -62,7 +63,10 @@ jobs:
6263
EMCC_CORES=4 python3 emscripten/embuilder.py build ALL
6364
python3 emscripten/tests/runner.py test_hello_world
6465
mkdir tmp-firefox-profile/
65-
echo 'user_pref("javascript.options.shared_memory", true);' >> tmp-firefox-profile/user.js
66+
cat > tmp-firefox-profile/user.js <<EOF
67+
user_pref("gfx.offscreencanvas.enabled", true);
68+
user_pref("javascript.options.shared_memory", true);
69+
EOF
6670
6771
# Set up X and Openbox config (if we move to a headless browser, this may not be needed).
6872
mkdir -p .config/X11
@@ -137,15 +141,18 @@ jobs:
137141
test-browser:
138142
<<: *test-defaults
139143
environment:
140-
# browser.test_sdl_ttf_render_text_solid depends on Arial from Microsoft
141144
# browser.test_sdl2_mouse and/or SDL2 should be fixed. The case happens
142145
# to be failing here, and the root cause might be related with the
143146
# initial position of the mouse pointer relative to the canvas.
144147
# browser.test_html5_webgl_create_context is skipped because
145148
# anti-aliasing is not well supported.
146-
- TEST_TARGET=browser skip:browser.test_sdl_ttf_render_text_solid skip:browser.test_sdl2_mouse skip:browser.test_html5_webgl_create_context
149+
# browser.test_webgl_offscreen_canvas_in_pthread and
150+
# browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread
151+
# are crashing Firefox (bugzil.la/1281796). The former case is
152+
# further blocked by issue #6897.
153+
- TEST_TARGET=browser skip:browser.test_sdl2_mouse skip:browser.test_html5_webgl_create_context skip:browser.test_webgl_offscreen_canvas_in_pthread skip:browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread
147154
# TODO: use Firefox headless mode when https://bugzil.la/1375585 resolves
148-
- TEST_DEPENDENCY=dbus-x11 firefox menu openbox xinit xserver-xorg xserver-xorg-video-dummy
155+
- TEST_DEPENDENCY=dbus-x11 firefox menu openbox ttf-mscorefonts-installer xinit xserver-xorg xserver-xorg-video-dummy
149156
- EMSCRIPTEN_BROWSER=firefox -profile tmp-firefox-profile/
150157
- EM_LACKS_SOUND_HARDWARE=1
151158
- EM_TESTRUNNER_DETECT_TEMPFILE_LEAKS=0

tests/hello_world_gles.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ gears_idle(void)
634634
tRate0 = t;
635635
frames = 0;
636636
#ifdef LONGTEST
637-
static runs = 0;
637+
static int runs = 0;
638638
runs++;
639639
if (runs == 4) {
640640
int result = fps;

tests/hello_world_gles_proxy.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ gears_idle(void)
648648
tRate0 = t;
649649
frames = 0;
650650
#ifdef LONGTEST
651-
static runs = 0;
651+
static int runs = 0;
652652
runs++;
653653
if (runs == 4) {
654654
REPORT_RESULT(fps);

tests/http.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void http::onLoaded(const char* file) {
201201
char* data = new char[size];
202202
fread(data,size,1,f);
203203
_content = data;
204-
delete data;
204+
delete[] data;
205205
fclose(f);
206206
} else {
207207
_content = file;

tests/test_interactive.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
from __future__ import print_function
2-
import multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex
2+
import multiprocessing, os, shutil, subprocess, unittest, zlib, time
33
from runner import BrowserCore, path_from_root
44
from tools.shared import *
55

6-
# User can specify an environment variable EMSCRIPTEN_BROWSER to force the browser test suite to
7-
# run using another browser command line than the default system browser.
8-
emscripten_browser = os.environ.get('EMSCRIPTEN_BROWSER')
9-
if emscripten_browser:
10-
cmd = shlex.split(emscripten_browser)
11-
def run_in_other_browser(url):
12-
Popen(cmd + [url])
13-
if EM_BUILD_VERBOSE_LEVEL >= 3:
14-
print("using Emscripten browser: " + str(cmd), file=sys.stderr)
15-
webbrowser.open_new = run_in_other_browser
16-
176
class interactive(BrowserCore):
187
@classmethod
198
def setUpClass(self):

0 commit comments

Comments
 (0)