From 4724bd5a4a19db117a1d280b9d1a3508fd4e03fa Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Wed, 8 Apr 2015 07:11:52 -0400 Subject: [PATCH 1/2] Convert main-threaded test case to new style --- testsuite/ltrace.main/Makefile.am | 4 +- testsuite/ltrace.main/main-threaded.c | 30 ---------- testsuite/ltrace.main/main-threaded.exp | 103 ++++++++++++++++++++------------ 3 files changed, 66 insertions(+), 71 deletions(-) delete mode 100644 testsuite/ltrace.main/main-threaded.c diff --git a/testsuite/ltrace.main/Makefile.am b/testsuite/ltrace.main/Makefile.am index 23ab8ab..06ad613 100644 --- a/testsuite/ltrace.main/Makefile.am +++ b/testsuite/ltrace.main/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 1992 - 2001, 2012, 2013 Free Software Foundation, Inc. +# Copyright (C) 1992 - 2001, 2012, 2013, 2015 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ EXTRA_DIST = branch_func.c branch_func.exp filters.exp hello-vfork.c \ hello-vfork.exp main.c main.exp main-internal.exp main-lib.c \ - main-threaded.c main-threaded.exp main-vfork.c main-vfork.exp \ + main-threaded.exp main-vfork.c main-vfork.exp \ parameters.c parameters.conf parameters.exp parameters-lib.c \ parameters2.exp parameters3.exp signals.c signals.exp \ system_calls.c system_calls.exp system_call_params.exp diff --git a/testsuite/ltrace.main/main-threaded.c b/testsuite/ltrace.main/main-threaded.c deleted file mode 100644 index 2992d1e..0000000 --- a/testsuite/ltrace.main/main-threaded.c +++ /dev/null @@ -1,29 +0,0 @@ -#include - -extern void print (char *); - -#define PRINT_LOOP 10 - -void * -th_main (void *arg) -{ - int i; - for (i=0; i. +# This file is part of ltrace. +# Copyright (C) 2011, 2015 Petr Machata, Red Hat Inc. +# Copyright (C) 2006 Yao Qi . +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program 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 +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA + +set libprint [ltraceCompile libprint.so [ltraceSource c { + #include + + void + print(char* s) + { + printf("%s\n",s); + } +}]] + +set bin [ltraceCompile {} $libprint -lpthread [ltraceSource c { + #include + + extern void print (char *); + + #define PRINT_LOOP 10 + + void * + th_main (void *arg) + { + int i; + for (i=0; i