[Piglit] [PATCH 05/49] Generators/cl_store: Move makedirs into main

Dylan Baker dylan at pnwbakers.com
Fri Jul 29 18:38:51 UTC 2016


Executing code in the global scope that isn't in main isn't a
particularly good idea, but for our testing we call the main() function,
so moving this into main fixes the test, and it also improves the code
quality a bit.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 generated_tests/gen_cl_store_tests.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/generated_tests/gen_cl_store_tests.py b/generated_tests/gen_cl_store_tests.py
index 1153e62..52a722e 100644
--- a/generated_tests/gen_cl_store_tests.py
+++ b/generated_tests/gen_cl_store_tests.py
@@ -35,7 +35,6 @@ TYPES = ['char', 'uchar', 'short', 'ushort', 'int', 'uint', 'long', 'ulong', 'fl
 VEC_SIZES = ['', '2', '4', '8', '16']
 
 dirName = os.path.join("cl", "store")
-utils.safe_makedirs(dirName)
 
 
 def gen_array(size):
@@ -68,6 +67,8 @@ def begin_test(type_name, addr_space):
 
 
 def main():
+    utils.safe_makedirs(dirName)
+
     for t in TYPES:
         for s in VEC_SIZES:
             if s == '':
-- 
2.9.0



More information about the Piglit mailing list