diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2015-08-11 16:15:09 -0700 |
---|---|---|
committer | Dylan Baker <baker.dylan.c@gmail.com> | 2015-11-05 14:24:33 -0800 |
commit | 94c06249bc6fc63663170ca1113d7354baadce9b (patch) | |
tree | 7cadb42ec22af8488741b0ea18ad2c6cac5f69f5 /generated_tests | |
parent | ffdb4bb9727e486dd56b00ef86b2fd10e392253c (diff) |
gen_tcs_input_tests.py: use six.moves.range
This allows the generator to run with python 3.x, but it produces
a different result than 2.x does.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'generated_tests')
-rw-r--r-- | generated_tests/gen_tcs_input_tests.py | 12 | ||||
-rw-r--r-- | generated_tests/test_generators.py | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/generated_tests/gen_tcs_input_tests.py b/generated_tests/gen_tcs_input_tests.py index 5d2b4a5db..9e761aff6 100644 --- a/generated_tests/gen_tcs_input_tests.py +++ b/generated_tests/gen_tcs_input_tests.py @@ -42,6 +42,8 @@ import os import sys import random +from six.moves import range + class Test(object): def __init__(self, type_name, array, name): @@ -99,12 +101,12 @@ class Test(object): data = self.test_data() uniforms = '' if self.var_array: - for i in xrange(12): - for j in xrange(self.var_array): + for i in range(12): + for j in range(self.var_array): uniforms += 'uniform {0} reference[{1}].v[{2}] {3}\n'.format( self.var_type, i, j, data[i*j]) else: - for i in xrange(12): + for i in range(12): uniforms += 'uniform {0} reference[{1}].v {2}\n'.format( self.var_type, i, @@ -155,8 +157,8 @@ class Test(object): c = self.components() ret = [] - for i in xrange(n): - ret.append(" ".join(str(rand()) for _ in xrange(c))) + for i in range(n): + ret.append(" ".join(str(rand()) for _ in range(c))) return ret diff --git a/generated_tests/test_generators.py b/generated_tests/test_generators.py index 21d20f61c..0f9e22788 100644 --- a/generated_tests/test_generators.py +++ b/generated_tests/test_generators.py @@ -49,7 +49,6 @@ BLACKLIST = set([os.path.abspath(os.path.join(os.path.dirname(__file__), _p)) # True or False (True if it is expected to fail. This allows us to have # condtional failures, like when we expect python3 to fail. EXPECTED_FAILS = { - 'gen_tcs_input_tests.py': sys.version.startswith('3'), } |