def test_files_m(self):
    self.set_setting('EXIT_RUNTIME', 1)
    create_test_file('pre.js', "\n    Module = {\n      data: [10, 20, 40, 30],\n      stdin: function() { return Module.data.pop() || null },\n      stdout: function(x) { out('got: ' + x) }\n    };\n")
    self.emcc_args += ['--pre-js', 'pre.js']
    src = '\n      #include <stdio.h>\n      #include <unistd.h>\n\n      int main () {\n        char c;\n        fprintf(stderr, "isatty? %d,%d,%d\\n", isatty(fileno(stdin)), isatty(fileno(stdout)), isatty(fileno(stderr)));\n        while ((c = fgetc(stdin)) != EOF) {\n          putc(c+5, stdout);\n        }\n        return 0;\n      }\n      '

    def clean(out, err):
        return '\n'.join((l for l in (out + err).splitlines() if (('warning' not in l) and ('binaryen' not in l))))
    self.do_run(src, ('got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1\n', 'got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1', 'isatty? 0,0,1\ngot: 35\ngot: 45\ngot: 25\ngot: 15'), output_nicerizer=clean)
def test_files_m(self):
    self.set_setting('EXIT_RUNTIME', 1)
    create_test_file('pre.js', "\n    Module = {\n      data: [10, 20, 40, 30],\n      stdin: function() { return Module.data.pop() || null },\n      stdout: function(x) { out('got: ' + x) }\n    };\n")
    self.emcc_args += ['--pre-js', 'pre.js']
    src = '\n      #include <stdio.h>\n      #include <unistd.h>\n\n      int main () {\n        char c;\n        fprintf(stderr, "isatty? %d,%d,%d\\n", isatty(fileno(stdin)), isatty(fileno(stdout)), isatty(fileno(stderr)));\n        while ((c = fgetc(stdin)) != EOF) {\n          putc(c+5, stdout);\n        }\n        return 0;\n      }\n      '

    def clean(out, err):
        return '\n'.join((l for l in (out + err).splitlines() if (('warning' not in l) and ('binaryen' not in l))))
    self.do_run(src, ('got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1\n', 'got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1', 'isatty? 0,0,1\ngot: 35\ngot: 45\ngot: 25\ngot: 15'), output_nicerizer=clean)