From c5fa582bf02efd0e400fb2f0a96e6d2e3903b36c Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Tue, 10 Sep 2013 00:23:19 +0300 Subject: Fix previous merge. --- tests/test_other.py | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'tests/test_other.py') 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'): -- cgit v1.2.3-18-g5258