diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-06 11:05:09 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-09-06 11:05:09 +0300 |
commit | 8193dc7afcb9bf2f17fea0febf31c3fc13ad1dac (patch) | |
tree | 35cdce19ec7b5799338278d63cffb11d33587d70 | |
parent | a531065786f37493ebb67df5f3d780d6ccbce14d (diff) |
Document tests in test_cmake.
-rw-r--r-- | tests/test_other.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_other.py b/tests/test_other.py index d7e7deb8..abb1f6f9 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -290,8 +290,10 @@ f.close() cmake_cases = ['target_js', 'target_html'] cmake_outputs = ['hello_world.js', 'hello_world_gles.html'] - for i in range(0, 2): + for i in range(0, 2): # Test both JS and HTML build outputs from CMake. for configuration in ['Debug', 'Release']: + # CMake can be invoked in two ways, using 'emconfigure cmake', or by directly running 'cmake'. + # Test both methods. for invoke_method in ['cmake', 'emconfigure']: # Create a temp workspace folder @@ -301,13 +303,16 @@ f.close() 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] + '-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: print >> sys.stderr, ret[1] # If there were any errors, print them directly to console for diagnostics. |