From 25ea915c3c33bf3aafa4436b66a6699f0292bb4b Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Tue, 2 Mar 2010 00:46:31 -0500 Subject: [PATCH] tests: add test-nevents --- configure.ac | 1 + tests/Makefile.am | 2 +- tests/test-nevents/Makefile.am | 5 +++++ tests/test-nevents/prog.c | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/test-nevents/Makefile.am create mode 100644 tests/test-nevents/prog.c diff --git a/configure.ac b/configure.ac index 514a1f4..f0c99e6 100644 --- a/configure.ac +++ b/configure.ac @@ -119,6 +119,7 @@ AC_CONFIG_FILES([ tests/fork/Makefile tests/simple_include/Makefile tests/snprintf/Makefile + tests/test-nevents/Makefile libmallocwrap/Makefile libinterfork/Makefile ustd/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index abe446e..061f5e2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1 +1 @@ -SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf +SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents diff --git a/tests/test-nevents/Makefile.am b/tests/test-nevents/Makefile.am new file mode 100644 index 0000000..502d6c4 --- /dev/null +++ b/tests/test-nevents/Makefile.am @@ -0,0 +1,5 @@ +#AM_CPPFLAGS = -I$(top_srcdir)/include + +noinst_PROGRAMS = prog +prog_SOURCES = prog.c +prog_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o diff --git a/tests/test-nevents/prog.c b/tests/test-nevents/prog.c new file mode 100644 index 0000000..71c03e0 --- /dev/null +++ b/tests/test-nevents/prog.c @@ -0,0 +1,23 @@ +#include +#include +#include + +#define N_ITER 100000 + +int main() +{ + int i; + const char teststr[] = "Hello World! 1234567890abc"; + void *ptrs[N_ITER]; + + for(i=0; i