Add tweaks/comments to default.ref.json
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 7 Dec 2011 12:03:23 +0000 (12:03 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 7 Dec 2011 12:03:23 +0000 (12:03 +0000)
README.markdown
apps/gl/default.ref.json
driver.py

index 9108088cbd788fdcecdd22607ebe97be1737124c..a2db32e4de94949dec74a121720adafc85bac468 100644 (file)
@@ -5,6 +5,7 @@ It is still work in progress, and has a lot unfinished code/ideas.
 To run the test suite do
 
     cmake -DAPITRACE_BINARY_DIR=/path/to/apitrace/build/ .
+    export CTEST_OUTPUT_ON_FAILURE=1
     make all test
 
 Detailed log will be written to Testing/Temporary/LastTest.log
index ca0a627e03ef95a585c56bf25595aa5e9b4c4b29..0d085d3ee06667af0bdfe291f6cc328a2b2899bd 100644 (file)
@@ -59,7 +59,7 @@
     "GL_STENCIL_WRITEMASK": -1,
     "GL_MATRIX_MODE": "GL_MODELVIEW",
     "GL_NORMALIZE": false,
-    "GL_VIEWPORT": [0, 0, 32, 32],
+    // GL_VIEWPORT depends on the drawable
     "GL_MODELVIEW_STACK_DEPTH": 1,
     "GL_PROJECTION_STACK_DEPTH": 1,
     "GL_TEXTURE_STACK_DEPTH": 1,
     "GL_LOGIC_OP_MODE": "GL_COPY",
     "GL_INDEX_LOGIC_OP": false,
     "GL_COLOR_LOGIC_OP": false,
+    // Some implementations return more GL_AUX_BUFFERS than requested
     "GL_DRAW_BUFFER": "GL_BACK",
     "GL_READ_BUFFER": "GL_BACK",
-    "GL_SCISSOR_BOX": [0, 0, 32, 32],
+    // GL_SCISSOR_BOX depends on the drawable
     "GL_SCISSOR_TEST": false,
     "GL_INDEX_CLEAR_VALUE": 0,
     "GL_INDEX_WRITEMASK": -1,
     "GL_ALPHA_BIAS": 0,
     "GL_DEPTH_SCALE": 1,
     "GL_DEPTH_BIAS": 0,
+    "GL_INDEX_BITS": 0,
+    // GL_xxx_BITS state can often vary
     "GL_NAME_STACK_DEPTH": 0,
     "GL_AUTO_NORMAL": false,
     "GL_MAP1_COLOR_4": false,
index 871ef097ec63cc7a1f115d40f23800aa69f72760..39d7420c4e9e4853d47f33f592d94580f51e1200 100755 (executable)
--- a/driver.py
+++ b/driver.py
@@ -305,7 +305,7 @@ class TestCase:
 
     def checkState(self, callNo, refStateFileName):
         srcState = self.getState(callNo)
-        refState = json.load(open(refStateFileName, 'rt'), strict=False)
+        refState = self.getRefState(refStateFileName)
 
         from jsondiff import Comparer, Differ
         comparer = Comparer(ignore_added = True)
@@ -321,6 +321,14 @@ class TestCase:
             differ.visit(refState, srcState)
             fail('state from call %u does not match %s' % (callNo, refStateFileName))
 
+    # Allo non-standard JS comments in JSON
+    json_comment_re = re.compile(r'//.*$', re.MULTILINE)
+
+    def getRefState(self, refStateFileName):
+        data = open(refStateFileName, 'rt').read()
+        data = self.json_comment_re.sub('', data)
+        return json.loads(data, strict=False)
+
     def getNamePrefix(self):
         name = os.path.basename(self.ref_dump)
         try: