public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] The Best Practice to Skip Syscall Tests
@ 2009-08-21 11:57 CAI Qian
  2009-08-21 16:00 ` Mike Frysinger
  0 siblings, 1 reply; 10+ messages in thread
From: CAI Qian @ 2009-08-21 11:57 UTC (permalink / raw)
  To: ltp-list

Hi,

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.

  CFLAGS += -I../../../../include -Wall
  LDLIBS += -L../../../../lib -lltp

  SRCS    = $(wildcard *.c)
  TARGETS = $(patsubst %.c,%,$(SRCS))

  all: $(TARGETS)

  install:
          @set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done

  else               <-- Otherwise, skip them.
  all:

However, I am not sure how to pass the HAVE_UNSHARE value to the
Makefile yet.

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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-08-24  9:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox