Esempio n. 1
0
 def write_c(self):
     c = '\n'.join(
         ('#include <stdio.h>', 'static int t = 1;'
          'int main()', '{', 'if (t)', 'printf("on this line\\n");', 'else',
          'printf("but not here\\n");', 'return 0;', '}'))
     with open(os.path.join(os.path.dirname(__file__), '../hello.c'),
               'w+') as f:
         f.write(c)
     codecov.try_to_run('clang -coverage -O0 hello.c -o hello && ./hello')
Esempio n. 2
0
 def write_c(self):
     c = '\n'.join(('#include <stdio.h>',
                    'static int t = 1;'
                    'int main()', '{',
                    'if (t)', 'printf("on this line\\n");',
                    'else', 'printf("but not here\\n");',
                    'return 0;', '}'))
     with open(os.path.join(os.path.dirname(__file__), '../hello.c'), 'w+') as f:
         f.write(c)
     codecov.try_to_run('clang -coverage -O0 hello.c -o hello && ./hello')
Esempio n. 3
0
 def write_c(self):
     c = "\n".join(
         (
             "#include <stdio.h>",
             "static int t = 1;" "int main()",
             "{",
             "if (t)",
             'printf("on this line\\n");',
             "else",
             'printf("but not here\\n");',
             "return 0;",
             "}",
         )
     )
     with open(os.path.join(os.path.dirname(__file__), "../hello.c"), "w+") as f:
         f.write(c)
     codecov.try_to_run("clang -coverage -O0 hello.c -o hello && ./hello")
Esempio n. 4
0
 def write_c(self):
     c = "\n".join(
         (
             "#include <stdio.h>",
             "static int t = 1;" "int main()",
             "{",
             "if (t)",
             'printf("on this line\\n");',
             "else",
             'printf("but not here\\n");',
             "return 0;",
             "}",
         )
     )
     with open(os.path.join(os.path.dirname(__file__), "../hello.c"), "w+") as f:
         f.write(c)
     codecov.try_to_run(
         ["clang", "-coverage", "-O0", "hello.c", "-o", "hello", "&&", "./hello"]
     )