[Bf-blender-cvs] [ce68a2c] cycles_ctests: Cycles ctests: avoid having runtime check script

Sergey Sharybin noreply at git.blender.org
Thu Jan 22 11:50:07 CET 2015


Commit: ce68a2cc0855414d541d1ffb0a20f4157c9c7b8e
Author: Sergey Sharybin
Date:   Thu Jan 22 15:48:12 2015 +0500
Branches: cycles_ctests
https://developer.blender.org/rBce68a2cc0855414d541d1ffb0a20f4157c9c7b8e

Cycles ctests: avoid having runtime check script

Use command line argument and output parse to do checks which
used to be done with the separate script.

===================================================================

M	tests/python/CMakeLists.txt
D	tests/python/cycles/render_tests.py
D	tests/python/cycles/runtime_check.py
A	tests/python/cycles_render_tests.py

===================================================================

diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 46ea1d6..59d3aa1 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -363,7 +363,7 @@ add_test(export_fbx_all_objects ${TEST_BLENDER_EXE}
 if(WITH_CYCLES)
 	if(OPENIMAGEIO_IDIFF)
 		add_test(cycles_shaders_test
-			${CMAKE_CURRENT_LIST_DIR}/cycles/render_tests.py
+			${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
 			-blender "${TEST_BLENDER_EXE_BARE}"
 			-testdir "${TEST_SRC_DIR}/cycles/ctests/shader"
 			-idiff "${OPENIMAGEIO_IDIFF}"
diff --git a/tests/python/cycles/runtime_check.py b/tests/python/cycles/runtime_check.py
deleted file mode 100644
index 960082c..0000000
--- a/tests/python/cycles/runtime_check.py
+++ /dev/null
@@ -1,6 +0,0 @@
-import bpy
-import sys
-
-scene = bpy.data.scenes[0]
-if scene.render.engine != 'CYCLES':
-    sys.exit(128)
diff --git a/tests/python/cycles/render_tests.py b/tests/python/cycles_render_tests.py
similarity index 81%
rename from tests/python/cycles/render_tests.py
rename to tests/python/cycles_render_tests.py
index 036166a..815811f 100755
--- a/tests/python/cycles/render_tests.py
+++ b/tests/python/cycles_render_tests.py
@@ -15,20 +15,31 @@ def render_file(filepath):
         "-noaudio",
         "--factory-startup",
         filepath,
-        "--python", TEST_SCRIPT,
+        "-E", "CYCLES",
         "-o", TEMP_FILE_MASK,
+        "-F", "PNG",
         "-f", "1",
         )
     try:
         output = subprocess.check_output(command)
         if VERBOSE:
             print(output.decode("utf-8"))
-        return None if os.path.exists(TEMP_FILE) else "NOT_FOUND"
-    except subprocess.CalledProcessError as grepexc:
-        return "NO_CYCLES" if grepexc.returncode == 128 else "CRASH"
+        return None
+    except subprocess.CalledProcessError as e:
+        if os.path.exists(TEMP_FILE):
+            os.remove(TEMP_FILE)
+        if VERBOSE:
+            print(e.output.decode("utf-8"))
+        if b"Error: engine not found" in e.output:
+            return "NO_CYCLES"
+        elif b"blender probably wont start" in e.output:
+            return "NO_START"
+        return "CRASH"
     except:
         if os.path.exists(TEMP_FILE):
             os.remove(TEMP_FILE)
+        if VERBOSE:
+            print(e.output.decode("utf-8"))
         return "CRASH"
 
 
@@ -92,6 +103,12 @@ def run_all_tests(dirpath):
             if error == "NO_CYCLES":
                 print("Can't perform tests because Cycles failed to load!")
                 return False
+            elif error == "NO_START":
+                print('Can not perform tests because blender fails to start.',
+                      'Make sure INSTALL target was run.')
+                return False
+            else:
+                print("Unknown error %r" % error)
             testname = test_get_name(filepath)
             failed_tests.append(testname)
     if failed_tests:




More information about the Bf-blender-cvs mailing list