Commit 7c2963dc authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Python 2 & 3 compatibility, part 1 (!832)

parents a6047069 aeada68b
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from cmake_coverage import cmake_script
from os.path import join, curdir
......@@ -21,10 +21,10 @@ class CMakeTestScripts(object):
def run(self, name):
script_name = join(self.scripts_dir, 'test_%s.cmake' % name)
out, err, returncode = cmake_script(script_name, cwd=self.base_dir)
print "---------- stdout ----------"
print out
print "---------- stderr ----------"
print err
print("---------- stdout ----------")
print(out)
print("---------- stderr ----------")
print(err)
assert returncode == 0
def test_scripts(self):
......
# -*- coding: utf-8 -*-
from __future__ import print_function
from cmake_coverage import cmake_script
from os.path import join, dirname
......@@ -10,10 +10,10 @@ scripts_dir = join(base_dir, 'cmake_scripts')
def test_loops():
script_name = join(scripts_dir, 'test_loops.cmake')
out, err, returncode = cmake_script(script_name, cwd=base_dir)
print "---------- stdout ----------"
print out
print "---------- stderr ----------"
print err
print("---------- stdout ----------")
print(out)
print("---------- stderr ----------")
print(err)
assert returncode != 0
assert 'Infinite recursion detected at project Loop' in err
......@@ -21,9 +21,9 @@ def test_loops():
def test_missing_base():
script_name = join(scripts_dir, 'test_missing_base.cmake')
out, err, returncode = cmake_script(script_name, cwd=base_dir)
print "---------- stdout ----------"
print out
print "---------- stderr ----------"
print err
print("---------- stdout ----------")
print(out)
print("---------- stderr ----------")
print(err)
assert returncode != 0
assert 'Cannot find project IDoNotExist v0r0' in err
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment