diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-10 00:23:19 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-10 00:23:19 +0300 |
commit | c5fa582bf02efd0e400fb2f0a96e6d2e3903b36c (patch) | |
tree | b6e841283e8396d497d558ec50b1315e9c6dcd67 /tests/test_other.py | |
parent | 74b6a2547d83406e6f45072011dc33c715666871 (diff) |
Fix previous merge.
Diffstat (limited to 'tests/test_other.py')
-rw-r--r-- | tests/test_other.py | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index b2832f21..b9a66022 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -311,36 +311,36 @@ f.close() try: os.chdir(tempdirname) - verbose_level = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 - - # Run Cmake - if invoke_method == 'cmake': - # Test invoking cmake directly. - cmd = ['cmake', '-DCMAKE_TOOLCHAIN_FILE='+path_from_root('cmake', 'Platform', 'Emscripten.cmake'), - '-DCMAKE_BUILD_TYPE=' + configuration, '-G', generator, cmakelistsdir] - else: - # Test invoking via 'emconfigure cmake' - cmd = [emconfigure, 'cmake', '-DCMAKE_BUILD_TYPE=' + configuration, '-G', generator, cmakelistsdir] - - ret = Popen(cmd, stdout=None if verbose_level >= 2 else PIPE, stderr=None if verbose_level >= 1 else PIPE).communicate() - if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: - logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics. - if len(ret) > 1 and ret[1] != None and 'error' in ret[1].lower(): - logging.error('Failed command: ' + ' '.join(cmd)) - logging.error('Result:\n' + ret[1]) - raise Exception('cmake call failed!') - assert os.path.exists(tempdirname + '/Makefile'), 'CMake call did not produce a Makefile!' - - # Build - cmd = make + (['VERBOSE=1'] if verbose_level >= 3 else []) - ret = Popen(cmd, stdout=None if verbose_level >= 2 else PIPE).communicate() - if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: - logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics. - if len(ret) > 0 and ret[0] != None and 'error' in ret[0].lower() and not '0 error(s)' in ret[0].lower(): - logging.error('Failed command: ' + ' '.join(cmd)) - logging.error('Result:\n' + ret[0]) - raise Exception('make failed!') - assert os.path.exists(tempdirname + '/' + cmake_outputs[i]), 'Building a cmake-generated Makefile failed to produce an output file %s!' % tempdirname + '/' + cmake_outputs[i] + verbose_level = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 + + # Run Cmake + if invoke_method == 'cmake': + # Test invoking cmake directly. + cmd = ['cmake', '-DCMAKE_TOOLCHAIN_FILE='+path_from_root('cmake', 'Platform', 'Emscripten.cmake'), + '-DCMAKE_BUILD_TYPE=' + configuration, '-G', generator, cmakelistsdir] + else: + # Test invoking via 'emconfigure cmake' + cmd = [emconfigure, 'cmake', '-DCMAKE_BUILD_TYPE=' + configuration, '-G', generator, cmakelistsdir] + + ret = Popen(cmd, stdout=None if verbose_level >= 2 else PIPE, stderr=None if verbose_level >= 1 else PIPE).communicate() + if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: + logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics. + if len(ret) > 1 and ret[1] != None and 'error' in ret[1].lower(): + logging.error('Failed command: ' + ' '.join(cmd)) + logging.error('Result:\n' + ret[1]) + raise Exception('cmake call failed!') + assert os.path.exists(tempdirname + '/Makefile'), 'CMake call did not produce a Makefile!' + + # Build + cmd = make + (['VERBOSE=1'] if verbose_level >= 3 else []) + ret = Popen(cmd, stdout=None if verbose_level >= 2 else PIPE).communicate() + if len(ret) > 1 and ret[1] != None and len(ret[1].strip()) > 0: + logging.error(ret[1]) # If there were any errors, print them directly to console for diagnostics. + if len(ret) > 0 and ret[0] != None and 'error' in ret[0].lower() and not '0 error(s)' in ret[0].lower(): + logging.error('Failed command: ' + ' '.join(cmd)) + logging.error('Result:\n' + ret[0]) + raise Exception('make failed!') + assert os.path.exists(tempdirname + '/' + cmake_outputs[i]), 'Building a cmake-generated Makefile failed to produce an output file %s!' % tempdirname + '/' + cmake_outputs[i] # Run through node, if CMake produced a .js file. if cmake_outputs[i].endswith('.js'): |