def test_unistd_truncate(self):
    self.clear()
    orig_compiler_opts = self.emcc_args[:]
    for fs in ['MEMFS', 'NODEFS']:
        src = open(path_from_root('tests', 'unistd', 'truncate.c')).read()
        expected = open(path_from_root('tests', 'unistd', 'truncate.out')).read()
        self.emcc_args = (orig_compiler_opts + [('-D' + fs)])
        if (fs == 'NODEFS'):
            self.emcc_args += ['-lnodefs.js']
        self.do_run(src, expected, js_engines=[NODE_JS])
def test_unistd_truncate(self):
    self.clear()
    orig_compiler_opts = self.emcc_args[:]
    for fs in ['MEMFS', 'NODEFS']:
        src = open(path_from_root('tests', 'unistd', 'truncate.c')).read()
        expected = open(path_from_root('tests', 'unistd', 'truncate.out')).read()
        self.emcc_args = (orig_compiler_opts + [('-D' + fs)])
        if (fs == 'NODEFS'):
            self.emcc_args += ['-lnodefs.js']
        self.do_run(src, expected, js_engines=[NODE_JS])