diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-04 19:13:54 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-04 19:13:54 +0300 |
commit | a531065786f37493ebb67df5f3d780d6ccbce14d (patch) | |
tree | 7d4f124cdca8fc0960d74dcff81bbc76c1140f9d /tests/test_other.py | |
parent | 270420f77d0032f1bc9cfdbe89e21422977082cb (diff) |
Adjust EM_BUILD_VERBOSE environment variable to take values 0,1,2 or 3, with the following meanings:
0 - No verbose build. Emscripten will mute stdout and stderr invokations of external tools (configure, cmake, make). Stdout and stderr of those runs will be logged to file (the old mechanism)
1 - Print stderr.
2 - Print stderr and stdout.
3 - Print stderr and stdout, and invoke make with VERBOSE=1.
Diffstat (limited to 'tests/test_other.py')
-rw-r--r-- | tests/test_other.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index 0fc24ea7..d7e7deb8 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -300,7 +300,7 @@ f.close() try: os.chdir(tempdirname) - verbose = os.getenv('EM_BUILD_VERBOSE') != None and int(os.getenv('EM_BUILD_VERBOSE')) != 0 + verbose_level = int(os.getenv('EM_BUILD_VERBOSE')) if os.getenv('EM_BUILD_VERBOSE') != None else 0 # Run Cmake if invoke_method == 'cmake': cmd = ['cmake', '-DCMAKE_TOOLCHAIN_FILE='+path_from_root('cmake', 'Platform', 'Emscripten.cmake'), @@ -308,7 +308,7 @@ f.close() '-G', generator, cmakelistsdir] else: cmd = [emconfigure, 'cmake', '-DCMAKE_BUILD_TYPE=' + configuration, '-G', generator, cmakelistsdir] - ret = Popen(cmd, stdout=None if verbose else PIPE, stderr=None if verbose else PIPE).communicate() + 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: print >> sys.stderr, 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(): @@ -318,8 +318,8 @@ f.close() assert os.path.exists(tempdirname + '/Makefile'), 'CMake call did not produce a Makefile!' # Build - cmd = [make_command] + (['VERBOSE=1'] if verbose else []) - ret = Popen(cmd, stdout=None if verbose else PIPE).communicate() + cmd = [make_command] + (['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: print >> sys.stderr, 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(): |