* PATCH: "unimplemented" for test suite
@ 2001-06-13 8:01 Andrej Borsenkow
2001-06-18 18:04 ` Bart Schaefer
0 siblings, 1 reply; 6+ messages in thread
From: Andrej Borsenkow @ 2001-06-13 8:01 UTC (permalink / raw)
To: ZSH Workers Mailing List
[-- Attachment #1: Type: text/plain, Size: 202 bytes --]
This is attempt to skip test suite if some prerequisites are missing. I am
not sure how useful it actually is - when test fails with an error it at
least draws some attention.
Any suggestion?
-andrej
[-- Attachment #2: zsh-test.diff --]
[-- Type: application/octet-stream, Size: 5202 bytes --]
Index: Test/D03procsubst.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D03procsubst.ztst,v
retrieving revision 1.1
diff -u -r1.1 D03procsubst.ztst
--- Test/D03procsubst.ztst 2001/04/02 12:33:49 1.1
+++ Test/D03procsubst.ztst 2001/06/13 07:57:44
@@ -1,10 +1,16 @@
# Tests for process substitution: <(...), >(...) and =(...).
%prep
- mkdir procsubst.tmp
- cd procsubst.tmp
- print 'First\tSecond\tThird\tFourth' >FILE1
- print 'Erste\tZweite\tDritte\tVierte' >FILE2
+ if grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h > /dev/null 2>&1 ||
+ grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h > /dev/null 2>&1; then
+ mkdir procsubst.tmp
+ cd procsubst.tmp
+ print 'First\tSecond\tThird\tFourth' >FILE1
+ print 'Erste\tZweite\tDritte\tVierte' >FILE2
+ else
+ ZTST_unimplemented="process substitution is not supported"
+ true
+ fi
%test
paste <(cut -f1 FILE1) <(cut -f3 FILE2)
Index: Test/Y01completion.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y01completion.ztst,v
retrieving revision 1.1
diff -u -r1.1 Y01completion.ztst
--- Test/Y01completion.ztst 2001/04/02 12:35:14 1.1
+++ Test/Y01completion.ztst 2001/06/13 07:57:44
@@ -7,11 +7,15 @@
cd comp.tmp
comptestinit -z $ZTST_testdir/../Src/zsh
-
- mkdir dir1
- mkdir dir2
- touch file1
- touch file2
+ if zmodload -e zsh/zpty ; then
+ mkdir dir1
+ mkdir dir2
+ touch file1
+ touch file2
+ else
+ ZTST_unimplemented="could not load zsh/zpty"
+ true
+ fi
%test
Index: Test/Y02compmatch.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y02compmatch.ztst,v
retrieving revision 1.1
diff -u -r1.1 Y02compmatch.ztst
--- Test/Y02compmatch.ztst 2001/04/02 12:35:31 1.1
+++ Test/Y02compmatch.ztst 2001/06/13 07:57:45
@@ -17,21 +17,25 @@
cd match.tmp
comptestinit -z $ZTST_testdir/../Src/zsh
-
- list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
- test_code () {
- matcher=$1;
- list=$2;
- code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
- code="$code$matcher"
- code="$code' - ${(P)list} ; echo -n '</COMPADD>'"
- code="$code; $extra_cmd"
- code="$code; echo -n '<INSERT_POSITIONS>'"
- code="$code; echo \$compstate[insert_positions]"
- code="$code; echo -n '</INSERT_POSITIONS>'"
- code="$code}"
- comptesteval "$code"
- }
+ if zmodload -e zsh/zpty ; then
+ list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
+ test_code () {
+ matcher=$1;
+ list=$2;
+ code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
+ code="$code$matcher"
+ code="$code' - ${(P)list} ; echo -n '</COMPADD>'"
+ code="$code; $extra_cmd"
+ code="$code; echo -n '<INSERT_POSITIONS>'"
+ code="$code; echo \$compstate[insert_positions]"
+ code="$code; echo -n '</INSERT_POSITIONS>'"
+ code="$code}"
+ comptesteval "$code"
+ }
+ else
+ ZTST_unimplemented="could not load zsh/zpty"
+ true
+ fi
Index: Test/Y03arguments.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y03arguments.ztst,v
retrieving revision 1.1
diff -u -r1.1 Y03arguments.ztst
--- Test/Y03arguments.ztst 2001/04/02 12:35:48 1.1
+++ Test/Y03arguments.ztst 2001/06/13 07:57:45
@@ -7,9 +7,13 @@
cd comp.tmp
comptestinit -z $ZTST_testdir/../Src/zsh
- comptesteval 'compdef _tst tst'
- tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
-
+ if zmodload -e zsh/zpty ; then
+ comptesteval 'compdef _tst tst'
+ tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
+ else
+ ZTST_unimplemented="could not load zsh/zpty"
+ true
+ fi
%test
tst_arguments ':desc1:(arg1)'
comptest $'tst \t\C-wa\t\C-war\t\C-warg\t\C-warg1\t\C-wr\t\C-wx\t \ty \t'
Index: Test/ztst.zsh
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/ztst.zsh,v
retrieving revision 1.15
diff -u -r1.15 ztst.zsh
--- Test/ztst.zsh 2001/05/22 09:27:25 1.15
+++ Test/ztst.zsh 2001/06/13 07:57:45
@@ -363,8 +363,11 @@
print "$ZTST_testname: starting."
# Now go through all the different sections until the end.
+# prep section may set ZTST_unimplemented, in this case the actual
+# tests will be skipped
ZTST_skipok=
-while ZTST_getsect $ZTST_skipok; do
+ZTST_unimplemented=
+while [[ -z "$ZTST_unimplemented" ]] && ZTST_getsect $ZTST_skipok; do
case $ZTST_cursect in
prep) if (( ${ZTST_sects[prep]} + ${ZTST_sects[test]} + \
${ZTST_sects[clean]} )); then
@@ -399,6 +402,10 @@
esac
done
-(( $ZTST_testfailed )) || print "$ZTST_testname: all tests successful."
+if [[ -n "$ZTST_unimplemented" ]]; then
+ print "$ZTST_testname: skipped ($ZTST_unimplemented)"
+elif (( ! $ZTST_testfailed )); then
+ print "$ZTST_testname: all tests successful."
+fi
ZTST_cleanup
exit $(( ZTST_testfailed ))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: "unimplemented" for test suite
2001-06-13 8:01 PATCH: "unimplemented" for test suite Andrej Borsenkow
@ 2001-06-18 18:04 ` Bart Schaefer
2001-06-18 18:44 ` Andrej Borsenkow
0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2001-06-18 18:04 UTC (permalink / raw)
To: Andrej Borsenkow, ZSH Workers Mailing List
On Jun 13, 12:01pm, Andrej Borsenkow wrote:
}
} This is attempt to skip test suite if some prerequisites are missing.
Is there a reason this was never committed?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: "unimplemented" for test suite
2001-06-18 18:04 ` Bart Schaefer
@ 2001-06-18 18:44 ` Andrej Borsenkow
2001-06-18 19:02 ` Bart Schaefer
0 siblings, 1 reply; 6+ messages in thread
From: Andrej Borsenkow @ 2001-06-18 18:44 UTC (permalink / raw)
To: ZSH Workers Mailing List
On Mon, 18 Jun 2001, Bart Schaefer wrote:
> On Jun 13, 12:01pm, Andrej Borsenkow wrote:
> }
> } This is attempt to skip test suite if some prerequisites are missing.
>
> Is there a reason this was never committed?
>
I was unsure about added value of this patch and there was no comments. I
stll have it pending - should I commit it (to HEAD)?
-andrej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: "unimplemented" for test suite
2001-06-18 18:44 ` Andrej Borsenkow
@ 2001-06-18 19:02 ` Bart Schaefer
2001-06-18 19:09 ` Bart Schaefer
2001-06-26 14:52 ` Andrej Borsenkow
0 siblings, 2 replies; 6+ messages in thread
From: Bart Schaefer @ 2001-06-18 19:02 UTC (permalink / raw)
To: Andrej Borsenkow, ZSH Workers Mailing List
On Jun 18, 10:44pm, Andrej Borsenkow wrote:
}
} I was unsure about added value of this patch and there was no comments.
Certainly it would be nice to at least *explain* the test failures for
the Y* tests when --disable-dynamic ... either that, or we should add
zpty to the list of modules that are always linked by default.
Probably comptestinit should not proceed if zmodload zpty fails, and
the %prep section should fail in that case, so that we don't report
failures on individual tests.
If Andrej's patch -- or some combination of it with the below -- isn't
considered better, how about this?
diff -u zsh-forge/current/Test/Y01completion.ztst zsh-4.0/Test/Y01completion.ztst
--- zsh-forge/current/Test/Y01completion.ztst Mon Apr 2 05:35:14 2001
+++ zsh-4.0/Test/Y01completion.ztst Mon Jun 18 11:58:20 2001
@@ -6,12 +6,14 @@
mkdir comp.tmp
cd comp.tmp
- comptestinit -z $ZTST_testdir/../Src/zsh
+ comptestinit -z $ZTST_testdir/../Src/zsh && {
mkdir dir1
mkdir dir2
touch file1
touch file2
+
+ }
%test
diff -u zsh-forge/current/Test/Y02compmatch.ztst zsh-4.0/Test/Y02compmatch.ztst
--- zsh-forge/current/Test/Y02compmatch.ztst Mon Apr 2 05:35:31 2001
+++ zsh-4.0/Test/Y02compmatch.ztst Mon Jun 18 11:58:43 2001
@@ -16,7 +16,7 @@
mkdir match.tmp
cd match.tmp
- comptestinit -z $ZTST_testdir/../Src/zsh
+ comptestinit -z $ZTST_testdir/../Src/zsh && {
list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
test_code () {
@@ -33,7 +33,7 @@
comptesteval "$code"
}
-
+ }
diff -u zsh-forge/current/Test/Y03arguments.ztst zsh-4.0/Test/Y03arguments.ztst
--- zsh-forge/current/Test/Y03arguments.ztst Mon Apr 2 05:35:48 2001
+++ zsh-4.0/Test/Y03arguments.ztst Mon Jun 18 11:58:59 2001
@@ -6,9 +6,10 @@
mkdir comp.tmp
cd comp.tmp
- comptestinit -z $ZTST_testdir/../Src/zsh
+ comptestinit -z $ZTST_testdir/../Src/zsh && {
comptesteval 'compdef _tst tst'
tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
+ }
%test
tst_arguments ':desc1:(arg1)'
diff -u zsh-forge/current/Test/comptest zsh-4.0/Test/comptest
--- zsh-forge/current/Test/comptest Sat Jun 9 10:24:31 2001
+++ zsh-4.0/Test/comptest Mon Jun 18 11:57:55 2001
@@ -5,7 +5,7 @@
$ZTST_srcdir/../Completion
$ZTST_srcdir/../Completion/*/*~*/CVS(/) )
- zmodload -i zsh/zpty
+ zmodload -i zsh/zpty || return $?
comptest_zsh=${ZSH:-zsh}
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: "unimplemented" for test suite
2001-06-18 19:02 ` Bart Schaefer
@ 2001-06-18 19:09 ` Bart Schaefer
2001-06-26 14:52 ` Andrej Borsenkow
1 sibling, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2001-06-18 19:09 UTC (permalink / raw)
To: Andrej Borsenkow, ZSH Workers Mailing List
On Jun 18, Bart Schaefer wrote:
}
} how about this?
Ahem. I should have known better than to click Send before "make check"
finished running. ZTST_execchunk can't handle "&& {\n...\n}". Please
ignore that patch, except possibly for the "|| return $?" in comptest.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: PATCH: "unimplemented" for test suite
2001-06-18 19:02 ` Bart Schaefer
2001-06-18 19:09 ` Bart Schaefer
@ 2001-06-26 14:52 ` Andrej Borsenkow
1 sibling, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 2001-06-26 14:52 UTC (permalink / raw)
To: ZSH Workers Mailing List
[-- Attachment #1: Type: text/plain, Size: 872 bytes --]
>
> On Jun 18, 10:44pm, Andrej Borsenkow wrote:
> }
> } I was unsure about added value of this patch and there was no comments.
>
> Certainly it would be nice to at least *explain* the test failures for
> the Y* tests when --disable-dynamic ... either that, or we should add
> zpty to the list of modules that are always linked by default.
>
> Probably comptestinit should not proceed if zmodload zpty fails, and
> the %prep section should fail in that case, so that we don't report
> failures on individual tests.
>
> If Andrej's patch -- or some combination of it with the below -- isn't
> considered better, how about this?
>
I guess, we better leave completion tests as in Bart patch. It is impossible
(at least, I have no idea how) to decide if zsh/zpty failed or just was
missing, so skipping other tests is the most we can do.
And here is for the rest.
-andrej
[-- Attachment #2: zsh-unimplemented.diff --]
[-- Type: application/octet-stream, Size: 2563 bytes --]
Index: Test/D03procsubst.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D03procsubst.ztst,v
retrieving revision 1.1
diff -u -r1.1 D03procsubst.ztst
--- Test/D03procsubst.ztst 2001/04/02 12:33:49 1.1
+++ Test/D03procsubst.ztst 2001/06/26 14:22:17
@@ -1,10 +1,16 @@
# Tests for process substitution: <(...), >(...) and =(...).
%prep
- mkdir procsubst.tmp
- cd procsubst.tmp
- print 'First\tSecond\tThird\tFourth' >FILE1
- print 'Erste\tZweite\tDritte\tVierte' >FILE2
+ if grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h > /dev/null 2>&1 ||
+ grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h > /dev/null 2>&1; then
+ mkdir procsubst.tmp
+ cd procsubst.tmp
+ print 'First\tSecond\tThird\tFourth' >FILE1
+ print 'Erste\tZweite\tDritte\tVierte' >FILE2
+ else
+ ZTST_unimplemented="process substitution is not supported"
+ true
+ fi
%test
paste <(cut -f1 FILE1) <(cut -f3 FILE2)
Index: Test/ztst.zsh
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/ztst.zsh,v
retrieving revision 1.15
diff -u -r1.15 ztst.zsh
--- Test/ztst.zsh 2001/05/22 09:27:25 1.15
+++ Test/ztst.zsh 2001/06/26 14:22:17
@@ -232,9 +232,11 @@
ZTST_prepclean() {
# Execute indented code chunks.
while ZTST_getchunk; do
- ZTST_execchunk >/dev/null || [[ -n $1 ]] ||
- ZTST_testfailed "non-zero status from preparation code:
-$ZTST_code"
+ ZTST_execchunk >/dev/null || [[ -n $1 ]] || {
+ [[ -n "$ZTST_unimplemented" ]] ||
+ ZTST_testfailed "non-zero status from preparation code:
+$ZTST_code" && return 0
+ }
done
}
@@ -363,8 +365,11 @@
print "$ZTST_testname: starting."
# Now go through all the different sections until the end.
+# prep section may set ZTST_unimplemented, in this case the actual
+# tests will be skipped
ZTST_skipok=
-while ZTST_getsect $ZTST_skipok; do
+ZTST_unimplemented=
+while [[ -z "$ZTST_unimplemented" ]] && ZTST_getsect $ZTST_skipok; do
case $ZTST_cursect in
prep) if (( ${ZTST_sects[prep]} + ${ZTST_sects[test]} + \
${ZTST_sects[clean]} )); then
@@ -399,6 +404,10 @@
esac
done
-(( $ZTST_testfailed )) || print "$ZTST_testname: all tests successful."
+if [[ -n "$ZTST_unimplemented" ]]; then
+ print "$ZTST_testname: skipped ($ZTST_unimplemented)"
+elif (( ! $ZTST_testfailed )); then
+ print "$ZTST_testname: all tests successful."
+fi
ZTST_cleanup
exit $(( ZTST_testfailed ))
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2001-06-26 14:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13 8:01 PATCH: "unimplemented" for test suite Andrej Borsenkow
2001-06-18 18:04 ` Bart Schaefer
2001-06-18 18:44 ` Andrej Borsenkow
2001-06-18 19:02 ` Bart Schaefer
2001-06-18 19:09 ` Bart Schaefer
2001-06-26 14:52 ` Andrej Borsenkow
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).