add missing tests/basic and tests/fork
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Sun, 13 Sep 2009 15:38:19 +0000 (11:38 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Sun, 13 Sep 2009 15:38:19 +0000 (11:38 -0400)
tests/basic/Makefile.am [new file with mode: 0644]
tests/basic/basic.c [new file with mode: 0644]
tests/basic/run [new file with mode: 0755]
tests/fork/Makefile.am [new file with mode: 0644]
tests/fork/fork.c [new file with mode: 0644]
tests/fork/run [new file with mode: 0755]

diff --git a/tests/basic/Makefile.am b/tests/basic/Makefile.am
new file mode 100644 (file)
index 0000000..d949bb4
--- /dev/null
@@ -0,0 +1,9 @@
+INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \
+       $(KCOMPAT_CFLAGS) $(URCU_CFLAGS)
+
+noinst_PROGRAMS = basic
+basic_SOURCES = basic.c
+basic_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS)
+
+noinst_SCRIPTS = run
+EXTRA_DIST = run
diff --git a/tests/basic/basic.c b/tests/basic/basic.c
new file mode 100644 (file)
index 0000000..a5ceff3
--- /dev/null
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <unistd.h>
+
+#include "marker.h"
+
+
+int main()
+{
+       int i;
+
+       printf("Basic test program\n");
+
+       for(i=0; i<50; i++) {
+               trace_mark(ust, bar, "str %s", "FOOBAZ");
+               trace_mark(ust, bar2, "number1 %d number2 %d", 53, 9800);
+               usleep(100000);
+       }
+
+       return 0;
+}
+
+MARKER_LIB;
diff --git a/tests/basic/run b/tests/basic/run
new file mode 100755 (executable)
index 0000000..16601ef
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+# Run with nothing
+
+
+#LD_LIBRARY_PATH=../../libust/.libs:../../../liburcu $1 .libs/basic
+#UST_AUTOPROBE="/foo" LD_LIBRARY_PATH=../../libust/.libs:../../../liburcu $1 .libs/basic
+UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../../libust/.libs:../../../liburcu $1 .libs/basic
diff --git a/tests/fork/Makefile.am b/tests/fork/Makefile.am
new file mode 100644 (file)
index 0000000..100cd36
--- /dev/null
@@ -0,0 +1,9 @@
+INCLUDES = -I$(top_builddir)/share -I$(top_builddir)/libust \
+       $(KCOMPAT_CFLAGS) $(URCU_CFLAGS)
+
+noinst_PROGRAMS = fork
+fork_SOURCES = fork.c
+fork_LDADD = $(top_builddir)/libust/libust.la $(URCU_LIBS)
+
+noinst_SCRIPTS = run
+EXTRA_DIST = run
diff --git a/tests/fork/fork.c b/tests/fork/fork.c
new file mode 100644 (file)
index 0000000..20a0877
--- /dev/null
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <unistd.h>
+
+#include "marker.h"
+
+
+int main()
+{
+       int result;
+
+       printf("Fork test program\n");
+       trace_mark(ust, before_fork, MARK_NOARGS);
+
+       sleep(5);
+
+       result = fork();
+       if(result == -1) {
+               perror("fork");
+               return 1;
+       }
+       if(result == 0) {
+               trace_mark(ust, after_fork_child, MARK_NOARGS);
+       }
+       else {
+               trace_mark(ust, after_fork_parent, MARK_NOARGS);
+       }
+
+       return 0;
+}
+
+MARKER_LIB;
diff --git a/tests/fork/run b/tests/fork/run
new file mode 100755 (executable)
index 0000000..7c36d01
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Run with nothing
+
+#UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../libust/.libs:../../../liburcu $1 .libs/fork
+#UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../libust/.libs:../../../liburcu LD_PRELOAD=../../libinterfork/.libs/libinterfork.so $1 .libs/fork
+#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../libust/.libs:../../../liburcu .libs/fork
This page took 0.026363 seconds and 4 git commands to generate.