[sanexx-commit] SF.net SVN: sanexx: [9]
Status: Pre-Alpha
Brought to you by:
paddy_hack
|
From: <pad...@us...> - 2006-03-06 11:29:08
|
Revision: 9 Author: paddy_hack Date: 2006-03-06 03:28:50 -0800 (Mon, 06 Mar 2006) ViewCVS: http://svn.sourceforge.net/sanexx/?rev=9&view=rev Log Message: ----------- r20@qed: olaf | 2006-03-04 13:37:57 +0900 Added the first test that requires SANE API usage. To ease consistent testing in a well-defined setup, the sane_env shell function has been added together with custom configuration files in tests/sane-conf/. A common variable for the test program name has been added and should be used to create files that hold intermediate test results and debugging statements. Unless debugging, all files matching $test_prog.* will be cleaned up at test end. Modified Paths: -------------- trunk/tests/Makefile.am trunk/tests/frontend-cli-options trunk/tests/functions Added Paths: ----------- trunk/tests/sane-conf/ trunk/tests/sane-conf/dll.conf trunk/tests/sane-conf/test.conf Property Changed: ---------------- / Property changes on: ___________________________________________________________________ Name: svk:merge - 52428bda-890d-0410-88ad-be188b7e1831:/local:11 + 52428bda-890d-0410-88ad-be188b7e1831:/local:20 Modified: trunk/tests/Makefile.am =================================================================== --- trunk/tests/Makefile.am 2006-03-01 13:37:16 UTC (rev 8) +++ trunk/tests/Makefile.am 2006-03-06 11:28:50 UTC (rev 9) @@ -29,4 +29,6 @@ EXTRA_DIST = \ functions \ + sane-conf/dll.conf \ + sane-conf/test.conf \ $(TESTS) Modified: trunk/tests/frontend-cli-options =================================================================== --- trunk/tests/frontend-cli-options 2006-03-01 13:37:16 UTC (rev 8) +++ trunk/tests/frontend-cli-options 2006-03-06 11:28:50 UTC (rev 9) @@ -31,8 +31,8 @@ shift for opt in \ + version \ help \ - version \ $@ \ ; do $program --help 2>/dev/null \ @@ -40,4 +40,13 @@ done } -test_documented_options scanimage++ +test_documented_options scanimage++ \ + list-devices + + +sane_env scanimage++ --list-devices > $test_prog.out 2>/dev/null + +expect=`$AWK '/^number_of_devices/ {print $2}' \ + ${srcdir}/sane-conf/test.conf` +actual=`$AWK 'BEGIN {t = 0} {++t} END {print t}' $test_prog.out` +test x$expect = x$actual Modified: trunk/tests/functions =================================================================== --- trunk/tests/functions 2006-03-01 13:37:16 UTC (rev 8) +++ trunk/tests/functions 2006-03-06 11:28:50 UTC (rev 9) @@ -20,11 +20,25 @@ # Boston, MA 02110-1301 USA +AWK=awk # temporary kludge + +test_prog=`echo $0 | sed 's,.*/,,'` + debug_mode () { test x$SANEXX_TEST_DEBUG != x } -debug_mode && set -x # trace command invocation +if `debug_mode`; then + set -x # trace command invocation +else + trap "rm -f $test_prog.*" 0 1 2 15 + # clean up temporary test droppings +fi +sane_env () +{ + SANE_CONFIG_DIR=${srcdir}/sane-conf "$@" +} + set -e # bomb at the first error Added: trunk/tests/sane-conf/dll.conf =================================================================== --- trunk/tests/sane-conf/dll.conf (rev 0) +++ trunk/tests/sane-conf/dll.conf 2006-03-06 11:28:50 UTC (rev 9) @@ -0,0 +1,23 @@ +# dll.conf -- a SANE dll backend configuration for testing purposes +# Copyright (C) 2006 Olaf Meeuwissen +# +# This file is part of the 'sane++' package. +# This package is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License or, at +# your option, any later version. +# +# This package is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of FITNESS +# FOR A PARTICULAR PURPOSE or MERCHANTABILITY. +# See the GNU General Public License for more details. +# +# You should have received a verbatim copy of the GNU General Public +# License along with this package; if not, write to: +# +# Free Software Foundation +# 51 Franklin Street, 5th Floor +# Boston, MA 02110-1301 USA + + +test Added: trunk/tests/sane-conf/test.conf =================================================================== --- trunk/tests/sane-conf/test.conf (rev 0) +++ trunk/tests/sane-conf/test.conf 2006-03-06 11:28:50 UTC (rev 9) @@ -0,0 +1,25 @@ +# dll.conf -- a SANE test backend configuration for testing purposes +# Copyright (C) 2006 Olaf Meeuwissen +# +# This file is part of the 'sane++' package. +# This package is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License or, at +# your option, any later version. +# +# This package is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of FITNESS +# FOR A PARTICULAR PURPOSE or MERCHANTABILITY. +# See the GNU General Public License for more details. +# +# You should have received a verbatim copy of the GNU General Public +# License along with this package; if not, write to: +# +# Free Software Foundation +# 51 Franklin Street, 5th Floor +# Boston, MA 02110-1301 USA + + +# Number of devices provided by the backend. +# +number_of_devices 5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |