From: Mike Frysinger <vapier@gentoo.org>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] The Best Practice to Skip Syscall Tests
Date: Sat, 22 Aug 2009 23:57:12 -0400 [thread overview]
Message-ID: <200908222357.13105.vapier@gentoo.org> (raw)
In-Reply-To: <20090823.103037.104044604.caiqian@cclom.cn>
[-- Attachment #1.1: Type: Text/Plain, Size: 2586 bytes --]
On Saturday 22 August 2009 22:30:37 CAI Qian wrote:
> From: Mike Frysinger <vapier@gentoo.org>
> > On Friday 21 August 2009 07:57:39 CAI Qian wrote:
> >> Test cases unshare failed to compile on systems without such a
> >> syscall. I am unsure what the best way to handle it. The old ways are,
> >>
> >> * add a kernel version check in the unshare tests code.
> >>
> >> or
> >>
> >> * add a m4 rule.
> >> * modify the unshare tests code to check if the macro, and add stub
> >> functions if the macro is false.
> >>
> >> The first approach is unable to handle non-vanilla kernels. The second
> >> approach needs to add stub functions which are unclean. What I would
> >> like to do is,
> >>
> >> * add a m4 rule.
> >> * modify unshare Makefile like this,
> >>
> >> ifdef HAVE_UNSHARE <-- if the syscall is present, compile the tests.
> >
> > the configure test should always be there if the code needs new
> > headers (like sys/signalfd.h). if it's only a new syscall, then the
> > configure test should only be for the new symbol (assuming one is
> > provided). in all cases, the tests should be compiled. your proposal
> > doesnt handle the case where the C library is in place, but the kernel
> > is older so returns ENOSYS.
>
> OK, how about those two approaches?
>
> * add a stub C program to check if kernel returns ENOSYS. If so, returns
> 1. Otherwise, 0.
> * add a m4 rule to check the headers or/and functions.
> * if ./configure found all headers and functions, and execute the stub
> program to return 0, it will set HAVE_UNSHARE.
> * modify unshare Makefile to complie it only if HAVE_UNSHARE set.
>
> or
>
> * add a m4 rule to check the headers or/and functions.
> * if ./configure found all headers and functions, , it will set
> HAVE_UNSHARE.
> * modify the test code to deal with three situations.
> * HAVE_UNSHARE = 0
> * HAVE_UNSHARE = 1 + ENOSYS
> * HAVE_UNSHARE = 1 + no ENOSYS
in addition to the reasoning Garrett provided, this makes for a fairly
complicated setup for no real gain. the solution i mentioned (and is being
used) covers all known build/runtime issues.
if you need a new C library function, check for it. if you need a new C
library header, check for it. if a test may be run on an older system and
thus the call fails with ENOSYS, the test must check for it and error out with
TCONF (and a helper message). whether someone chooses to also add a runtime
kernel version check (as can be seen in a few tests) is up to whoever feels
like doing the work.
-mike
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
prev parent reply other threads:[~2009-08-23 3:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-21 11:57 [LTP] The Best Practice to Skip Syscall Tests CAI Qian
2009-08-21 16:00 ` Mike Frysinger
2009-08-21 21:17 ` Garrett Cooper
2009-08-23 2:37 ` CAI Qian
2009-08-23 3:52 ` Mike Frysinger
2009-08-24 8:44 ` Geert Uytterhoeven
2009-08-24 8:51 ` Mike Frysinger
2009-08-23 2:30 ` CAI Qian
2009-08-23 3:28 ` Garrett Cooper
2009-08-23 3:57 ` Mike Frysinger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200908222357.13105.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox