Author: pjd
Date: Sat Jan  4 09:25:27 2014
New Revision: 260253
URL: http://svnweb.freebsd.org/changeset/base/260253

Log:
  MFp4 @1189766:
  
  - Compile the tests with .t suffix, so prove can use them directly.
  - The CHECKX() macro should increment ntest just like the CHECK() macro.
  - For consistency remove # from the pwd.t output.
  
  Submitted by: Mariusz Zaborski <osho...@freebsd.org>

Modified:
  head/tools/regression/capsicum/libcapsicum/Makefile
  head/tools/regression/capsicum/libcapsicum/dns.c
  head/tools/regression/capsicum/libcapsicum/grp.c
  head/tools/regression/capsicum/libcapsicum/pwd.c
  head/tools/regression/capsicum/libcapsicum/sysctl.c

Modified: head/tools/regression/capsicum/libcapsicum/Makefile
==============================================================================
--- head/tools/regression/capsicum/libcapsicum/Makefile Sat Jan  4 04:48:58 
2014        (r260252)
+++ head/tools/regression/capsicum/libcapsicum/Makefile Sat Jan  4 09:25:27 
2014        (r260253)
@@ -15,12 +15,14 @@ CFLAGS+=    -Wold-style-definition -Wno-poi
 CFLAGS+=       -I${.CURDIR}/../../../../lib/libcapsicum
 CFLAGS+=       -ggdb
 
-all:   ${SERVICES}
+SERVTEST=      ${SERVICES:=.t}
+
+all:   ${SERVTEST}
 
 .for SERVICE in ${SERVICES}
 
-${SERVICE}:    ${SERVICE}.c
-       ${CC} ${CFLAGS} ${@}.c -o $@ -lcapsicum -lnv
+${SERVICE}.t:  ${SERVICE}.c
+       ${CC} ${CFLAGS} ${@:.t=.c} -o $@ -lcapsicum -lnv
 
 .endfor
 
@@ -28,4 +30,4 @@ test: all
        @prove -r ${.CURDIR}
 
 clean:
-       rm -f ${SERVICES}
+       rm -f ${SERVTEST}

Modified: head/tools/regression/capsicum/libcapsicum/dns.c
==============================================================================
--- head/tools/regression/capsicum/libcapsicum/dns.c    Sat Jan  4 04:48:58 
2014        (r260252)
+++ head/tools/regression/capsicum/libcapsicum/dns.c    Sat Jan  4 09:25:27 
2014        (r260253)
@@ -64,6 +64,7 @@ static int ntest = 1;
                printf("not ok %d %s:%u\n", ntest, __FILE__, __LINE__); \
                exit(1);                                                \
        }                                                               \
+       ntest++;                                                        \
 } while (0)
 
 #define        GETHOSTBYNAME                   0x01
@@ -223,7 +224,7 @@ main(void)
        const char *types[2];
        int families[2];
 
-       printf("1..89\n");
+       printf("1..91\n");
 
        capcas = cap_init();
        CHECKX(capcas != NULL);

Modified: head/tools/regression/capsicum/libcapsicum/grp.c
==============================================================================
--- head/tools/regression/capsicum/libcapsicum/grp.c    Sat Jan  4 04:48:58 
2014        (r260252)
+++ head/tools/regression/capsicum/libcapsicum/grp.c    Sat Jan  4 09:25:27 
2014        (r260253)
@@ -61,6 +61,7 @@ static int ntest = 1;
                printf("not ok %d %s:%u\n", ntest, __FILE__, __LINE__); \
                exit(1);                                                \
        }                                                               \
+       ntest++;                                                        \
 } while (0)
 
 #define        GID_WHEEL       0
@@ -1522,7 +1523,7 @@ main(void)
 {
        cap_channel_t *capcas, *capgrp;
 
-       printf("1..197\n");
+       printf("1..199\n");
 
        capcas = cap_init();
        CHECKX(capcas != NULL);

Modified: head/tools/regression/capsicum/libcapsicum/pwd.c
==============================================================================
--- head/tools/regression/capsicum/libcapsicum/pwd.c    Sat Jan  4 04:48:58 
2014        (r260252)
+++ head/tools/regression/capsicum/libcapsicum/pwd.c    Sat Jan  4 09:25:27 
2014        (r260253)
@@ -49,18 +49,19 @@ static int ntest = 1;
 
 #define CHECK(expr)     do {                                           \
        if ((expr))                                                     \
-               printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__);   \
+               printf("ok %d %s:%u\n", ntest, __FILE__, __LINE__);     \
        else                                                            \
-               printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\
+               printf("not ok %d %s:%u\n", ntest, __FILE__, __LINE__);\
        ntest++;                                                        \
 } while (0)
 #define CHECKX(expr)     do {                                          \
        if ((expr)) {                                                   \
-               printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__);   \
+               printf("ok %d %s:%u\n", ntest, __FILE__, __LINE__);     \
        } else {                                                        \
-               printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\
+               printf("not ok %d %s:%u\n", ntest, __FILE__, __LINE__);\
                exit(1);                                                \
        }                                                               \
+       ntest++;                                                        \
 } while (0)
 
 #define        UID_ROOT        0
@@ -1508,7 +1509,7 @@ main(void)
 {
        cap_channel_t *capcas, *cappwd;
 
-       printf("1..186\n");
+       printf("1..188\n");
 
        capcas = cap_init();
        CHECKX(capcas != NULL);

Modified: head/tools/regression/capsicum/libcapsicum/sysctl.c
==============================================================================
--- head/tools/regression/capsicum/libcapsicum/sysctl.c Sat Jan  4 04:48:58 
2014        (r260252)
+++ head/tools/regression/capsicum/libcapsicum/sysctl.c Sat Jan  4 09:25:27 
2014        (r260253)
@@ -73,6 +73,7 @@ static int ntest = 1;
                printf("not ok %d %s:%u\n", ntest, __FILE__, __LINE__); \
                exit(1);                                                \
        }                                                               \
+       ntest++;                                                        \
 } while (0)
 
 #define        SYSCTL0_READ0           0x0001
@@ -1470,7 +1471,7 @@ main(void)
        int scvalue0, scvalue1;
        size_t scsize;
 
-       printf("1..250\n");
+       printf("1..256\n");
 
        scsize = sizeof(scvalue0);
        CHECKX(sysctlbyname(SYSCTL0_NAME, &scvalue0, &scsize, NULL, 0) == 0);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to