def test_FS_exports(self):
    for use_files in (0, 1):
        print(use_files)

        def test(output_prefix='', args=[], assert_returncode=None):
            if use_files:
                args += ['-DUSE_FILES']
            print(args)
            old = self.emcc_args[:]
            self.emcc_args += args
            self.do_run(open(path_from_root('tests', 'core', 'FS_exports.cpp')).read(), (open(path_from_root('tests', 'core', (('FS_exports' + output_prefix) + '.txt'))).read(), open(path_from_root('tests', 'core', (('FS_exports' + output_prefix) + '_2.txt'))).read()), assert_returncode=assert_returncode)
            self.emcc_args = old
        test(args=['-DDIRECT', '-s', 'FORCE_FILESYSTEM=1'])
        self.set_setting('EXTRA_EXPORTED_RUNTIME_METHODS', [])
        self.set_setting('ASSERTIONS', 1)
        test('_assert', assert_returncode=None)
        self.set_setting('ASSERTIONS', 0)
        self.set_setting('EXTRA_EXPORTED_RUNTIME_METHODS', ['FS_createDataFile'])
        test(args=['-s', 'FORCE_FILESYSTEM=1'])
def test_FS_exports(self):
    for use_files in (0, 1):
        print(use_files)

        def test(output_prefix=, args=[], assert_returncode=None):
            if use_files:
                args += ['-DUSE_FILES']
            print(args)
            old = self.emcc_args[:]
            self.emcc_args += args
            self.do_run(open(path_from_root('tests', 'core', 'FS_exports.cpp')).read(), (open(path_from_root('tests', 'core', (('FS_exports' + output_prefix) + '.txt'))).read(), open(path_from_root('tests', 'core', (('FS_exports' + output_prefix) + '_2.txt'))).read()), assert_returncode=assert_returncode)
            self.emcc_args = old
        test(args=['-DDIRECT', '-s', 'FORCE_FILESYSTEM=1'])
        self.set_setting('EXTRA_EXPORTED_RUNTIME_METHODS', [])
        self.set_setting('ASSERTIONS', 1)
        test('_assert', assert_returncode=None)
        self.set_setting('ASSERTIONS', 0)
        self.set_setting('EXTRA_EXPORTED_RUNTIME_METHODS', ['FS_createDataFile'])
        test(args=['-s', 'FORCE_FILESYSTEM=1'])