https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88654

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Iain Buclaw from comment #3)
> (In reply to Jakub Jelinek from comment #0)
> > The reason I'm filing this is that there are multiple issues:
> > 
> > 1) what I'm worried about most is that the timeouts for tests don't work, it
> > happens that some test gets stuck, but it should be killed after 5 minutes
> > or for how long the default timeout is set and the set should FAIL in that
> > case or something similar
> > 
> 
> I couldn't reproduce, maybe I'm running the 32bit testsuite differently
> though?
> 
> Running ../../../../../libphobos/testsuite/libphobos.unittests/unittests.exp
> ...
> WARNING: program timed out.
> FAIL: libphobos.unittests/phobos/static/std.net.curl
> WARNING: program timed out.
> FAIL: libphobos.unittests/phobos/shared/std.net.curl

My i686-linux bootstraps are done through a couple of executable scripts in
~/hbin directory on x86_64-linux:
for i in ~/hbin/*; do echo ===$i===; cat $i; done
===/home/jakub/hbin/as===
#!/bin/sh
exec /usr/bin/as --32 "$@"
===/home/jakub/hbin/g++===
#!/bin/sh
exec /usr/bin/g++ -m32 "$@"
===/home/jakub/hbin/gcc===
#!/bin/sh
exec /usr/bin/gcc -m32 "$@"
===/home/jakub/hbin/ld===
#!/bin/sh
case "$*" in
  --version) cat <<\EOF
GNU ld version 2.20.52.0.1-10.fc17 20100131
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
EOF
  exit 0;;
esac
exec /usr/bin/ld -m elf_i386 -L /usr/lib/ "$@"

and then
PATH=~/hbin:$PATH i386 ../configure
--enable-languages=default,obj-c++,lto,go,brig,d
--enable-checking=yes,rtl,extra \
&& PATH=~/hbin:$PATH i386 make -j32 bootstrap > LOG 2>&1 \
&& PATH=~/hbin:$PATH i386 make -j32 -k check > LOGC 2>&1; \
../contrib/test_summary > LOGT 2>&1
and that got stuck forever if libcurl.i?86 wasn't installed (only
libcurl.x86_64 and libcurl-devel.x86_64), but works
fine now that I also have libcurl.i?86 installed.

> > 3) and, if libcurl isn't available, I think it would be better to skip the
> > test as UNSUPPORTED, i.e. add some effective-target that tests if libcurl is
> > available and if it fails, don't even try to run the test
> 
> This would be a proc local to libphobos I guess?  There's nothing using this
> module outside of the libphobos testsuite.

If the test doesn't fail if it fails to load libcurl (and doesn't get stuck),
it is fine too.
If it fails if it is missing, yeah, something like a tcl procedure somewhere in
libphobos/testsuite/lib/*.exp would do.
As libphobos itself doesn't need libcurl-devel, it is just dlopen, so I think
you want to test that
#include <dlfcn.h>

int
main ()
{
  void *h = dlopen ("libcurl.so.4"); // etc., whatever the library will try to
dlopen
  ...
}
will succeed dlopening it.

Reply via email to