interplane.Get Omega
Read in your language

sqlite

[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.

Brought by drakestapleton

branch master Branches Tags History

sqlite / tool / srctree-check.tcl

47 lines · 1204 bytes Raw Blame History
1#!/usr/bin/tclsh
2#
3# Run this script from the top of the source tree in order to confirm that
4# various aspects of the source tree are up-to-date. Items checked include:
5#
6# * Makefile.msc and autoconf/Makefile.msc agree
7# * VERSION agrees with autoconf/tea/configure.ac
8#
9# Other tests might be added later.
10#
11# Error messages are printed and the process exists non-zero if problems
12# are found. If everything is ok, no output is generated and the process
13# exits with 0.
14#
15
16# Read an entire file.
17#
18proc readfile {filename} {
19 set fd [open $filename rb]
20 set txt [read $fd]
21 close $fd
22 return $txt
23}
24
25# Find the root of the tree.
26#
27set ROOT [file dir [file dir [file normalize $argv0]]]
28
29# Name of the TCL interpreter
30#
31set TCLSH [info nameofexe]
32
33# Number of errors seen.
34#
35set NERR 0
36
37######################### autoconf/Makefile.msc ###############################
38
39set f1 [readfile $ROOT/autoconf/Makefile.msc]
40exec $TCLSH $ROOT/tool/mkmsvcmin.tcl $ROOT/Makefile.msc tmp1.txt
41set f2 [readfile tmp1.txt]
42file delete tmp1.txt
43if {$f1 != $f2} {
44 puts "ERROR: ./autoconf/Makefile.msc does not agree with ./Makefile.msc"
45 puts "...... Fix: tclsh tool/mkmsvcmin.tcl"
46 incr NERR
47}