summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorDave Lerner <dave.lerner@windriver.com>2014-02-15 09:27:31 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-21 16:09:07 +0000
commitdc9f7d7c4908a4bc32d4e1e03ab3367a3d3f1441 (patch)
tree27c2e40cb6aec1afe6cf8e6cd7b2d16b7fc69e10 /meta/recipes-devtools
parentbb0c26960d3b05070346cdfdfd05d6fd4ad0a7b1 (diff)
downloadpoky-dc9f7d7c4908a4bc32d4e1e03ab3367a3d3f1441.tar.gz
valgrind: integration of regression tests to ptest
Modifies valgrind's regression test framework to be compatible with the yocto PTEST framework as follows: * existing recipe valgrind*bb adds new methods: do_compile_ptest and do_install_ptest. * new file run-ptest adds the wrapper interface to the valgrind regression test script vg_regtest. * existing valgrind regression test script 'vg_regtest' changes to report the status of the valgrind component tests in the format that PTEST expects, instead of the valgrind formats, but only when vg_regtest is invoked with an optional --yocto-ptest argument * four new patches disable building tests that don't compile with the yocto compiler and default options. See the patches for details. (From OE-Core rev: d4438e421f448cdb7e25c038d657bbebc1b6486e) Signed-off-by: Dave Lerner <dave.lerner@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/add-ptest.patch205
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch42
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch67
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch75
-rwxr-xr-xmeta/recipes-devtools/valgrind/valgrind/run-ptest11
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.9.0.bb56
6 files changed, 455 insertions, 1 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/add-ptest.patch b/meta/recipes-devtools/valgrind/valgrind/add-ptest.patch
new file mode 100644
index 0000000000..fdc9cc0e83
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/add-ptest.patch
@@ -0,0 +1,205 @@
1Modify vg_test wrapper to support PTEST formats
2
3This commit changes the valgrind regression test script vg_regtest to
4support the yocto ptest stdout reporting format. The commit adds
5'--yocto-ptest' as an optional argument to vg_regtest, which alters
6the output to use the ptest infrastructure reporting format:
7 "[PASS|SKIP|FAIL]: testname"
8instead of valgrind's internal test reporting format. Without the added
9option, --yocto-ptest, the valgrind regression test output is unchanged.
10
11Upstream-Status: Pending
12
13Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
14
15diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
16index 224385f..dbbd23d 100755
17--- a/tests/vg_regtest.in
18+++ b/tests/vg_regtest.in
19@@ -39,11 +39,11 @@
20 # --valgrind.)
21 # --keep-unfiltered: keep a copy of the unfiltered output/error output
22 # of each test by adding an extension .unfiltered.out
23-#
24 # --outer-valgrind: run this valgrind under the given outer valgrind.
25 # This valgrind must be configured with --enable-inner.
26 # --outer-tool: tool to use by the outer valgrind (default memcheck).
27 # --outer-args: use this as outer tool args.
28+# --yocto-ptest: output in yocto ptest format
29 #
30 # The easiest way is to run all tests in valgrind/ with (assuming you installed
31 # in $PREFIX):
32@@ -126,7 +126,7 @@ use strict;
33 my $usage="\n"
34 . "Usage:\n"
35 . " vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
36- . " --outer-valgrind, --outer-tool, --outer-args]\n"
37+ . " --outer-valgrind, --outer-tool, --outer-args, --yocto-ptest]\n"
38 . " Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
39 . "\n";
40
41@@ -170,6 +170,7 @@ my $outer_args;
42
43 my $valgrind_lib = "$tests_dir/.in_place";
44 my $keepunfiltered = 0;
45+my $yoctoptest = 0;
46
47 # default filter is the one named "filter_stderr" in the test's directory
48 my $default_stderr_filter = "filter_stderr";
49@@ -226,6 +227,8 @@ sub process_command_line()
50 $valgrind_lib = $1;
51 } elsif ($arg =~ /^--keep-unfiltered$/) {
52 $keepunfiltered = 1;
53+ } elsif ($arg =~ /^--yocto-ptest$/) {
54+ $yoctoptest = 1;
55 } else {
56 die $usage;
57 }
58@@ -394,19 +397,21 @@ sub do_diffs($$$$)
59 # A match; remove .out and any previously created .diff files.
60 unlink("$name.$mid.out");
61 unlink(<$name.$mid.diff*>);
62- return;
63+ return 0;
64 }
65 }
66 }
67 # If we reach here, none of the .exp files matched.
68- print "*** $name failed ($mid) ***\n";
69+ print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
70 push(@failures, sprintf("%-40s ($mid)", "$fullname"));
71 $num_failures{$mid}++;
72+ return 1;
73 }
74
75 sub do_one_test($$)
76 {
77 my ($dir, $vgtest) = @_;
78+ my $diffStatus = 0;
79 $vgtest =~ /^(.*)\.vgtest/;
80 my $name = $1;
81 my $fullname = "$dir/$name";
82@@ -425,7 +430,11 @@ sub do_one_test($$)
83 } elsif (256 == $prereq_res) {
84 # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
85 # Prereq failed, skip.
86- printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
87+ if ($yoctoptest == 0) {
88+ printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
89+ } else {
90+ printf("SKIP: $fullname\n");
91+ }
92 return;
93 } else {
94 # Bad prereq; abort.
95@@ -438,7 +447,7 @@ sub do_one_test($$)
96 if (defined $progB) {
97 # If there is a progB, let's start it in background:
98 printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
99- "$name:");
100+ "$name:") if ($yoctoptest == 0);
101 # progB.done used to detect child has finished. See below.
102 # Note: redirection of stdout and stderr is before $progB to allow argsB
103 # to e.g. redirect stdoutB to stderrB
104@@ -452,7 +461,8 @@ sub do_one_test($$)
105 . "touch progB.done) &");
106 }
107 } else {
108- printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
109+ printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
110+ if ($yoctoptest == 0);
111 }
112
113 # Pass the appropriate --tool option for the directory (can be overridden
114@@ -487,7 +497,7 @@ sub do_one_test($$)
115 # Find all the .stdout.exp files. If none, use /dev/null.
116 my @stdout_exps = <$name.stdout.exp*>;
117 @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
118- do_diffs($fullname, $name, "stdout", \@stdout_exps);
119+ $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
120
121 # Filter stderr
122 $stderr_filter_args = $name if (! defined $stderr_filter_args);
123@@ -496,7 +506,7 @@ sub do_one_test($$)
124 # Find all the .stderr.exp files. At least one must exist.
125 my @stderr_exps = <$name.stderr.exp*>;
126 (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
127- do_diffs($fullname, $name, "stderr", \@stderr_exps);
128+ $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
129
130 if (defined $progB) {
131 # wait for the child to be finished
132@@ -520,7 +530,7 @@ sub do_one_test($$)
133 # Find all the .stdoutB.exp files. If none, use /dev/null.
134 my @stdoutB_exps = <$name.stdoutB.exp*>;
135 @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
136- do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
137+ $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
138
139 # Filter stderr
140 $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
141@@ -529,7 +539,7 @@ sub do_one_test($$)
142 # Find all the .stderrB.exp files. At least one must exist.
143 my @stderrB_exps = <$name.stderrB.exp*>;
144 (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
145- do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
146+ $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
147 }
148
149 # Maybe do post-test check
150@@ -541,7 +551,7 @@ sub do_one_test($$)
151 # Find all the .post.exp files. If none, use /dev/null.
152 my @post_exps = <$name.post.exp*>;
153 @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
154- do_diffs($fullname, $name, "post", \@post_exps);
155+ $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
156 }
157 }
158
159@@ -550,6 +560,13 @@ sub do_one_test($$)
160 print("(cleanup operation failed: $cleanup)\n");
161 }
162
163+ if ($yoctoptest == 1) {
164+ if ($diffStatus == 0) {
165+ print("PASS: $fullname\n");
166+ } else {
167+ print("FAIL: $fullname\n");
168+ }
169+ }
170 $num_tests_done++;
171 }
172
173@@ -589,7 +606,7 @@ sub test_one_dir($$)
174 my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
175
176 if ($found_tests) {
177- print "-- Running tests in $full_dir $dashes\n";
178+ print "-- Running tests in $full_dir $dashes\n" if ($yoctoptest == 0);
179 }
180 foreach my $f (@fs) {
181 if (-d $f) {
182@@ -599,7 +616,7 @@ sub test_one_dir($$)
183 }
184 }
185 if ($found_tests) {
186- print "-- Finished tests in $full_dir $dashes\n";
187+ print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
188 }
189
190 chdir("..");
191@@ -625,10 +642,12 @@ sub summarise_results
192 $num_failures{"stdout"}, plural($num_failures{"stdout"}),
193 $num_failures{"stderrB"}, plural($num_failures{"stderrB"}),
194 $num_failures{"stdoutB"}, plural($num_failures{"stdoutB"}),
195- $num_failures{"post"}, plural($num_failures{"post"}));
196+ $num_failures{"post"}, plural($num_failures{"post"}))
197+ if ($yoctoptest == 0);
198
199 foreach my $failure (@failures) {
200- print "$failure\n";
201+ print "$failure\n"
202+ if ($yoctoptest == 0);
203 }
204 print "\n";
205 }
diff --git a/meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch b/meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch
new file mode 100644
index 0000000000..b644348bbc
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch
@@ -0,0 +1,42 @@
1Suppress building ptest apps with the -gstabs option
2
3Force the configure tests for -gstabs compiler support to fail so that
4the regression tests don't try to build with the -gstabs option.
5Otherwise, the valgrind build when ptest is enabled fails with the
6error:
7 Stabs debuginfo not supported:
8 ../package/usr/lib/valgrind/ptest/memcheck/tests/deep_templates
9 ERROR: Function failed: split_and_strip_files
10
11Upstream-status: Inappropriate [gstabs support is appropriate upstream,
12 but not for this distro]
13
14Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
15
16diff --git a/configure.ac b/configure.ac
17index 755dfb9..cc8b5e1 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -1743,22 +1743,7 @@ AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
21 CFLAGS=$safe_CFLAGS
22
23
24-# does this compiler support -gstabs ?
25-
26-AC_MSG_CHECKING([if gcc accepts -gstabs])
27-
28-safe_CFLAGS=$CFLAGS
29-CFLAGS="-gstabs"
30-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
31- return 0;
32-]])], [
33-ac_have_gstabs=yes
34-AC_MSG_RESULT([yes])
35-], [
36 ac_have_gstabs=no
37-AC_MSG_RESULT([no])
38-])
39-CFLAGS=$safe_CFLAGS
40 AM_CONDITIONAL([HAVE_GSTABS], [test x$ac_have_gstabs = xyes])
41
42
diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch b/meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch
new file mode 100644
index 0000000000..46dea60eb3
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch
@@ -0,0 +1,67 @@
1Remove tests that require thumb compiler flags
2
3Default compiler options for arm machines are incompatible with the
4'-mthumb' compiler option imposed by the intdiv and lrt test
5applications, so those two are removed from the ptest build.
6
7Upstream-Status: Pending
8
9Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
10
11diff --git a/none/tests/arm/Makefile.am b/none/tests/arm/Makefile.am
12index 2a19f5b..ccdeb77 100644
13--- a/none/tests/arm/Makefile.am
14+++ b/none/tests/arm/Makefile.am
15@@ -16,15 +16,16 @@ EXTRA_DIST = \
16 vcvt_fixed_float_VFP.vgtest \
17 vfp.stdout.exp vfp.stderr.exp vfp.vgtest
18
19+# For yocto:
20+# Only include tests that don't require Thumb.
21+# Only use CFLAGS passed in by the build system.
22+# Some tests may fail, but all tests must compile.
23 check_PROGRAMS = \
24 allexec \
25- intdiv \
26- ldrt \
27 ldrt_arm \
28 neon128 \
29 neon64 \
30 v6intARM \
31- v6intThumb \
32 v6media \
33 vcvt_fixed_float_VFP \
34 vfp
35@@ -34,32 +35,3 @@ AM_CXXFLAGS += @FLAG_M32@
36 AM_CCASFLAGS += @FLAG_M32@
37
38 allexec_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
39-
40-# These two are specific to their ARM/Thumb respectively and so we
41-# hardwire -marm/-mthumb. neon64 and neon128 are compilable on both,
42-# however, ask for them to be compiled on thumb, as that looks
43-# like that's going to be the more common use case. They also
44-# need special helping w.r.t -mfpu and -mfloat-abi, though.
45-# Also force -O0 since -O takes hundreds of MB of memory
46-# for v6intThumb.c.
47-v6intARM_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -marm
48-v6intThumb_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
49-
50-v6media_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 -mthumb
51-
52-vfp_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
53- -mfpu=neon \
54- -mthumb
55-
56-
57-neon128_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
58- -mfpu=neon \
59- -mthumb
60-
61-neon64_CFLAGS = $(AM_CFLAGS) -g -O0 -mcpu=cortex-a8 \
62- -mfpu=neon \
63- -mthumb
64-
65-intdiv_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a15 -mthumb
66-ldrt_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -mthumb
67-ldrt_arm_CFLAGS = $(AM_CFLAGS) -g -mcpu=cortex-a8 -marm
diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch b/meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch
new file mode 100644
index 0000000000..2a14e1852c
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch
@@ -0,0 +1,75 @@
1Remove test apps not building with ppc and PTEST
2
3For mpc8316-rdb in none/tests/ppc32, the oe compiler options are
4inconsistent with the imposed test compiler options generating errors
5as follows:
6test_isa_2_07_part1
7test_isa_2_07_part2
8test_tm
9test_touch_tm
10 : unrecognized command line option '-mhtm'
11
12jm-insns
13testVMX
14 : AltiVec not supported in this target
15
16For the following tests, their inline assembler is inconsistent with
17the ppce300c3 variant:
18round.c:393
19power5+_round.c:98
20 : impossible constraint in 'asm'
21
22For the following tests, with both mpc8316-rdb and with qemuppc bsp,
23the inline assember is inconsistent with the oe compiler machine
24tuning:
25In memcheck/tests/ppc32
26 power_ISA2_05.c:56
27In none/tests/ppc32
28 test_dfp1.c:85
29 test_dfp2.c:160
30 test_dfp3.c:157
31 test_dfp4.c:73
32 test_dfp5.c:73
33 : impossible constraint in 'asm'
34
35Upstream-Status: Pending
36
37Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
38
39diff --git a/memcheck/tests/ppc32/Makefile.am b/memcheck/tests/ppc32/Makefile.am
40index bd70eea..1436e8e 100644
41--- a/memcheck/tests/ppc32/Makefile.am
42+++ b/memcheck/tests/ppc32/Makefile.am
43@@ -7,8 +7,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
44 power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest \
45 power_ISA2_05.stdout.exp_Without_FPPO
46
47-check_PROGRAMS = \
48- power_ISA2_05
49+check_PROGRAMS =
50
51 power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
52 -I$(top_srcdir)/include @FLAG_M32@
53diff --git a/none/tests/ppc32/Makefile.am b/none/tests/ppc32/Makefile.am
54index 4f581b6..91ce7e7 100644
55--- a/none/tests/ppc32/Makefile.am
56+++ b/none/tests/ppc32/Makefile.am
57@@ -50,16 +50,8 @@ check_PROGRAMS = \
58 allexec \
59 bug129390-ppc32 \
60 bug139050-ppc32 \
61- ldstrev lsw jm-insns mftocrf mcrfs round test_fx test_gx \
62- testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp \
63- test_isa_2_06_part1 \
64- test_isa_2_06_part2 \
65- test_isa_2_06_part3 \
66- test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
67- test_isa_2_07_part1 \
68- test_isa_2_07_part2 \
69- test_tm \
70- test_touch_tm
71+ ldstrev lsw mftocrf mcrfs test_fx test_gx \
72+ twi tw xlc_dbl_u32 power6_bcmp
73
74 AM_CFLAGS += @FLAG_M32@
75 AM_CXXFLAGS += @FLAG_M32@
diff --git a/meta/recipes-devtools/valgrind/valgrind/run-ptest b/meta/recipes-devtools/valgrind/valgrind/run-ptest
new file mode 100755
index 0000000000..7d0584ada9
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -0,0 +1,11 @@
1#!/bin/bash
2# run-ptest - 'ptest' test infrastructure shell script that
3# wraps the valgrind regression script vg_regtest.
4# Must be run in the /usr/lib/valgrind/ptest directory.
5#
6# Dave Lerner <dave.lerner@windriver.com>
7###############################################################
8VALGRINDLIB=@libdir@/valgrind
9tests/vg_regtest --all \
10 --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
11 --yocto-ptest
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.9.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.9.0.bb
index 64da1a2808..163367c822 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.9.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.9.0.bb
@@ -16,6 +16,11 @@ SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
16 file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \ 16 file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
17 file://sepbuildfix.patch \ 17 file://sepbuildfix.patch \
18 file://glibc-2.19.patch \ 18 file://glibc-2.19.patch \
19 file://force-nostabs.patch \
20 file://remove-arm-variant-specific.patch \
21 file://remove-ppc-tests-failing-build.patch \
22 file://add-ptest.patch \
23 file://run-ptest \
19 " 24 "
20 25
21SRC_URI[md5sum] = "0947de8112f946b9ce64764af7be6df2" 26SRC_URI[md5sum] = "0947de8112f946b9ce64764af7be6df2"
@@ -24,7 +29,7 @@ SRC_URI[sha256sum] = "e6af71a06bc2534541b07743e1d58dc3caf744f38205ca3e5b5a0bdf37
24COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64).*-linux' 29COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64).*-linux'
25COMPATIBLE_HOST_armv7a = 'arm.*-linux' 30COMPATIBLE_HOST_armv7a = 'arm.*-linux'
26 31
27inherit autotools 32inherit autotools ptest
28 33
29EXTRA_OECONF = "--enable-tls --without-mpicc" 34EXTRA_OECONF = "--enable-tls --without-mpicc"
30EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpicc" 35EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpicc"
@@ -42,3 +47,52 @@ FILES_${PN}-dbg += "${libdir}/${PN}/*/.debug/*"
42# valgrind needs debug information for ld.so at runtime in order to 47# valgrind needs debug information for ld.so at runtime in order to
43# redirect functions like strlen. 48# redirect functions like strlen.
44RRECOMMENDS_${PN} += "${TCLIBC}-dbg" 49RRECOMMENDS_${PN} += "${TCLIBC}-dbg"
50
51RDEPENDS_${PN}-ptest += " sed perl eglibc-utils"
52
53do_compile_ptest() {
54 oe_runmake check
55}
56
57
58do_install_ptest() {
59 chmod +x ${B}/tests/vg_regtest
60
61 # The test application binaries are not automatically installed.
62 # Grab them from the build directory.
63 #
64 # The regression tests require scripts and data files that are not
65 # copied to the build directory. They must be copied from the
66 # source directory.
67 saved_dir=$PWD
68 for parent_dir in ${S} ${B} ; do
69 cd $parent_dir
70
71 # exclude shell or the package won't install
72 rm -rf none/tests/shell* 2>/dev/null
73
74 subdirs="tests cachegrind/tests callgrind/tests drd/tests helgrind/tests massif/tests memcheck/tests none/tests"
75
76 # Get the vg test scripts, filters, and expected files
77 for dir in $subdirs ; do
78 find $dir | cpio -pvdu ${D}${PTEST_PATH}
79 done
80 cd $saved_dir
81 done
82
83 # clean out build artifacts before building the rpm
84 find ${D}${PTEST_PATH} \
85 \( -name "Makefile*" \
86 -o -name "*.o" \
87 -o -name "*.c" \
88 -o -name "*.S" \
89 -o -name "*.h" \) \
90 -exec rm {} \;
91
92 # needed by massif tests
93 cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
94
95 # handle multilib
96 sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
97}
98