pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/regress/compiler Added tests for macro definitions on ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/0ed3a5662b4e
branches: trunk
changeset: 520477:0ed3a5662b4e
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun Oct 22 07:52:27 2006 +0000
description:
Added tests for macro definitions on the command line.
diffstat:
regress/compiler/Makefile | 20 +++++++++++++++-----
regress/compiler/files/checklen.c | 11 +++++++++++
regress/compiler/files/checktype.c | 1 +
3 files changed, 27 insertions(+), 5 deletions(-)
diffs (58 lines):
diff -r 373b915bb33e -r 0ed3a5662b4e regress/compiler/Makefile
--- a/regress/compiler/Makefile Sun Oct 22 07:20:06 2006 +0000
+++ b/regress/compiler/Makefile Sun Oct 22 07:52:27 2006 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2006/07/11 05:03:11 rillig Exp $
+# $NetBSD: Makefile,v 1.2 2006/10/22 07:52:27 rillig Exp $
#
-DISTNAME= compiler-1.0
+DISTNAME= compiler-1.1
CATEGORIES= regress
MASTER_SITES= # none
DISTFILES= # none
@@ -15,11 +15,21 @@
SRC_CMD= ${PRINTF} '\#if defined(__cplusplus)\nLANG: Cplus\n\#else\nLANG: Cplain\n\#endif\n'
+do-extract:
+ cd ${FILESDIR} && cp *.c ${WRKSRC}
+
do-build:
# Test whether CPP is a C preprocessor.
- ${SRC_CMD} | ${CPP} -DLANG=Cplain
+ ${SRC_CMD} | cpp -DLANG=Cplain
# Test whether CXXCPP is a C++ preprocessor.
# CXXCPP is not (yet)? defined.
- #${SRC_CMD} | ${CXXCPP} -DLANG=Cplus
-
+ #${SRC_CMD} | cxxcpp -DLANG=Cplus
+ # Test whether white-space is preserved in macro definitions.
+ cd ${WRKSRC} && cc checklen.c -o checklen -DLEN=4 -DSPACES=\"\ \ \ \ \" && ./checklen
+ cd ${WRKSRC} && cc checklen.c -o checklen -DLEN=4 -DSPACES=\"" \"" && ./checklen
+ cd ${WRKSRC} && cc checklen.c -o checklen -DLEN=4 -DSPACES='" "' && ./checklen
+ # Test whether backslashes are preserved in macro definitions.
+ cd ${WRKSRC} && cc -c checktype.c -DTYPE="unsigned long"
+ cd ${WRKSRC} && cc -c checktype.c -DTYPE=unsigned\ long
+
.include "../../mk/bsd.pkg.mk"
diff -r 373b915bb33e -r 0ed3a5662b4e regress/compiler/files/checklen.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/compiler/files/checklen.c Sun Oct 22 07:52:27 2006 +0000
@@ -0,0 +1,11 @@
+#include <assert.h>
+#include <string.h>
+
+int
+main(void)
+{
+ const char *s = SPACES;
+
+ assert(strlen(s) == LEN);
+ return 0;
+}
diff -r 373b915bb33e -r 0ed3a5662b4e regress/compiler/files/checktype.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/compiler/files/checktype.c Sun Oct 22 07:52:27 2006 +0000
@@ -0,0 +1,1 @@
+typedef TYPE t;
Home |
Main Index |
Thread Index |
Old Index