Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/usr.bin/rtld/dlopen test program for dlopen(3)



details:   https://anonhg.NetBSD.org/src/rev/f029640a3a0e
branches:  trunk
changeset: 500226:f029640a3a0e
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Dec 08 19:22:51 2000 +0000

description:
test program for dlopen(3)

diffstat:

 regress/usr.bin/rtld/dlopen/Makefile   |  17 +++++++++++++++++
 regress/usr.bin/rtld/dlopen/dlopen.c   |  18 ++++++++++++++++++
 regress/usr.bin/rtld/dlopen/dlopen.exp |   6 ++++++
 3 files changed, 41 insertions(+), 0 deletions(-)

diffs (53 lines):

diff -r 163e46e38384 -r f029640a3a0e regress/usr.bin/rtld/dlopen/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/usr.bin/rtld/dlopen/Makefile      Fri Dec 08 19:22:51 2000 +0000
@@ -0,0 +1,17 @@
+# $NetBSD: Makefile,v 1.1 2000/12/08 19:22:51 drochner Exp $
+
+MKMAN=  no
+
+PROG=  dlopen
+
+TESTLIBDIR!=   cd ${.CURDIR}/../testlib; make print-objdir
+
+regress:
+       if [ -f ${TESTLIBDIR}/testlib.so ]; then \
+               ${.OBJDIR}/dlopen ${TESTLIBDIR}/testlib.so >dlopen.out; \
+               tail +4 ${.CURDIR}/dlopen.exp | diff - dlopen.out; \
+       fi
+
+CLEANFILES+=   dlopen.out
+
+.include <bsd.prog.mk>
diff -r 163e46e38384 -r f029640a3a0e regress/usr.bin/rtld/dlopen/dlopen.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/usr.bin/rtld/dlopen/dlopen.c      Fri Dec 08 19:22:51 2000 +0000
@@ -0,0 +1,18 @@
+/* $NetBSD: dlopen.c,v 1.1 2000/12/08 19:22:51 drochner Exp $ */
+
+#include <stdio.h>
+#include <dlfcn.h>
+
+int
+main(int argc, char **argv)
+{
+       void *p;
+
+       p = dlopen(argv[1], DL_LAZY);
+       if (p)
+               printf("OK\n");
+       else
+               printf("%s\n", dlerror());
+
+       return (0);
+}
diff -r 163e46e38384 -r f029640a3a0e regress/usr.bin/rtld/dlopen/dlopen.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/regress/usr.bin/rtld/dlopen/dlopen.exp    Fri Dec 08 19:22:51 2000 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: dlopen.exp,v 1.1 2000/12/08 19:22:51 drochner Exp $
+# real output must start in line 4
+
+constructor
+OK
+destructor



Home | Main Index | Thread Index | Old Index