Skip Menu |

This queue is for tickets about the Image-Sane CPAN distribution.

Report information
The Basics
Id: 122334
Status: resolved
Priority: 0/
Queue: Image-Sane

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.12
Fixed in: (no value)



Subject: t/81_scanimage-perl.t fails because scanimage reports "Batch terminated"
Some t/81_scanimage-perl.t tests fail for me like this: # Failed test '--device=test --batch-count=2 2>&1; identify -format '%m %G %g %z-bit %r' out*.pnm; rm out*.pnm' # at t/81_scanimage-perl.t line 41. # got: 'Scanning 2 pages, incrementing by 1, numbering from 1 # Scanning page 1 # Scanned page 1. (scanner status = 5) # Scanning page 2 # Scanned page 2. (scanner status = 5) # PGM 157x196 157x196+0+0 8-bit DirectClass Gray PGM 157x196 157x196+0+0 8-bit DirectClass Gray ' # expected: 'Scanning 2 pages, incrementing by 1, numbering from 1 # Scanning page 1 # Scanned page 1. (scanner status = 5) # Scanning page 2 # Scanned page 2. (scanner status = 5) # Batch terminated, 2 pages scanned # PGM 157x196 157x196+0+0 8-bit DirectClass Gray PGM 157x196 157x196+0+0 8-bit DirectClass Gray ' This is because my scanimage tool from sane-backends-1.0.27 appends "Batch terminated, 2 pages scanned" message when finishing a scan: $ scanimage --version scanimage (sane-backends) 1.0.27; backend version 1.0.27 $ scanimage --device=test --batch-count=2 Scanning 2 pages, incrementing by 1, numbering from 1 Scanning page 1 Scanned page 1. (scanner status = 5) Scanning page 2 Scanned page 2. (scanner status = 5) Batch terminated, 2 pages scanned
From: ppisar [...] redhat.com
Dne Po 03.čec.2017 04:12:40, ppisar napsal(a): Show quoted text
> Some t/81_scanimage-perl.t tests fail for me like this:
[...] Show quoted text
> This is because my scanimage tool from sane-backends-1.0.27 appends > "Batch terminated, 2 pages scanned" message when finishing a scan: >
This patch fixes the test: diff --git a/t/81_scanimage-perl.t b/t/81_scanimage-perl.t index 8cf439e..e9071a4 100644 --- a/t/81_scanimage-perl.t +++ b/t/81_scanimage-perl.t @@ -38,5 +38,6 @@ for my $test (@tests) { my $output = `$scanimage_perl $test`; $output =~ s/scanimage-perl/scanimage/g; my $example = `scanimage $test`; + $example =~ s/^Batch terminated,.*\n//m; is_deeply( $output, $example, $test ); } But after fixing it, I spotted another failure because if different wording in scanimage tool output: # Failed test '--verbose --device=test --source="Automatic Document Feeder" --batch 2>&1; identify -format '%m %G %g %z-bit %r' out*.pnm; rm out*.pnm' # at t/81_scanimage-perl.t line 42. # got: 'Scanning -1 pages, incrementing by 1, numbering from 1 # Scanning page 1 [...] # expected: 'Scanning infinity pages, incrementing by 1, numbering from 1 # Scanning page 1 This can be circumvent by adding second line: + $example =~ s/^Scanning infinity pages/Scanning -1 pages/; But it looks like examples/scanimage-perl is supposed to mimic the scanimage. Shouldn't we change examples/scanimage-perl instead?
This is a bit of a problem. At the point where I had most of the code finished, sane-backends was v1.0.25, and this is what I based scanimage-perl on. Now, v1.0.27 has been released, and has changed various things in scanimage. If I update scanimage-perl to match, then all the smokers running 1.0.25 will fail. So I have various options to fix the tests: 1. skip t/81 if we don't have 1.0.25. 2. update scanimage-perl to match 1.0.27 and skip t/81 if we don't have 1.0.27 3. update scanimage-perl to check which version of sane-backends we have and work appropriately 4. forget t/81 completely #3 is going to take me some time...
Easier than I thought. Fixed in 0.13