Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/expect_scripts/bytes-stdin-stdout.exp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/command-line-args.exp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
9 changes: 8 additions & 1 deletion ci/expect_scripts/command.exp
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@ XYZ=ABC
Yo
}]

expect_with_diff $expected_output
expect $expected_output {
expect eof {
check_exit_and_segfault
}
}

puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/env-var.exp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/file-permissions.exp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/file-read-write.exp
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/locale.exp
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ expect -re $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
278 changes: 95 additions & 183 deletions ci/expect_scripts/path-test.exp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci/expect_scripts/path.exp
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/print.exp
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
54 changes: 0 additions & 54 deletions ci/expect_scripts/shared-code.exp
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,6 @@ proc normalize_output {output} {
return $result
}

proc show_diff {expected actual} {
puts stderr "\n=== DIFF OUTPUT ==="
puts stderr "Expected:"
puts stderr [repr_string $expected]
puts stderr "\nActual:"
puts stderr [repr_string $actual]

# Line-by-line comparison
set exp_lines [split $expected "\r\n"]
set act_lines [split $actual "\r\n"]
set max_lines [expr {max([llength $exp_lines], [llength $act_lines])}]

puts stderr "\nLine-by-line comparison:"
for {set i 0} {$i < $max_lines} {incr i} {
set exp_line [lindex $exp_lines $i]
set act_line [lindex $act_lines $i]

if {$exp_line ne $act_line} {
puts stderr "Line [expr {$i + 1}] differs:"
puts stderr " Expected: [repr_string $exp_line]"
puts stderr " Actual: [repr_string $act_line]"
}
}
}

proc repr_string {str} {
# Show invisible characters
regsub -all {\r} $str "\\r" result
regsub -all {\n} $result "\\n" result
regsub -all {\t} $result "\\t" result
return "\"$result\""
}

proc expect_with_diff {expected_output} {
expect {
$expected_output {
expect eof {
check_exit_and_segfault
}
}
eof {
show_diff $expected_output $expect_out(buffer)
puts stderr "\nExpect script failed: output was different from expected value."
exit 1
}
timeout {
puts stderr "\nExpect script failed: timeout waiting for expected output."
puts stderr "Partial output received:"
puts stderr [repr_string $expect_out(buffer)]
exit 1
}
}
}

proc check_exit_and_segfault {} {
set status [wait]
set exit_code [lindex $status 2]
Expand Down
2 changes: 1 addition & 1 deletion ci/expect_scripts/sqlite-basic.exp
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/sqlite-everything.exp
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/tcp.exp
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ expect $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1
2 changes: 1 addition & 1 deletion ci/expect_scripts/utc.exp
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ expect -re $expected_output {
}
}

puts stderr "\nExpect script failed: output was different from expected value. uncomment `exp_internal 1` to debug."
puts stderr "\nExpect script failed: output was not as expected. Diff the output with expected_output in this script. Alternatively, uncomment `exp_internal 1` to debug."
exit 1