Changeset: 9f0ff119fc42 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9f0ff119fc42
Branch: default
Log Message:

merged


diffs (truncated from 328 to 300 lines):

diff --git a/clients/Tests/exports.py b/clients/Tests/exports.py
--- a/clients/Tests/exports.py
+++ b/clients/Tests/exports.py
@@ -1,4 +1,5 @@
 import sys
+import os
 import difflib
 import MonetDBtesting.listexports
 with open('exports.stable.out') as fil:
@@ -7,3 +8,14 @@ output = MonetDBtesting.listexports.list
 for line in difflib.unified_diff(stable, output,
                                  fromfile='expected', tofile='received'):
     sys.stderr.write(line)
+approve = os.getenv('MTEST_APPROVE')
+if approve:
+    with open(os.path.join(os.getenv('TSTTRGDIR'),
+                           'exports.stable.out.new'), 'w') as fil:
+        for line in output:
+            fil.write(line)
+    if approve == 'REPLACE':
+        with open(os.path.join(os.getenv('TSTSRCDIR'),
+                               'exports.stable.out'), 'w') as fil:
+            for line in output:
+                fil.write(line)
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1542,9 +1542,6 @@ void freeVariables(Client c, MalBlkPtr m
 str getBackendContext(Client cntxt, backend **be);
 str getSQLContext(Client cntxt, MalBlkPtr mb, mvc **c, backend **b);
 uint32_t get_le_uint32(unsigned char *c);
-uint16_t get_uint16_slow(unsigned char *c);
-uint32_t get_uint32_slow(unsigned char *c);
-uint64_t get_uint64_slow(unsigned char *c);
 str hge_dec2_bte(Client ctx, bte *res, const int *s1, const hge *v);
 str hge_dec2_dbl(Client ctx, dbl *res, const int *s1, const hge *v);
 str hge_dec2_flt(Client ctx, flt *res, const int *s1, const hge *v);
diff --git 
a/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.SQL.py 
b/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.SQL.py
--- a/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.SQL.py
+++ b/sql/test/BugDay_2005-10-06_2.8/Tests/MapiClient-dump.SF-905851.SQL.py
@@ -31,5 +31,15 @@ def main():
     for line in difflib.unified_diff(stable, output,
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'),
+                              'MapiClient-dump.SF-905851.stable.out')
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'),
+                              'MapiClient-dump.SF-905851.stable.out.new')
+        with open(fn, 'w') as f:
+            f.write(out)
 
 main()
diff --git a/sql/test/emptydb/Tests/check.SQL.py 
b/sql/test/emptydb/Tests/check.SQL.py
--- a/sql/test/emptydb/Tests/check.SQL.py
+++ b/sql/test/emptydb/Tests/check.SQL.py
@@ -48,6 +48,15 @@ if __name__ == '__main__':
     if opts.stableout is not None:
         stableout = opts.stableout
         check = True
+    if not approve and \
+       os.getenv('MTEST_APPROVE') and \
+       not os.path.exists(os.path.join(os.getenv('TSTSRCDIR'),
+                                       f'{stableout}.src')):
+        if os.getenv('MTEST_APPROVE') == 'REPLACE':
+            approve = os.path.join(os.getenv('TSTSRCDIR'), stableout)
+        else:
+            approve = os.path.join(os.getenv('TSTTRGDIR'),
+                                   'check.stable.out.new')
 
 xit = 0
 output = []
@@ -602,6 +611,9 @@ if check:
             fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    if type(approve) == str:
+        with open(approve, 'w') as f:
+            f.writelines(output)
 elif approve:
     approve.writelines(output)
 else:
diff --git a/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.py 
b/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.py
--- a/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.py
+++ b/sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.py
@@ -65,7 +65,7 @@ if len(sys.argv) == 2 and sys.argv[1] ==
     for b in bits:
         for a in arch:
             for h in hge:
-                f = 'upgrade.stable.out{}{}{}'.format(b, a, h)
+                f = f'upgrade.stable.out{b}{a}{h}'
                 found = os.path.exists(f)
                 if found:
                     break
@@ -85,6 +85,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.py 
b/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.py
--- a/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.py
+++ b/sql/test/testdb-previous-upgrade-chain/Tests/upgrade.py
@@ -65,7 +65,7 @@ if len(sys.argv) == 2 and sys.argv[1] ==
     for b in bits:
         for a in arch:
             for h in hge:
-                f = 'upgrade.stable.out{}{}{}'.format(b, a, h)
+                f = f'upgrade.stable.out{b}{a}{h}'
                 found = os.path.exists(f)
                 if found:
                     break
@@ -85,6 +85,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.py 
b/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.py
--- a/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.py
+++ b/sql/test/testdb-previous-upgrade-hge/Tests/upgrade.py
@@ -64,7 +64,7 @@ if len(sys.argv) == 2 and sys.argv[1] ==
     for b in bits:
         for a in arch:
             for h in hge:
-                f = 'upgrade.stable.out{}{}{}'.format(b, a, h)
+                f = f'upgrade.stable.out{b}{a}{h}'
                 found = os.path.exists(f)
                 if found:
                     break
@@ -84,6 +84,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-previous-upgrade/Tests/upgrade.py 
b/sql/test/testdb-previous-upgrade/Tests/upgrade.py
--- a/sql/test/testdb-previous-upgrade/Tests/upgrade.py
+++ b/sql/test/testdb-previous-upgrade/Tests/upgrade.py
@@ -65,7 +65,7 @@ if len(sys.argv) == 2 and sys.argv[1] ==
     for b in bits:
         for a in arch:
             for h in hge:
-                f = 'upgrade.stable.out{}{}{}'.format(b, a, h)
+                f = f'upgrade.stable.out{b}{a}{h}'
                 found = os.path.exists(f)
                 if found:
                     break
@@ -85,6 +85,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.py 
b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.py
--- a/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.py
+++ b/sql/test/testdb-upgrade-chain-hge/Tests/upgrade.py
@@ -80,6 +80,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-upgrade-chain/Tests/upgrade.py 
b/sql/test/testdb-upgrade-chain/Tests/upgrade.py
--- a/sql/test/testdb-upgrade-chain/Tests/upgrade.py
+++ b/sql/test/testdb-upgrade-chain/Tests/upgrade.py
@@ -80,6 +80,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-upgrade-hge/Tests/upgrade.py 
b/sql/test/testdb-upgrade-hge/Tests/upgrade.py
--- a/sql/test/testdb-upgrade-hge/Tests/upgrade.py
+++ b/sql/test/testdb-upgrade-hge/Tests/upgrade.py
@@ -80,6 +80,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb-upgrade/Tests/upgrade.py 
b/sql/test/testdb-upgrade/Tests/upgrade.py
--- a/sql/test/testdb-upgrade/Tests/upgrade.py
+++ b/sql/test/testdb-upgrade/Tests/upgrade.py
@@ -81,6 +81,14 @@ if len(sys.argv) == 2 and sys.argv[1] ==
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
         xit = 1
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'), f)
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'), f'{f}.new')
+        with open(fn, 'w') as fil:
+            fil.writelines(srvout)
 else:
     sys.stdout.writelines(srvout)
 
diff --git a/sql/test/testdb/Tests/dump.SQL.py 
b/sql/test/testdb/Tests/dump.SQL.py
--- a/sql/test/testdb/Tests/dump.SQL.py
+++ b/sql/test/testdb/Tests/dump.SQL.py
@@ -1,4 +1,5 @@
 import sys
+import os
 
 try:
     from MonetDBtesting import process
@@ -27,13 +28,23 @@ if len(sys.argv) == 2 and sys.argv[1] in
         if res is not None:
             points = ptsre.sub(r'(\g<0>)', res.group('points'))
             output[i] = line[:res.start('points')] + points + 
line[res.end('points'):]
-    stableout = '{}.stable.out'.format(sys.argv[1])
+    stableout = f'{sys.argv[1]}.stable.out'
     with open(stableout, encoding='utf-8') as fil:
         stable = fil.readlines()
     import difflib
     for line in difflib.unified_diff(stable, output,
                                      fromfile='expected', tofile='received'):
         sys.stderr.write(line)
+    approve = os.getenv('MTEST_APPROVE')
+    if approve:
+        if approve == 'REPLACE':
+            fn = os.path.join(os.getenv('TSTSRCDIR'),
+                              f'{sys.argv[1]}.stable.out')
+        else:
+            fn = os.path.join(os.getenv('TSTTRGDIR'),
+                              f'{sys.argv[1]}.stable.out.new')
+        with open(fn, 'w') as f:
+            f.writelines(out)
 else:
     sys.stdout.writelines(out)
 
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to