1- #!/usr/bin/env python2.7
1+ #!/usr/bin/env python
22
33import os
44import sys
1212
1313from pprint import pprint
1414
15+ PHPUNIT_PHAR = 'phpunit.phar'
16+
1517def read_popen (cmd ):
1618 path = subprocess .Popen (cmd , shell = True , stdout = subprocess .PIPE )
1719 path .wait ()
@@ -22,7 +24,7 @@ def read_popen_config(cmd):
2224 return read_popen (cmd )
2325
2426def find_php_bin ():
25- path = read_popen ('which php' ).strip ()
27+ path = read_popen ('which php' ).strip (). decode ()
2628 if (path .find ('phpenv' ) != - 1 ):
2729 version = read_popen ('phpenv global' )
2830 if (version .find ('system' ) != - 1 ):
@@ -37,7 +39,7 @@ def prepare_env(php_ini):
3739 os .mkdir ('var' )
3840 shutil .copy ('test/shared/phpunit.xml' , 'var' )
3941 test_dir_path = os .path .abspath (os .path .join (os .getcwd (), 'test' ))
40- test_lib_path = os .path .join (test_dir_path , 'phpunit.phar' )
42+ test_lib_path = os .path .join (test_dir_path , PHPUNIT_PHAR )
4143# shutil.copy('test/shared/tarantool.ini', 'var')
4244 shutil .copy (php_ini , 'var' )
4345 shutil .copy ('modules/tarantool.so' , 'var' )
@@ -60,10 +62,10 @@ def main():
6062 try :
6163 shutil .copy ('test/shared/phpunit.xml' , os .path .join (test_cwd , 'phpunit.xml' ))
6264 shutil .copy ('modules/tarantool.so' , test_cwd )
63- test_lib_path = os .path .join (test_dir_path , 'phpunit.phar' )
65+ test_lib_path = os .path .join (test_dir_path , PHPUNIT_PHAR )
6466
65- version = read_popen_config ('--version' ).strip (' \n \t ' ) + '.'
66- version1 = read_popen_config ('--extension-dir' ).strip (' \n \t ' )
67+ version = read_popen_config ('--version' ).decode (). strip (' \n \t ' ) + '.'
68+ version1 = read_popen_config ('--extension-dir' ).decode (). strip (' \n \t ' )
6769 version += '\n ' + ('With' if version1 .find ('non-zts' ) == - 1 else 'Without' ) + ' ZTS'
6870 version += '\n ' + ('With' if version1 .find ('no-debug' ) == - 1 else 'Without' ) + ' Debug'
6971 print ('Running against ' + version )
@@ -100,9 +102,9 @@ def main():
100102 cmd = cmd + 'sudo dtruss ' + find_php_bin ()
101103 cmd = cmd + ' -c tarantool.ini {0}' .format (test_lib_path )
102104 else :
103- print find_php_bin ()
105+ print ( find_php_bin () )
104106 cmd = '{0} -c tarantool.ini {1}' .format (find_php_bin (), test_lib_path )
105- print cmd
107+ print ( cmd )
106108
107109 print ('Running "%s" with "%s"' % (cmd , php_ini ))
108110 proc = subprocess .Popen (cmd , shell = True , cwd = test_cwd )
0 commit comments