]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a TCL script that does various verification checks on the source tree
authordrh <>
Mon, 9 Oct 2023 14:59:42 +0000 (14:59 +0000)
committerdrh <>
Mon, 9 Oct 2023 14:59:42 +0000 (14:59 +0000)
to make sure that generated code has been updated correctly.

FossilOrigin-Name: dc8681c4864f1973ce6d667cc4670e3800bc8e39b44944da7de74faa715bc434

Makefile.in
manifest
manifest.uuid
tool/srctree-check.tcl [new file with mode: 0644]

index e938cec526016a1d67fdeedb3403ede6ec3e6515..9ad135b3da0bc3e601494fa2e973123250f1c331 100644 (file)
@@ -1312,17 +1312,23 @@ testrunner:     testfixture$(TEXE)
 
 # Runs both fuzztest and testrunner, consecutively.
 #
-devtest:       testfixture$(TEXE) fuzztest testrunner
+devtest:       srctree-check testfixture$(TEXE) fuzztest testrunner
 
-mdevtest:
+mdevtest: srctree-check
        $(TCLSH_CMD) $(TOP)/test/testrunner.tcl mdevtest
 
 sdevtest:
        $(TCLSH_CMD) $(TOP)/test/testrunner.tcl sdevtest
 
+# Validate that various generated files in the source tree
+# are up-to-date.
+#
+srctree-check: $(TOP)/tool/srctree-check.tcl
+       $(TCLSH_CMD) $(TOP)/tool/srctree-check.tcl
+
 # Testing for a release
 #
-releasetest: testfixture$(TEXE)
+releasetest: srctree-check testfixture$(TEXE)
        ./testfixture$(TEXE) $(TOP)/test/testrunner.tcl release
 
 # Minimal testing that runs in less than 3 minutes
@@ -1333,7 +1339,7 @@ quicktest:        ./testfixture$(TEXE)
 # This is the common case.  Run many tests that do not take too long,
 # including fuzzcheck, sqlite3_analyzer, and sqldiff tests.
 #
-test:  fuzztest sourcetest $(TESTPROGS) tcltest
+test:  srctree-check fuzztest sourcetest $(TESTPROGS) tcltest
 
 # Run a test using valgrind.  This can take a really long time
 # because valgrind is so much slower than a native machine.
index 9058397d1d4a6791ca5f7888e3f3d290f19d91cd..f848360c9c8a90fccc9f0207b3cec0694eacb969 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C Change\sthe\sTEA\sversion\snumber\sto\s3.43.2\salso.
-D 2023-10-09T14:12:44.057
+C Add\sa\sTCL\sscript\sthat\sdoes\svarious\sverification\schecks\son\sthe\ssource\stree\nto\smake\ssure\sthat\sgenerated\scode\shas\sbeen\supdated\scorrectly.
+D 2023-10-09T14:59:42.436
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
-F Makefile.in 1e9105ffed727b1557ce59f0941c5d271e276ec00bc9823f03d77a89e131b918
+F Makefile.in 0f17b4b3550aae10deb5475429a2388a0960ebe85a29d1dd97aa0a2444b0bf48
 F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
 F Makefile.msc 26c2d196391a285c279adb10fd6001774d9b243af94b700b681e4a49cd476684
 F README.md 963d30019abf0cc06b263cd2824bce022893f3f93a531758f6f04ff2194a16a8
@@ -2060,6 +2060,7 @@ F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaa
 F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
 F tool/src-verify.c 41c586dee84d0b190ad13e0282ed83d4a65ec9fefde9adf4943efdf6558eea7f
 F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
+F tool/srctree-check.tcl cef630bc4ff21a460d72479c43a42bf1c1ed61897659305c35c8d72e91bcb176
 F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
 F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37
 F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
@@ -2092,8 +2093,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 0bd1199bb3f7bd3fcc421d2c3834d04c35cbfd611457554e4f9f9a992c4bf1f5
-R 403b7b035b1547c58c8b57126da2b7ff
+P 170ab8d102424994fd3f1e7d9ef94a3f6814de70cdc6ded4e571df264825b620
+Q +1f1a358af77f4386f98010eeae8487e6d39548a6dfe58c2664552490e7661122
+R 89563523ab0148d5d3a451bbeb90479c
 U drh
-Z a2f56ed9610a3a58185ed78c1d4a3642
+Z 0e34d5404a7b921b7b91e30a39418f64
 # Remove this line to create a well-formed Fossil manifest.
index 55cf714c73df30d4cbfc0af78e8a56263c4f80bf..a531afa63c717c5b93f01c52e5a2ecdf2ba63188 100644 (file)
@@ -1 +1 @@
-170ab8d102424994fd3f1e7d9ef94a3f6814de70cdc6ded4e571df264825b620
\ No newline at end of file
+dc8681c4864f1973ce6d667cc4670e3800bc8e39b44944da7de74faa715bc434
\ No newline at end of file
diff --git a/tool/srctree-check.tcl b/tool/srctree-check.tcl
new file mode 100644 (file)
index 0000000..234e70f
--- /dev/null
@@ -0,0 +1,79 @@
+#!/usr/bin/tclsh
+#
+# Run this script from the top of the source tree in order to confirm that
+# various aspects of the source tree are up-to-date.  Items checked include:
+#
+#     *    Makefile.msc and autoconf/Makefile.msc agree
+#     *    src/ctime.tcl is consistent with tool/mkctimec.tcl
+#     *    VERSION agrees with autoconf/tea/configure.ac
+#     *    src/pragma.h agrees with tool/mkpragmatab.tcl
+#
+# Other tests might be added later.  
+#
+# Error messages are printed and the process exists non-zero if problems
+# are found.  If everything is ok, no output is generated and the process
+# exits with 0.
+#
+
+# Read an entire file.
+#
+proc readfile {filename} {
+  set fd [open $filename rb]
+  set txt [read $fd]
+  close $fd
+  return $txt
+}
+
+# Find the root of the tree.
+#
+set ROOT [file dir [file dir [file normalize $argv0]]]
+cd $ROOT
+
+# Name of the TCL interpreter
+#
+set TCLSH [info nameofexe]
+
+######################### autoconf/tea/configure.ac ###########################
+
+set confac [readfile $ROOT/autoconf/tea/configure.ac]
+set vers [readfile $ROOT/VERSION]
+set pattern {AC_INIT([sqlite],[}
+append pattern [string trim $vers]
+append pattern {])}
+if {[string first $pattern $confac]<=0} {
+  puts "ERROR: ./autoconf/tea/configure.ac does not agree with ./VERSION"
+  exit 1
+}
+
+######################### autoconf/Makefile.msc ###############################
+
+set f1 [readfile $ROOT/autoconf/Makefile.msc]
+exec mv $ROOT/autoconf/Makefile.msc $ROOT/autoconf/Makefile.msc.tmp
+exec $TCLSH $ROOT/tool/mkmsvcmin.tcl
+set f2 [readfile $ROOT/autoconf/Makefile.msc]
+exec mv $ROOT/autoconf/Makefile.msc.tmp $ROOT/autoconf/Makefile.msc
+if {$f1 != $f2} {
+  puts "ERROR: ./autoconf/Makefile.msc does not agree with ./Makefile.msc"
+}
+
+######################### src/pragma.h ########################################
+
+set f1 [readfile $ROOT/src/pragma.h]
+exec mv $ROOT/src/pragma.h $ROOT/src/pragma.h.tmp
+exec $TCLSH $ROOT/tool/mkpragmatab.tcl
+set f2 [readfile $ROOT/src/pragma.h]
+exec mv $ROOT/src/pragma.h.tmp $ROOT/src/pragma.h
+if {$f1 != $f2} {
+  puts "ERROR: ./src/pragma.h does not agree with ./tool/mkpragmatab.tcl"
+}
+
+######################### src/ctime.c ########################################
+
+set f1 [readfile $ROOT/src/ctime.c]
+exec mv $ROOT/src/ctime.c $ROOT/src/ctime.c.tmp
+exec $TCLSH $ROOT/tool/mkctimec.tcl
+set f2 [readfile $ROOT/src/ctime.c]
+exec mv $ROOT/src/ctime.c.tmp $ROOT/src/ctime.c
+if {$f1 != $f2} {
+  puts "ERROR: ./src/ctime.c does not agree with ./tool/mkctimec.tcl"
+}