コード例 #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')
コード例 #2
0
ファイル: test.py プロジェクト: grigouze/codecov-python
 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')
コード例 #3
0
ファイル: test.py プロジェクト: bukzor/codecov-python
 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")
コード例 #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"]
     )