From: Mike Frysinger <[email protected]> Subject: Re: [LTP] The Best Practice to Skip Syscall Tests Date: Fri, 21 Aug 2009 12:00:32 -0400
> 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 CAI Qian ------------------------------------------------------------------------------ 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 _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
