Mercurial > vim
comparison src/libvterm/t/run-test.pl @ 20488:1d595fada804 v8.2.0798
patch 8.2.0798: libvterm code lags behind the upstream version
Commit: https://github.com/vim/vim/commit/be593bf135f6967335b14ba188bd5f8f32175c75
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 19 21:20:04 2020 +0200
patch 8.2.0798: libvterm code lags behind the upstream version
Problem: Libvterm code lags behind the upstream version.
Solution: Include revisions 755 - 758.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 19 May 2020 21:30:07 +0200 |
parents | dc88c690f19b |
children | 55a373a243c0 |
comparison
equal
deleted
inserted
replaced
20487:f4ada29cdf4b | 20488:1d595fada804 |
---|---|
9 | 9 |
10 my $VALGRIND = 0; | 10 my $VALGRIND = 0; |
11 my $EXECUTABLE = "t/.libs/harness"; | 11 my $EXECUTABLE = "t/.libs/harness"; |
12 GetOptions( | 12 GetOptions( |
13 'valgrind|v+' => \$VALGRIND, | 13 'valgrind|v+' => \$VALGRIND, |
14 'executable|e=s' => \$EXECUTABLE | 14 'executable|e=s' => \$EXECUTABLE, |
15 'fail-early|F' => \(my $FAIL_EARLY), | |
15 ) or exit 1; | 16 ) or exit 1; |
16 | 17 |
17 my ( $hin, $hout, $hpid ); | 18 my ( $hin, $hout, $hpid ); |
18 { | 19 { |
19 local $ENV{LD_LIBRARY_PATH} = ".libs"; | 20 local $ENV{LD_LIBRARY_PATH} = ".libs"; |
63 print "# Expected: $_\n" . | 64 print "# Expected: $_\n" . |
64 "# didn't happen\n" for @expect; | 65 "# didn't happen\n" for @expect; |
65 } | 66 } |
66 | 67 |
67 $exitcode = 1 if $fail_printed; | 68 $exitcode = 1 if $fail_printed; |
69 exit $exitcode if $exitcode and $FAIL_EARLY; | |
68 } | 70 } |
69 | 71 |
70 sub do_line | 72 sub do_line |
71 { | 73 { |
72 my ( $line ) = @_; | 74 my ( $line ) = @_; |
103 $line = sprintf "control %02x", eval($1); | 105 $line = sprintf "control %02x", eval($1); |
104 } | 106 } |
105 elsif( $line =~ m/^csi (\S+) (.*)$/ ) { | 107 elsif( $line =~ m/^csi (\S+) (.*)$/ ) { |
106 $line = sprintf "csi %02x %s", eval($1), $2; # TODO | 108 $line = sprintf "csi %02x %s", eval($1), $2; # TODO |
107 } | 109 } |
108 elsif( $line =~ m/^(escape|osc|dcs) (.*)$/ ) { | 110 elsif( $line =~ m/^(osc) (\[\d+)? *(.*?)(\]?)$/ ) { |
109 $line = "$1 " . join "", map sprintf("%02x", $_), unpack "C*", eval($2); | 111 my ( $cmd, $initial, $data, $final ) = ( $1, $2, $3, $4 ); |
112 $initial //= ""; | |
113 $initial .= ";" if $initial =~ m/\d+/; | |
114 | |
115 $line = "$cmd $initial" . join( "", map sprintf("%02x", $_), unpack "C*", eval($data) ) . "$final"; | |
116 } | |
117 elsif( $line =~ m/^(escape|dcs) (\[?)(.*?)(\]?)$/ ) { | |
118 $line = "$1 $2" . join( "", map sprintf("%02x", $_), unpack "C*", eval($3) ) . "$4"; | |
110 } | 119 } |
111 elsif( $line =~ m/^putglyph (\S+) (.*)$/ ) { | 120 elsif( $line =~ m/^putglyph (\S+) (.*)$/ ) { |
112 $line = "putglyph " . join( ",", map sprintf("%x", $_), eval($1) ) . " $2"; | 121 $line = "putglyph " . join( ",", map sprintf("%x", $_), eval($1) ) . " $2"; |
113 } | 122 } |
114 elsif( $line =~ m/^(?:movecursor|scrollrect|moverect|erase|damage|sb_pushline|sb_popline|settermprop|setmousefunc) / ) { | 123 elsif( $line =~ m/^(?:movecursor|scrollrect|moverect|erase|damage|sb_pushline|sb_popline|settermprop|setmousefunc) / ) { |
137 if( $response ne $want ) { | 146 if( $response ne $want ) { |
138 print "# line $linenum: Assert ?screen_row $row failed:\n" . | 147 print "# line $linenum: Assert ?screen_row $row failed:\n" . |
139 "# Expected: $want\n" . | 148 "# Expected: $want\n" . |
140 "# Actual: $response\n"; | 149 "# Actual: $response\n"; |
141 $exitcode = 1; | 150 $exitcode = 1; |
151 exit $exitcode if $exitcode and $FAIL_EARLY; | |
142 } | 152 } |
143 } | 153 } |
144 # Assertions start with '?' | 154 # Assertions start with '?' |
145 elsif( $line =~ s/^\?([a-z]+.*?=)\s*// ) { | 155 elsif( $line =~ s/^\?([a-z]+.*?=)\s*// ) { |
146 do_onetest if defined $command; | 156 do_onetest if defined $command; |
160 if( $response ne $expectation ) { | 170 if( $response ne $expectation ) { |
161 print "# line $linenum: Assert $assertion failed:\n" . | 171 print "# line $linenum: Assert $assertion failed:\n" . |
162 "# Expected: $expectation\n" . | 172 "# Expected: $expectation\n" . |
163 "# Actual: $response\n"; | 173 "# Actual: $response\n"; |
164 $exitcode = 1; | 174 $exitcode = 1; |
175 exit $exitcode if $exitcode and $FAIL_EARLY; | |
165 } | 176 } |
166 } | 177 } |
167 # Test controls start with '$' | 178 # Test controls start with '$' |
168 elsif( $line =~ s/\$SEQ\s+(\d+)\s+(\d+):\s*// ) { | 179 elsif( $line =~ s/\$SEQ\s+(\d+)\s+(\d+):\s*// ) { |
169 my ( $low, $high ) = ( $1, $2 ); | 180 my ( $low, $high ) = ( $1, $2 ); |