> > How about introducing TCID_DEFINE?
> > 
> > I'm not sure puttint TCID_DEFINE macro to test.h.
> > I'm not sure using a symbol as an argument for TCID_DEFINE macro 
> > is better than using a string. (I had strong lisp backgroud:-)
> > 
> > If this acceptable, I'll update related documents and
> > test cases I worked.
> 
> I think, this is fine. You can work on other test cases you worked on
> along similar lines. The patch is through.

I've done on the other test cases.
In addition, I've cleaned up Makefiles related to _64 and _16 testcases
as suggested by Mike Frysinger.

Signed-off-by: Masatake YAMATO <[EMAIL PROTECTED]>


Index: testcases/kernel/syscalls/fadvise/Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fadvise/Makefile,v
retrieving revision 1.1
diff -u -r1.1 Makefile
--- testcases/kernel/syscalls/fadvise/Makefile  22 Nov 2007 13:58:24 -0000      
1.1
+++ testcases/kernel/syscalls/fadvise/Makefile  20 Aug 2008 03:18:43 -0000
@@ -22,12 +22,12 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp
 
-SRCS      = $(wildcard posix_fadvise[0-9][0-9].c)
+SRCS      = $(wildcard *.c)
 TARGETS   = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%_64,$(SRCS))
 
-%_64.c: %.c
-       echo "#define _FILE_OFFSET_BITS 64" > $@
-       cat  $< >> $@
+%_64.o: %.c
+       $(COMPILE.c) $(OUTPUT_OPTION) $<
+%_64: CFLAGS += -DTST_USE_NEWER64_SYSCALL=1 -D_FILE_OFFSET_BITS=64
 
 
 all: $(TARGETS)
Index: testcases/kernel/syscalls/fadvise/posix_fadvise01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fadvise/posix_fadvise01.c,v
retrieving revision 1.4
diff -u -r1.4 posix_fadvise01.c
--- testcases/kernel/syscalls/fadvise/posix_fadvise01.c 21 Jul 2008 11:07:37 
-0000      1.4
+++ testcases/kernel/syscalls/fadvise/posix_fadvise01.c 20 Aug 2008 03:18:43 
-0000
@@ -57,7 +57,7 @@
 void cleanup();
 
 
-char *TCID="posix_fadvise01";  /* Test program identifier.    */
+TCID_DEFINE(posix_fadvise01);   /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 char fname[] = "/bin/cat";     /* test executable to open */
Index: testcases/kernel/syscalls/fadvise/posix_fadvise02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fadvise/posix_fadvise02.c,v
retrieving revision 1.3
diff -u -r1.3 posix_fadvise02.c
--- testcases/kernel/syscalls/fadvise/posix_fadvise02.c 22 Apr 2008 15:29:43 
-0000      1.3
+++ testcases/kernel/syscalls/fadvise/posix_fadvise02.c 20 Aug 2008 03:18:43 
-0000
@@ -56,7 +56,7 @@
 void cleanup();
 
 
-char *TCID="posix_fadvise02";  /* Test program identifier.    */
+TCID_DEFINE(posix_fadvise02);  /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 #define WRONG_FD       42      /* The number has no meaning. 
Index: testcases/kernel/syscalls/fadvise/posix_fadvise03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fadvise/posix_fadvise03.c,v
retrieving revision 1.4
diff -u -r1.4 posix_fadvise03.c
--- testcases/kernel/syscalls/fadvise/posix_fadvise03.c 21 Jul 2008 11:07:37 
-0000      1.4
+++ testcases/kernel/syscalls/fadvise/posix_fadvise03.c 20 Aug 2008 03:18:43 
-0000
@@ -57,7 +57,7 @@
 void cleanup();
 
 
-char *TCID="posix_fadvise03";  /* Test program identifier.    */
+TCID_DEFINE(posix_fadvise03);  /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 char fname[] = "/bin/cat";     /* test executable to open */
Index: testcases/kernel/syscalls/fadvise/posix_fadvise04.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/fadvise/posix_fadvise04.c,v
retrieving revision 1.5
diff -u -r1.5 posix_fadvise04.c
--- testcases/kernel/syscalls/fadvise/posix_fadvise04.c 21 Jul 2008 11:07:37 
-0000      1.5
+++ testcases/kernel/syscalls/fadvise/posix_fadvise04.c 20 Aug 2008 03:18:43 
-0000
@@ -55,7 +55,7 @@
 void cleanup();
 
 
-char *TCID="posix_fadvise04";  /* Test program identifier.    */
+TCID_DEFINE(posix_fadvise04);  /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 
 #define GIVEN_IN_SETUP 42      /* No mean. Just used as padding.
Index: testcases/kernel/syscalls/ftruncate/Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ftruncate/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- testcases/kernel/syscalls/ftruncate/Makefile        5 Aug 2008 02:59:12 
-0000       1.10
+++ testcases/kernel/syscalls/ftruncate/Makefile        20 Aug 2008 03:18:44 
-0000
@@ -19,13 +19,14 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp
 
-SRCS    = $(wildcard ftruncate[0-9][0-9].c)
+SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%_64,$(SRCS))
 
 
-%_64.c: %.c
-       echo "#define _FILE_OFFSET_BITS 64" > $@
-       cat  $< >> $@
+%_64.o: %.c
+       $(COMPILE.c) $(OUTPUT_OPTION) $<
+%_64: CFLAGS += -DTST_USE_NEWER64_SYSCALL=1 -D_FILE_OFFSET_BITS=64
+
 
 all: $(TARGETS)
 
Index: testcases/kernel/syscalls/ftruncate/ftruncate01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ftruncate/ftruncate01.c,v
retrieving revision 1.2
diff -u -r1.2 ftruncate01.c
--- testcases/kernel/syscalls/ftruncate/ftruncate01.c   26 Mar 2003 18:23:35 
-0000      1.2
+++ testcases/kernel/syscalls/ftruncate/ftruncate01.c   20 Aug 2008 03:18:44 
-0000
@@ -82,7 +82,7 @@
 #define FILE_SIZE      1024                    /* test file size */
 #define TRUNC_LEN      256                     /* truncation length */
 
-char *TCID="ftruncate01";      /* Test program identifier.    */
+TCID_DEFINE(ftruncate01);       /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fildes;                    /* file descriptor for test file */
Index: testcases/kernel/syscalls/ftruncate/ftruncate02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ftruncate/ftruncate02.c,v
retrieving revision 1.3
diff -u -r1.3 ftruncate02.c
--- testcases/kernel/syscalls/ftruncate/ftruncate02.c   26 Mar 2003 18:23:35 
-0000      1.3
+++ testcases/kernel/syscalls/ftruncate/ftruncate02.c   20 Aug 2008 03:18:44 
-0000
@@ -84,7 +84,7 @@
 #define TRUNC_LEN1     256                     /* truncation length */
 #define TRUNC_LEN2     512                     /* truncation length */
 
-char *TCID="ftruncate02";      /* Test program identifier.    */
+TCID_DEFINE(ftruncate02);       /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fd;                                /* file descriptor of testfile */
Index: testcases/kernel/syscalls/ftruncate/ftruncate03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ftruncate/ftruncate03.c,v
retrieving revision 1.10
diff -u -r1.10 ftruncate03.c
--- testcases/kernel/syscalls/ftruncate/ftruncate03.c   19 Feb 2006 09:10:28 
-0000      1.10
+++ testcases/kernel/syscalls/ftruncate/ftruncate03.c   20 Aug 2008 03:18:44 
-0000
@@ -55,7 +55,7 @@
 
 #define TESTFILE       "ftruncate03_tst_file"
 
-char *TCID="ftruncate03";
+TCID_DEFINE(ftruncate03);
 int TST_TOTAL=3;
 
 int main()
Index: testcases/kernel/syscalls/ftruncate/ftruncate04.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/ftruncate/ftruncate04.c,v
retrieving revision 1.10
diff -u -r1.10 ftruncate04.c
--- testcases/kernel/syscalls/ftruncate/ftruncate04.c   20 May 2008 10:11:01 
-0000      1.10
+++ testcases/kernel/syscalls/ftruncate/ftruncate04.c   20 Aug 2008 03:18:44 
-0000
@@ -72,7 +72,7 @@
 
 char progname[] = "ftruncate04()";
 
-char *TCID = "ftruncate04";
+TCID_DEFINE(ftruncate04);
 int TST_TOTAL = 1;
 extern int Tst_count;
 
Index: testcases/kernel/syscalls/sendfile/Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- testcases/kernel/syscalls/sendfile/Makefile 28 Nov 2007 11:20:04 -0000      
1.11
+++ testcases/kernel/syscalls/sendfile/Makefile 20 Aug 2008 03:18:49 -0000
@@ -19,13 +19,16 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp
 
-SRCS    = $(wildcard sendfile[0-9][0-9].c)
+SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%_64,$(SRCS))
 
-%_64.c: %.c Makefile
-       echo "#define _FILE_OFFSET_BITS 64" >  $@
-       echo "#define OFF_T __off64_t"      >> $@
-       cat  $< >> $@
+%_64.o: %.c
+       $(COMPILE.c) $(OUTPUT_OPTION) $<
+%_64: CFLAGS +=                                        \
+       -DTST_USE_NEWER64_SYSCALL=1             \
+       -D_FILE_OFFSET_BITS=64                  \
+       -DOFF_T=__off64_t
+
 
 all: $(TARGETS)
 
Index: testcases/kernel/syscalls/sendfile/sendfile02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/sendfile02.c,v
retrieving revision 1.13
diff -u -r1.13 sendfile02.c
--- testcases/kernel/syscalls/sendfile/sendfile02.c     25 Feb 2008 11:33:27 
-0000      1.13
+++ testcases/kernel/syscalls/sendfile/sendfile02.c     20 Aug 2008 03:18:49 
-0000
@@ -64,7 +64,7 @@
 #endif /* Not def: OFF_T */
 
 
-char *TCID = "sendfile02";
+TCID_DEFINE(sendfile02);
 int TST_TOTAL = 4;
 extern int Tst_count;
 
Index: testcases/kernel/syscalls/sendfile/sendfile03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/sendfile03.c,v
retrieving revision 1.10
diff -u -r1.10 sendfile03.c
--- testcases/kernel/syscalls/sendfile/sendfile03.c     21 Jan 2008 11:16:17 
-0000      1.10
+++ testcases/kernel/syscalls/sendfile/sendfile03.c     20 Aug 2008 03:18:49 
-0000
@@ -60,7 +60,7 @@
 #endif /* Not def: OFF_T */
 
 
-char *TCID = "sendfile03";
+TCID_DEFINE(sendfile03);
 int TST_TOTAL = 3;
 extern int Tst_count;
 
Index: testcases/kernel/syscalls/sendfile/sendfile04.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/sendfile04.c,v
retrieving revision 1.3
diff -u -r1.3 sendfile04.c
--- testcases/kernel/syscalls/sendfile/sendfile04.c     25 Feb 2008 11:33:27 
-0000      1.3
+++ testcases/kernel/syscalls/sendfile/sendfile04.c     20 Aug 2008 03:18:49 
-0000
@@ -64,7 +64,7 @@
 #endif /* Not def: OFF_T */
 
 
-char *TCID = "sendfile04";
+TCID_DEFINE(sendfile04);
 extern int Tst_count;
 
 char in_file[100];
Index: testcases/kernel/syscalls/sendfile/sendfile05.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/sendfile05.c,v
retrieving revision 1.1
diff -u -r1.1 sendfile05.c
--- testcases/kernel/syscalls/sendfile/sendfile05.c     5 Dec 2007 08:44:26 
-0000       1.1
+++ testcases/kernel/syscalls/sendfile/sendfile05.c     20 Aug 2008 03:18:49 
-0000
@@ -59,7 +59,7 @@
 #endif /* Not def: OFF_T */
 
 
-char *TCID = "sendfile05";
+TCID_DEFINE(sendfile05);
 extern int Tst_count;
 
 char in_file[100];
Index: testcases/kernel/syscalls/sendfile/sendfile06.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/sendfile06.c,v
retrieving revision 1.1
diff -u -r1.1 sendfile06.c
--- testcases/kernel/syscalls/sendfile/sendfile06.c     5 Dec 2007 08:44:26 
-0000       1.1
+++ testcases/kernel/syscalls/sendfile/sendfile06.c     20 Aug 2008 03:18:49 
-0000
@@ -60,7 +60,7 @@
 #endif /* Not def: OFF_T */
 
 
-char *TCID = "sendfile06";
+TCID_DEFINE(sendfile06);
 extern int Tst_count;
 
 char in_file[100];
Index: testcases/kernel/syscalls/sendfile/sendfile07.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/sendfile/sendfile07.c,v
retrieving revision 1.1
diff -u -r1.1 sendfile07.c
--- testcases/kernel/syscalls/sendfile/sendfile07.c     5 Dec 2007 08:44:26 
-0000       1.1
+++ testcases/kernel/syscalls/sendfile/sendfile07.c     20 Aug 2008 03:18:49 
-0000
@@ -62,7 +62,7 @@
 #endif /* Not def: OFF_T */
 
 
-char *TCID = "sendfile07";
+TCID_DEFINE(sendfile07);
 int TST_TOTAL = 1;
 extern int Tst_count;
 
Index: testcases/kernel/syscalls/setgid/Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/setgid/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- testcases/kernel/syscalls/setgid/Makefile   19 Aug 2008 07:00:50 -0000      
1.9
+++ testcases/kernel/syscalls/setgid/Makefile   20 Aug 2008 03:18:49 -0000
@@ -19,14 +19,13 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp
 
-SRCS    = $(wildcard *[0-9][0-9].c)
+SRCS    = $(wildcard *.c) 
 TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%_16,$(SRCS))
 
-
 %.c: compat_16.h
-%_16.c: %.c 
-       echo "#define TST_USE_COMPAT16_SYSCALL 1" > $@
-       cat $< >> $@
+%_16.o: %.c
+       $(COMPILE.c) $(OUTPUT_OPTION) $<
+%_16: CFLAGS += -DTST_USE_COMPAT16_SYSCALL=1
 
 
 all: $(TARGETS)
Index: testcases/kernel/syscalls/setgid/setgid02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/setgid/setgid02.c,v
retrieving revision 1.5
diff -u -r1.5 setgid02.c
--- testcases/kernel/syscalls/setgid/setgid02.c 4 Aug 2008 12:06:22 -0000       
1.5
+++ testcases/kernel/syscalls/setgid/setgid02.c 20 Aug 2008 03:18:49 -0000
@@ -48,7 +48,7 @@
 #include <test.h>
 #include <usctest.h>
 
-char *TCID = "setgid02";
+TCID_DEFINE(setgid02);
 int TST_TOTAL = 1;
 extern int Tst_count;
 
Index: testcases/kernel/syscalls/setgid/setgid03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/setgid/setgid03.c,v
retrieving revision 1.4
diff -u -r1.4 setgid03.c
--- testcases/kernel/syscalls/setgid/setgid03.c 4 Aug 2008 12:06:22 -0000       
1.4
+++ testcases/kernel/syscalls/setgid/setgid03.c 20 Aug 2008 03:18:49 -0000
@@ -47,7 +47,7 @@
 #include "test.h"
 #include "usctest.h"
 
-char *TCID = "setgid03";
+TCID_DEFINE(setgid03);
 int TST_TOTAL = 1;
 extern int Tst_count;
 
Index: testcases/kernel/syscalls/truncate/Makefile
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/truncate/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- testcases/kernel/syscalls/truncate/Makefile 5 Aug 2008 03:00:19 -0000       
1.8
+++ testcases/kernel/syscalls/truncate/Makefile 20 Aug 2008 03:18:52 -0000
@@ -19,13 +19,16 @@
 CFLAGS += -I../../../../include -Wall
 LDLIBS += -L../../../../lib -lltp
 
-SRCS    = $(wildcard truncate[0-9][0-9]*.c)
+SRCS    = $(wildcard *.c)
 TARGETS = $(patsubst %.c,%,$(SRCS)) $(patsubst %.c,%_64,$(SRCS))
 
 
-%_64.c: %.c
-       echo "#define _FILE_OFFSET_BITS 64" > $@
-       cat  $< >> $@
+%_64.o: %.c
+       $(COMPILE.c) $(OUTPUT_OPTION) $<
+%_64: CFLAGS +=                                        \
+       -DTST_USE_NEWER64_SYSCALL=1             \
+       -D_FILE_OFFSET_BITS=64
+
 
 all: $(TARGETS)
 
Index: testcases/kernel/syscalls/truncate/truncate01.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/truncate/truncate01.c,v
retrieving revision 1.2
diff -u -r1.2 truncate01.c
--- testcases/kernel/syscalls/truncate/truncate01.c     27 Mar 2003 22:27:13 
-0000      1.2
+++ testcases/kernel/syscalls/truncate/truncate01.c     20 Aug 2008 03:18:52 
-0000
@@ -84,7 +84,7 @@
 #define FILE_SIZE      1024                    /* test file size */
 #define TRUNC_LEN      256                     /* truncation length */
 
-char *TCID="truncate01";       /* Test program identifier.    */
+TCID_DEFINE(truncate01);       /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={0};
Index: testcases/kernel/syscalls/truncate/truncate02.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/truncate/truncate02.c,v
retrieving revision 1.2
diff -u -r1.2 truncate02.c
--- testcases/kernel/syscalls/truncate/truncate02.c     27 Mar 2003 22:27:13 
-0000      1.2
+++ testcases/kernel/syscalls/truncate/truncate02.c     20 Aug 2008 03:18:52 
-0000
@@ -86,7 +86,7 @@
 #define TRUNC_LEN1     256                     /* truncation length */
 #define TRUNC_LEN2     512                     /* truncation length */
 
-char *TCID="truncate02";       /* Test program identifier.    */
+TCID_DEFINE(truncate02);       /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int fd;                                /* file descriptor of testfile */
Index: testcases/kernel/syscalls/truncate/truncate03.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/truncate/truncate03.c,v
retrieving revision 1.8
diff -u -r1.8 truncate03.c
--- testcases/kernel/syscalls/truncate/truncate03.c     9 Feb 2007 20:48:23 
-0000       1.8
+++ testcases/kernel/syscalls/truncate/truncate03.c     20 Aug 2008 03:18:52 
-0000
@@ -106,7 +106,7 @@
 int setup2();                  /* setup function to test chmod for ENOTDIR */
 int longpath_setup();   /* setup function to test chmod for ENAMETOOLONG */
 
-char *TCID="truncate03";       /* Test program identifier.    */
+TCID_DEFINE(truncate03);       /* Test program identifier.    */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 int exp_enos[]={EACCES, ENOTDIR, EFAULT, ENAMETOOLONG, ENOENT, 0};
 
Index: testcases/kernel/syscalls/truncate/truncate04.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/truncate/truncate04.c,v
retrieving revision 1.2
diff -u -r1.2 truncate04.c
--- testcases/kernel/syscalls/truncate/truncate04.c     27 Mar 2003 22:27:13 
-0000      1.2
+++ testcases/kernel/syscalls/truncate/truncate04.c     20 Aug 2008 03:18:52 
-0000
@@ -87,7 +87,7 @@
 char nobody_uid[] = "nobody";
 struct passwd *ltpuser;
 
-char *TCID="truncate04";       /* Test program identifier.    */
+TCID_DEFINE(truncate04);       /* Test program identifier.    */
 int TST_TOTAL=1;               /* Total number of test conditions */
 extern int Tst_count;          /* Test Case counter for tst_* routines */
 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to