From 94c06249bc6fc63663170ca1113d7354baadce9b Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 11 Aug 2015 16:15:09 -0700 Subject: 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 --- generated_tests/gen_tcs_input_tests.py | 12 +++++++----- generated_tests/test_generators.py | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'generated_tests') 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'), } -- cgit v1.2.3