test for two markers on the same line
authorOussama El Mfadli <oussama.el-mfadli@polymtl.ca>
Wed, 12 May 2010 20:12:42 +0000 (16:12 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Fri, 21 May 2010 20:48:55 +0000 (16:48 -0400)
configure.ac
tests/Makefile.am
tests/runtests
tests/same_line_marker/Makefile.am [new file with mode: 0644]
tests/same_line_marker/run [new file with mode: 0755]
tests/same_line_marker/same_line_marker.c [new file with mode: 0644]

index 7b93653834781cf6b5f91820daee284e44bc20e9..01d878e1dbe281c36be9ff6f75517c9cbe143a3c 100644 (file)
@@ -120,6 +120,7 @@ AC_CONFIG_FILES([
        tests/test-nevents/Makefile
        tests/test-libustinstr-malloc/Makefile
        tests/dlopen/Makefile
+       tests/same_line_marker/Makefile
        libustinstr-malloc/Makefile
        libustfork/Makefile
        ustd/Makefile
index cb00b56b0b2d949993b4d458f9f9570e0214c7c4..c1fc928b7a13d460d8ea837b0e3598e63ebf0cde 100644 (file)
@@ -1,3 +1,3 @@
-SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libustinstr-malloc dlopen
+SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libustinstr-malloc dlopen same_line_marker
 
 dist_noinst_SCRIPTS = test_loop runtests trace_matches
index 40f7528e99df04509c57d31e9d87450b4cd2fcfe..676ab119ef267087be2a9cab3a98199e32456d05 100755 (executable)
@@ -116,6 +116,14 @@ trace_loc=$(usttrace -W)
 NOFAIL $MATCHES -N "from_library" -n 1 "^ust.from_library:" $trace_loc
 NOFAIL $MATCHES -N "from_main_before_lib" -n 1 "^ust.from_main_before_lib:" $trace_loc
 NOFAIL $MATCHES -N "from_main_after_lib" -n 1 "^ust.from_main_after_lib:" $trace_loc
+
+### same-line-marker ###
+starttest "same_line_marker"
+NOFAIL usttrace $TESTDIR/same_line_marker/same_line_marker
+trace_loc=$(usttrace -W)
+NOFAIL $MATCHES -N "same_line_event" -n 2 "^ust.same_line_event:" $trace_loc
+
+
 echo "************************************"
 echo "$0: All passed"
 echo "************************************"
diff --git a/tests/same_line_marker/Makefile.am b/tests/same_line_marker/Makefile.am
new file mode 100644 (file)
index 0000000..d1757b1
--- /dev/null
@@ -0,0 +1,8 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/libust
+
+noinst_PROGRAMS = same_line_marker
+same_line_marker_SOURCES = same_line_marker.c
+same_line_marker_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o
+
+noinst_SCRIPTS = run
+EXTRA_DIST = run
diff --git a/tests/same_line_marker/run b/tests/same_line_marker/run
new file mode 100755 (executable)
index 0000000..9a918f7
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+UST_AUTOPROBE=1 UST_TRACE=1 LD_LIBRARY_PATH=../libust/.libs $1 ./same_line_marker
diff --git a/tests/same_line_marker/same_line_marker.c b/tests/same_line_marker/same_line_marker.c
new file mode 100644 (file)
index 0000000..d9c0f22
--- /dev/null
@@ -0,0 +1,24 @@
+/* Copyright (C) 2010 Oussama El Mfadli, Alexis Hallé
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <ust/marker.h>
+
+int main()
+{
+  trace_mark(ust, same_line_event, "%s","An event occured in the same line"); trace_mark(ust, same_line_event, "%s","An event occured in the same line");
+       return 0;
+}
This page took 0.02575 seconds and 4 git commands to generate.