Skip to content

Commit e0869f6

Browse files
committed
Update freetype test. NFC
Specifically this change allows us to run `--rebase` to update the expected output.
1 parent af2bc13 commit e0869f6

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

test/freetype_test.c renamed to test/test_freetype.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ main( int argc,
9494
int target_height;
9595
int n, num_chars;
9696

97-
filename = "LiberationSansBold.ttf";
97+
filename = "LiberationSansBold.ttf";
9898
text = "w";
9999
num_chars = strlen( text );
100100
WIDTH = 16;
@@ -143,6 +143,5 @@ main( int argc,
143143
FT_Done_Face ( face );
144144
FT_Done_FreeType( library );
145145

146-
147146
return 0;
148147
}

test/test_freetype.out

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
4+
5+
*** +***+
6+
***+ ***** +
7+
+**+ ***** +
8+
+*** +**+**+ *
9+
***+ ***+**+ +*
10+
+**+ *** *** +*
11+
+**++**+ +**+**
12+
***+**+ +**+**
13+
****** *****
14+
+****+ +****
15+
+****+ +****
16+
**** ****

test/test_other.py

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,29 +2487,12 @@ def test_freetype(self):
24872487
# copy the Liberation Sans Bold truetype file located in the
24882488
# <emscripten_root>/test/freetype to the compilation folder
24892489
shutil.copy2(test_file('freetype/LiberationSansBold.ttf'), os.getcwd())
2490+
self.emcc_args += ['--embed-file', 'LiberationSansBold.ttf']
24902491
# the test program will print an ascii representation of a bitmap where the
2491-
# 'w' character has been rendered using the Liberation Sans Bold font
2492-
expectedOutput = ' \n' + \
2493-
' \n' + \
2494-
' \n' + \
2495-
' \n' + \
2496-
'*** +***+ \n' + \
2497-
'***+ ***** +\n' + \
2498-
'+**+ ***** +\n' + \
2499-
'+*** +**+**+ *\n' + \
2500-
' ***+ ***+**+ +*\n' + \
2501-
' +**+ *** *** +*\n' + \
2502-
' +**++**+ +**+**\n' + \
2503-
' ***+**+ +**+**\n' + \
2504-
' ****** *****\n' + \
2505-
' +****+ +****\n' + \
2506-
' +****+ +****\n' + \
2507-
' **** ****'
2508-
# build test program with the font file embed in it
2509-
self.do_runf('freetype_test.c', expectedOutput,
2510-
emcc_args=['-sUSE_FREETYPE', '--embed-file', 'LiberationSansBold.ttf'])
2511-
self.do_runf('freetype_test.c', expectedOutput,
2512-
emcc_args=['--use-port=freetype', '--embed-file', 'LiberationSansBold.ttf'])
2492+
# 'w' character has been rendered using the Liberation Sans Bold font.
2493+
# See test_freetype.out
2494+
self.do_run_in_out_file_test('test_freetype.c', emcc_args=['-sUSE_FREETYPE'])
2495+
self.do_run_in_out_file_test('test_freetype.c', emcc_args=['--use-port=freetype'])
25132496

25142497
@requires_network
25152498
def test_freetype_with_pthreads(self):

0 commit comments

Comments
 (0)