diff --git a/test/freetype_test.c b/test/test_freetype.c similarity index 97% rename from test/freetype_test.c rename to test/test_freetype.c index 006aa3f11e72..42f2f06e5948 100644 --- a/test/freetype_test.c +++ b/test/test_freetype.c @@ -94,7 +94,7 @@ main( int argc, int target_height; int n, num_chars; - filename = "LiberationSansBold.ttf"; + filename = "LiberationSansBold.ttf"; text = "w"; num_chars = strlen( text ); WIDTH = 16; @@ -143,6 +143,5 @@ main( int argc, FT_Done_Face ( face ); FT_Done_FreeType( library ); - return 0; } diff --git a/test/test_freetype.out b/test/test_freetype.out new file mode 100644 index 000000000000..536477f83bdd --- /dev/null +++ b/test/test_freetype.out @@ -0,0 +1,16 @@ + + + + +*** +***+ +***+ ***** + ++**+ ***** + ++*** +**+**+ * + ***+ ***+**+ +* + +**+ *** *** +* + +**++**+ +**+** + ***+**+ +**+** + ****** ***** + +****+ +**** + +****+ +**** + **** **** diff --git a/test/test_other.py b/test/test_other.py index 60f986a29136..00a6ee7386d5 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -2487,34 +2487,17 @@ def test_freetype(self): # copy the Liberation Sans Bold truetype file located in the # /test/freetype to the compilation folder shutil.copy2(test_file('freetype/LiberationSansBold.ttf'), os.getcwd()) + self.emcc_args += ['--embed-file', 'LiberationSansBold.ttf'] # the test program will print an ascii representation of a bitmap where the - # 'w' character has been rendered using the Liberation Sans Bold font - expectedOutput = ' \n' + \ - ' \n' + \ - ' \n' + \ - ' \n' + \ - '*** +***+ \n' + \ - '***+ ***** +\n' + \ - '+**+ ***** +\n' + \ - '+*** +**+**+ *\n' + \ - ' ***+ ***+**+ +*\n' + \ - ' +**+ *** *** +*\n' + \ - ' +**++**+ +**+**\n' + \ - ' ***+**+ +**+**\n' + \ - ' ****** *****\n' + \ - ' +****+ +****\n' + \ - ' +****+ +****\n' + \ - ' **** ****' - # build test program with the font file embed in it - self.do_runf('freetype_test.c', expectedOutput, - emcc_args=['-sUSE_FREETYPE', '--embed-file', 'LiberationSansBold.ttf']) - self.do_runf('freetype_test.c', expectedOutput, - emcc_args=['--use-port=freetype', '--embed-file', 'LiberationSansBold.ttf']) + # 'w' character has been rendered using the Liberation Sans Bold font. + # See test_freetype.out + self.do_run_in_out_file_test('test_freetype.c', emcc_args=['-sUSE_FREETYPE']) + self.do_run_in_out_file_test('test_freetype.c', emcc_args=['--use-port=freetype']) @requires_network def test_freetype_with_pthreads(self): # Verify that freetype supports compilation requiring pthreads - self.emcc(test_file('freetype_test.c'), ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js') + self.emcc(test_file('test_freetype.c'), ['-pthread', '-sUSE_FREETYPE'], output_filename='a.out.js') @requires_network def test_icu(self):