From: José Fonseca Date: Wed, 7 Dec 2011 12:03:23 +0000 (+0000) Subject: Add tweaks/comments to default.ref.json X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=commitdiff_plain;h=195b2e54eda22ea844af868ac6990c45e8772d37 Add tweaks/comments to default.ref.json --- diff --git a/README.markdown b/README.markdown index 9108088..a2db32e 100644 --- a/README.markdown +++ b/README.markdown @@ -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 diff --git a/apps/gl/default.ref.json b/apps/gl/default.ref.json index ca0a627..0d085d3 100644 --- a/apps/gl/default.ref.json +++ b/apps/gl/default.ref.json @@ -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, @@ -78,9 +78,10 @@ "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, @@ -138,6 +139,8 @@ "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, diff --git a/driver.py b/driver.py index 871ef09..39d7420 100755 --- 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: