Mercurial > hg > xemacs-beta
annotate tests/autoconf/regressiontest.pl @ 4967:0d4c9d0f6a8d
rewrite dynarr code
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-03 Ben Wing <ben@xemacs.org>
* device-x.c (x_get_resource_prefix):
* device-x.c (Fx_get_resource):
* device-x.c (Fx_get_resource_prefix):
* device-x.c (Fx_put_resource):
* dialog-msw.c:
* dialog-msw.c (handle_question_dialog_box):
* dired-msw.c (mswindows_sort_files):
* dired-msw.c (mswindows_get_files):
* extents.c (extent_fragment_sort_by_priority):
* extents.c (Fset_extent_parent):
* file-coding.c (coding_reader):
* file-coding.c (coding_writer):
* file-coding.c (gzip_convert):
* frame.c (generate_title_string):
* gutter.c (calculate_gutter_size_from_display_lines):
* indent.c (vmotion_1):
* lread.c (read_bit_vector):
* mule-coding.c (iso2022_decode):
* rangetab.c:
* rangetab.c (Fcopy_range_table):
* rangetab.c (Fget_range_table):
* rangetab.c (unified_range_table_copy_data):
* redisplay-msw.c (mswindows_output_string):
* redisplay-output.c (output_display_line):
* redisplay-output.c (redisplay_move_cursor):
* redisplay-output.c (redisplay_clear_bottom_of_window):
* redisplay-tty.c (tty_output_ichar_dynarr):
* redisplay-tty.c (set_foreground_to):
* redisplay-tty.c (set_background_to):
* redisplay-xlike-inc.c (XLIKE_output_string):
* redisplay.c (redisplay_window_text_width_string):
* redisplay.c (redisplay_text_width_string):
* redisplay.c (create_text_block):
* redisplay.c (SET_CURRENT_MODE_CHARS_PIXSIZE):
* redisplay.c (generate_fstring_runes):
* redisplay.c (regenerate_modeline):
* redisplay.c (ensure_modeline_generated):
* redisplay.c (real_current_modeline_height):
* redisplay.c (create_string_text_block):
* redisplay.c (regenerate_window):
* redisplay.c (REGEN_INC_FIND_START_END):
* redisplay.c (point_visible):
* redisplay.c (redisplay_window):
* redisplay.c (mark_glyph_block_dynarr):
* redisplay.c (line_start_cache_start):
* redisplay.c (start_with_line_at_pixpos):
* redisplay.c (update_line_start_cache):
* redisplay.c (glyph_to_pixel_translation):
* redisplay.c (pixel_to_glyph_translation):
* sysdep.c (qxe_readdir):
* text.c (dfc_convert_to_external_format):
* text.c (dfc_convert_to_internal_format):
* toolbar-common.c (common_output_toolbar_button):
* window.c (window_modeline_height):
* window.c (Fwindow_last_line_visible_height):
* window.c (window_displayed_height):
* window.c (window_scroll):
* window.c (get_current_pixel_pos):
Use Dynarr_begin() in place of Dynarr_atp (foo, 0).
* dynarr.c (Dynarr_realloc):
* dynarr.c (Dynarr_lisp_realloc):
* dynarr.c (Dynarr_resize):
* dynarr.c (Dynarr_insert_many):
* dynarr.c (Dynarr_delete_many):
* dynarr.c (Dynarr_memory_usage):
* dynarr.c (stack_like_malloc):
* dynarr.c (stack_like_free):
* lisp.h:
* lisp.h (DECLARE_DYNARR_LISP_IMP):
* lisp.h (XD_DYNARR_DESC):
* lisp.h (Dynarr_pop):
* gutter.c (output_gutter):
* redisplay-output.c (sync_rune_structs):
* redisplay-output.c (redisplay_output_window):
Redo the dynarr code, add greater checks.
Rename the `len', `largest' and `max' members to `len_',
`largest_' and `max_' to try and catch existing places that might
directly modify these values. Make new accessors Dynarr_largest()
and Dynarr_max() and make them and existing Dynarr_length() be
non-lvalues by adding '+ 0' to them; fix a couple of places in the
redisplay code that tried to modify the length directly by setting
Dynarr_length(). Use the accessors whenever possible even in the
dynarr code itself. The accessors also verify that 0 <= len <=
largest <= max. Rename settor function Dynarr_set_size() to
Dynarr_set_length() and use it more consistently; also create
lower-level Dynarr_set_length_1(). This latter function should be
the only function that directly modifies the `len_' member of a
Dynarr, and in the process makes sure that the `largest' value is
kept correct.
Consistently use ERROR_CHECK_STRUCTURES instead of
ERROR_CHECK_TYPES for error-checking code. Reintroduce the
temporarily disabled verification code on the positions of
Dynarr_at(), Dynarr_atp() and Dynarr_atp_past_end().
Also create Dynarr_resize_if() in place of a repeated
code fragment. Clean up all the functions that modify Dynarrs to
use the new macros and functions and verify the correctness of the
Dynarr both before and after the change.
Note that there are two kinds of verification -- one for accessing
and one for modifying. The difference is that the modify
verification additionally checks to make sure that the Dynarr
isn't locked. (This is used in redisplay to check for problems
with reentrancy.)
* lrecord.h: Move XD_DYNARR_DESC to lisp.h, grouping with the dynarr code.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 03 Feb 2010 20:51:18 -0600 |
parents | aa5ed11f473b |
children | 308d34e9f07d |
rev | line source |
---|---|
2651 | 1 #!/usr/bin/perl -w |
2 # | |
4739
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
3 # Copyright 2005 Malcolm Purvis |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
4 # |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
5 # This file is part of XEmacs. |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
6 # |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
7 # XEmacs is free software; you can redistribute it and/or modify it |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
8 # under the terms of the GNU General Public License as published by the |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
9 # Free Software Foundation; either version 2, or (at your option) any |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
10 # later version. |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
11 # |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
12 # XEmacs is distributed in the hope that it will be useful, but WITHOUT |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
15 # for more details. |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
16 # |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
17 # You should have received a copy of the GNU General Public License |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
18 # along with XEmacs; see the file COPYING. If not, write to |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
19 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
20 # Boston, MA 02110-1301, USA. |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
21 # |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
22 # Commentary |
679041362cd4
Add permissions notices to sigpipe.c and regressiontest.pl.
Stephen J. Turnbull <stephen@xemacs.org>
parents:
3094
diff
changeset
|
23 # |
2651 | 24 # Try the new and old versions of configure with various command lines to see |
25 # if they produce identical output. | |
26 # | |
27 # Invocation: $0 /path/to/old/configure /path/to/new/configure | |
28 # | |
29 # Since not all tests use --srcdir, invoke this script from a directory where | |
30 # configure can automatically find its input files (Makefile.in.in, etc). If | |
31 # interrupted, it probably will leave its temporary directories behind. In | |
32 # that case, it will error on next invocation, but remove the directories. | |
33 # The next invocation will then succeed. | |
34 # | |
35 | |
36 use strict; | |
37 use File::Basename; | |
38 | |
39 # Files generated by configure. There should be no functional difference | |
40 # between these files generated by 2.13 and those generated by 2.59. | |
41 my @output_files = | |
42 ( | |
43 "Installation", | |
44 "Makefile.in", | |
45 "./Makefile", | |
46 "./GNUmakefile", | |
47 "lib-src/Makefile.in", | |
48 "lib-src/Makefile", | |
49 "lib-src/GNUmakefile", | |
50 # "lib-src/config.values", # This is specific to the version of autoconf. | |
51 "lib-src/ellcc.h", | |
52 "lwlib/Makefile.in", | |
53 "lwlib/Makefile", | |
54 "lwlib/GNUmakefile", | |
55 "lwlib/config.h", | |
56 "modules/ldap/Makefile.in", | |
57 "modules/ldap/Makefile", | |
58 "modules/ldap/GNUmakefile", | |
59 "modules/postgresql/Makefile.in", | |
60 "modules/postgresql/Makefile", | |
61 "modules/postgresql/GNUmakefile", | |
62 "netinstall/Makefile.in", | |
63 "netinstall/Makefile", | |
64 "src/Makefile.in", | |
65 "src/Makefile", | |
66 "src/GNUmakefile", | |
67 "src/config.h", | |
68 "src/paths.h", | |
69 "src/xemacs.def.in", | |
70 "src/xemacs.def", | |
71 ); | |
72 | |
73 # The list of complete command line arguments to test against. Since the | |
74 # command line arguments have changed between 2.13 and 2.59 this hash maps from | |
75 # old => new. If new is 'undef' then the old arguments are used instead. | |
76 my %config_args = | |
77 ( | |
78 " " => undef, | |
79 "--prefix=/tmp/foo" => undef, | |
80 "--with-gnome" => undef, | |
81 "--with-mule" => "--enable-mule", | |
82 # My build flags for MacOS X. Needs /sw (fink) to be present. | |
83 # "--prefix=/Users/malcolmp/prefix --site-prefixes=/sw --with-sound=none --with-database=no --without-ldap --without-postgresql" => | |
84 # "--prefix=/Users/malcolmp/prefix --with-site-prefixes=/sw --disable-sound --disable-database --without-ldap --without-postgresql", | |
85 # My build flags for Linux (powerpc64) | |
86 "--prefix=/usr/local/gcc3-world --package-path=/usr/local/lib/xemacs" => | |
87 "--prefix=/usr/local/gcc3-world --with-package-path=/usr/local/lib/xemacs", | |
88 "--use_union_type" => "--enable-union-type", | |
89 "--use_kkcc" => "--enable-kkcc", | |
90 "--xemacs-compiler=g++" => "--with-xemacs-compiler=g++", | |
91 "--lispdir=/tmp/foo" => "--with-lispdir=/tmp/foo", | |
92 "--moduledir=/tmp/foo" => "--with-moduledir=/tmp/foo", | |
93 "--etcdir=/tmp/foo" => "--with-etcdir=/tmp/foo", | |
94 "--infopath=/tmp/foo" => "--with-infopath=/tmp/foo", | |
95 "--archlibdir=/tmp/foo" => "--with-archlibdir=/tmp/foo", | |
96 "--docdir=/tmp/foo" => "--with-docdir=/tmp/foo", | |
97 "--package-prefix=/tmp/foo" => "--with-package-prefix=/tmp/foo", | |
98 "--package-path=/tmp/foo" => "--with-package-path=/tmp/foo", | |
99 "--datadir=/tmp/foo" => undef, | |
100 "--mandir=/tmp/foo" => undef, | |
101 "--infodir=/tmp/foo" => undef, | |
102 "--libdir=/tmp/foo" => undef, | |
103 "--exec-prefix=/tmp/foo" => undef, | |
104 "--with-athena=3d" => undef, | |
3094 | 105 "--with-mule --with-xft=emacs --debug --error-checking=all --with-xim=xlib --with-widgets=athena --with-athena=3d --with-dialogs=athena --memory-usage-stats --use-number-lib=gmp --site-prefixes=/opt/local:/sw --with-ldap=no --use-union-type" => "--enable-mule --with-xft=emacs --enable-debug --enable-error-checking=all --with-xim=xlib --enable-widgets=athena --with-athena=3d --enable-dialogs=athena --enable-memory-usage-stats --enable-bignum=gmp --with-site-prefixes=/opt/local:/sw --with-ldap=no --enable-union-type" |
2651 | 106 ); |
107 | |
108 die "Usage: $0 /path/to/configure-2.13 /path/to/configure-2.59\n" if scalar(@ARGV) != 2; | |
109 | |
110 my $old_configure = $ARGV[0]; | |
111 my $new_configure = $ARGV[1]; | |
112 my $old_dir = dirname($old_configure); | |
113 my $new_dir = dirname($new_configure); | |
114 | |
115 foreach my $old_arg (keys %config_args) { | |
116 mkdir "/tmp/old" or die "$0: Cannot create /tmp/old: $!\n"; | |
117 mkdir "/tmp/new" or die "$0: Cannot create /tmp/new: $!\n"; | |
118 | |
119 my $new_arg = $config_args{$old_arg}; | |
120 $new_arg = $old_arg if ! defined($new_arg); | |
121 | |
122 print "--------------------------------------------------\n"; | |
123 print "$old_configure $old_arg\n"; | |
124 print "$new_configure $new_arg\n"; | |
125 | |
126 chdir "/tmp/old" or die "$0: Cannot cd to /tmp/old: $!\n"; | |
127 system ("$old_configure $old_arg >/tmp/old-output.txt\n") == 0 or | |
128 die "$0: $old_configure $old_arg failed\n"; | |
129 | |
130 chdir "/tmp/new" or die "$0: Cannot cd to /tmp/new: $!\n"; | |
131 system ("$new_configure $new_arg >/tmp/new-output.txt\n") == 0 or | |
132 die "$0: $new_configure $new_arg failed\n"; | |
133 | |
134 foreach my $file (@output_files) { | |
135 if (-r "/tmp/old/$file" && -r "/tmp/new/$file") { | |
136 # Strip out parts that always differ: Paths and the 'Generated by configure' | |
137 # lines. | |
138 system("for i in /tmp/old/$file /tmp/new/$file ; do sed -e '/HAVE_DECL_SYS_SIGLIST/d' -e '\\!$old_configure!d' -e '\\!$new_configure!d' -e '/EMACS_CONFIG_OPTIONS/d' -e '/Generated.*configure/d' -e '\\!$old_dir!s///' -e '\\!$new_dir!s///' -e '\\!/tmp/new!s///' -e '\\!/tmp/old!s///' <\$i >\$i.processed ; done"); | |
139 # Compare the processed versions. These should be the same. | |
140 system "diff -U 0 -L old-$file -L new-$file /tmp/old/$file.processed /tmp/new/$file.processed"; | |
141 } | |
142 } | |
143 chdir "/"; | |
144 system("rm -rf /tmp/old /tmp/new"); | |
145 } | |
146 | |
147 END { | |
148 chdir "/"; | |
149 system("rm -rf /tmp/old /tmp/new"); | |
150 } |