Dejagnu testcase behavior unexpected
Howdy, I am looking at bug number 99 on http://gcc.gnu.org/bugzilla/show_bug.cgi?id=99 and I am adding a test case for it. The testcase looks like this: //---start test case /* {do-run compile} */ template class X {}; template int f(X, X); template int f(X, X); int main(void) { return f(X(), X()); /*{ dg-error "int f(X, X)"}*/ } //---end test case Now, when I run the testcase, I *think* I should have two unexpected failures: one because the code will not compile and another because the error expected to be seen by dg-error is not seen when the test case is run. However, when I run the testcase, I only get one unexpected failure. Here is what I ran: da...@pete:~/gccbuild$ make -C gcc check-g++ RUNTESTFLAGS=dg.exp=pr99.C make: Entering directory `/home/david/gccbuild/gcc' make[1]: Entering directory `/home/david/gccbuild/gcc' test -d plugin || mkdir plugin test -d testsuite || mkdir testsuite test -d testsuite/g++ || mkdir testsuite/g++ (rootme=`${PWDCMD-pwd}`; export rootme; \ srcdir=`cd ../../gcc/./gcc; ${PWDCMD-pwd}` ; export srcdir ; \ cd testsuite/g++; \ rm -f tmp-site.exp; \ sed '/set tmpdir/ s|testsuite$|testsuite/g++|' \ < ../../site.exp > tmp-site.exp; \ /bin/bash ${srcdir}/../move-if-change tmp-site.exp site.exp; \ EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo ${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ; \ if [ -f ${rootme}/../expect/expect ] ; then \ TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWDCMD-pwd}` ; \ export TCL_LIBRARY ; fi ; \ runtestflags= ; \ if [ -n "" ] ; then \ runtestflags=""; \ elif [ -n "" ] ; then \ parts="`echo ' ' \ | sed 's/=[^ ]* / /g'`"; \ for part in `find $srcdir/testsuite/g++* -name \*.exp` ; do \ part=`basename $part` ; \ case " $parts $runtestflags " in \ *" $part "*) ;; \ *) runtestflags="$runtestflags $part" ;; \ esac ; \ done ; \ fi ; \ `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool g++ dg.exp=pr99.C $runtestflags) Test Run By david on Tue Sep 14 16:32:21 2010 Native configuration is x86_64-unknown-linux-gnu === g++ tests === Schedule of variations: unix Running target unix Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/share/dejagnu/config/unix.exp as generic interface file for target. Using /home/david/gcc/gcc/testsuite/config/default.exp as tool-and-target-specific interface file. Running /home/david/gcc/gcc/testsuite/g++.dg/dg.exp ... FAIL: g++.dg/template/pr99.C (test for excess errors) === g++ Summary === # of unexpected failures 1 /home/david/gccbuild/gcc/testsuite/g++/../../g++ version 4.6.0 20100831 (experimental) (GCC) make[1]: [check-parallel-g++] Error 1 (ignored) make[1]: Leaving directory `/home/david/gccbuild/gcc' make: Leaving directory `/home/david/gccbuild/gcc' ___ In the summary, I expect to have two unexpected failures. What am I missing? -- Thanks, dw
Re: Dejagnu testcase behavior unexpected
Thanks for the reply. I made the changes that you described, but I'm still experiencing the same behavior--namely that I think that I should see two unexpected errors since 1) the test case will not compile and 2) the expected error message is not printed. Here are the steps to reproduce (assuming that a stage1 compiler has already been built and that version 4.6.0 20100831 (experimental) of the GCC is being used): 1) create the file pr99.C at /gcc/testsuite/g++.dg/template. 2) paste the following code in pr99.C: /*{dg-do compile}*/ template class X {}; template int f(X, X); template int f(X, X); int main(void) { return f(X(), X());/*{ dg-error "int f(X, X)"} */ } 3) from the directory, run the following command: make -C gcc check-g++ RUNTESTFLAGS=dg.exp=pr99.C _ What I actually see in the results is: Running /home/david/gcc/gcc/testsuite/g++.dg/dg.exp ... FAIL: g++.dg/template/pr99.C (test for excess errors) === g++ Summary === # of unexpected failures1 //<--SHOULDN'T THIS BE 2 INSTEAD OF 1? /home/david/gccbuild/gcc/testsuite/g++/../../g++ version 4.6.0 20100831 (experimental) (GCC) On Tue, Sep 14, 2010 at 5:18 PM, Ian Lance Taylor wrote: > David Weiser writes: > >> I am looking at bug number 99 on >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=99 and I am adding a test >> case for it. >> The testcase looks like this: >> //---start test case >> /* >> {do-run compile} >> */ > > This should be > > /* { dg-do compile } */ > > or, equivalently for C++, > > // { dg-do compile } > > Ian > -- Thanks, dw