Changeset: 30ca200ecc5a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=30ca200ecc5a
Modified Files:
        testing/Mtest.py.in
        testing/helpers.py
        testing/sqllogictest.py
Branch: mtest
Log Message:

mark req tests in  ctx


diffs (59 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1663,6 +1663,7 @@ def RunSQLLogicTest(env, Test, TestOut, 
             msg = "Connection refused"
             print(e, file=f) 
         else:
+            # TODO handle exception 
             sql.drop()
             try:
                 sql.parse(Test)
diff --git a/testing/helpers.py b/testing/helpers.py
--- a/testing/helpers.py
+++ b/testing/helpers.py
@@ -51,7 +51,8 @@ def process_test_dir(dir_path:str, ctx={
             else:
                 raise ValueError('ERROR: {} does not appear to be valid test 
name. Check {}/All'.format(tn, dir_path))
         tests = filtered
-    tests_out = []
+    test_index = []
+    test_lookup = {}
     for cond, test_name in tests:
         test_path = os.path.join(real_dir_path, test_name)
         test = {
@@ -82,6 +83,11 @@ def process_test_dir(dir_path:str, ctx={
                 for l in f:
                     reqtests.append(l.strip())
             test['reqtests'] = reqtests
+            for r in reqtests:
+                try:
+                    test_lookup[r]['is_reqtest'] = True
+                except KeyError:
+                    print("WARNING: test name {} required to be declared 
before {}".format(r, test_name))
             #for r in reqtests:
             #    rp = os.path.join(real_dir_path, test_name)
             #    for ext, _, _, _ in lookup:
@@ -130,7 +136,9 @@ def process_test_dir(dir_path:str, ctx={
         else:
             print("WARNING: test name {} declared but not found under 
{}".format(test_name, dir_path))
             continue
-        tests_out.append(test)
+        test_index.append(test_name)
+        test_lookup[test_name] = test
+    tests_out = list(map(lambda x: test_lookup[x], test_index))
     folder['test_count'] = len(tests_out)
     folder['tests'] = tests_out
     ctx['test_folders'].append(folder)
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -71,7 +71,7 @@ class SQLLogic:
         else:
             if expectok:
                 return
-        self.query_error(statement, "statement didn't give expected result", 
expectok and "statement was expected to succeed but didn't" or "statement was 
expected to fail bat didn't")
+        self.query_error(statement, "statement didn't give expected result", 
expectok and "statement was expected to succeed but didn't" or "statement was 
expected to fail but didn't")
 
     def convertresult(self, query, columns, data):
         ndata = []
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to