summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch')
-rw-r--r--meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch113
1 files changed, 113 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch
new file mode 100644
index 000000000..e47882c9f
--- /dev/null
+++ b/meta-oe/recipes-kernel/oprofile/oprofile/0009-Prevent-running-check-tests-on-host-if-cross-compili.patch
@@ -0,0 +1,113 @@
1From 3a942cfd7d2e92667313e189930f7d1733cf40d4 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 18 Mar 2021 00:59:20 -0700
4Subject: [PATCH 09/10] Prevent running check tests on host if cross compiling
5
6This patch enables running the 'make check' tests on the target
7in a cross-compiled environment. If not cross-compiling, then 'make
8 check' builds and executes the tests; no change from this patch.
9In a cross-compiling environment, the make variable CROSS_COMPILE is
10set which bypasses assiging tests to the makekfile variable TESTS.
11Since TESTS is empty, the 'make check' process never tries to run the
12tests on the hosts. On the target, the tests must be run manually.
13
14Also, in the libutil++ tests, a makefile variable SRCDIR is passed into
15the compilation phase, pointing to the runtime location of the test
16'file-manip-tests'. The mechanism used for a host test, based on
17'topdir' doesn't work. Instead, if CROSS_COMPILE is set, the
18makefile takes the path of SRCDIR from the build environment and not
19from an expression based on the host path 'topdir'.
20
21Upstream-Status: Pending
22
23Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
24Signed-off-by: Khem Raj <raj.khem@gmail.com>
25---
26 configure.ac | 1 +
27 libdb/tests/Makefile.am | 2 ++
28 libop/tests/Makefile.am | 2 ++
29 libregex/tests/Makefile.am | 2 ++
30 libutil++/tests/Makefile.am | 4 ++++
31 libutil/tests/Makefile.am | 2 ++
32 6 files changed, 13 insertions(+)
33
34diff --git a/configure.ac b/configure.ac
35index 520b18ed..108a84e4 100644
36--- a/configure.ac
37+++ b/configure.ac
38@@ -386,6 +386,7 @@ AC_ARG_ENABLE(account-check,
39 enable_account_check=$enableval, enable_account_check=yes)
40
41 AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes")
42+AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes")
43
44 AC_SUBST(OP_CFLAGS)
45 AC_SUBST(OP_CXXFLAGS)
46diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
47index 8a69003f..c933baf6 100644
48--- a/libdb/tests/Makefile.am
49+++ b/libdb/tests/Makefile.am
50@@ -13,4 +13,6 @@ check_PROGRAMS = db_test
51 db_test_SOURCES = db_test.c
52 db_test_LDADD = ../libodb.a ../../libutil/libutil.a
53
54+if ! CROSS_COMPILE
55 TESTS = ${check_PROGRAMS}
56+endif
57diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
58index 8a79eb5d..6b90e997 100644
59--- a/libop/tests/Makefile.am
60+++ b/libop/tests/Makefile.am
61@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS}
62 mangle_tests_SOURCES = mangle_tests.c
63 mangle_tests_LDADD = ${COMMON_LIBS}
64
65+if ! CROSS_COMPILE
66 TESTS = ${check_PROGRAMS} utf8_checker.sh
67+endif
68diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
69index 6f19838f..43e84946 100644
70--- a/libregex/tests/Makefile.am
71+++ b/libregex/tests/Makefile.am
72@@ -18,4 +18,6 @@ java_test_LDADD = \
73
74 EXTRA_DIST = mangled-name.in
75
76+if ! CROSS_COMPILE
77 TESTS = ${check_PROGRAMS}
78+endif
79diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
80index 51af0313..dd63fbe2 100644
81--- a/libutil++/tests/Makefile.am
82+++ b/libutil++/tests/Makefile.am
83@@ -1,7 +1,9 @@
84
85 REALPATH= readlink -f
86
87+if ! CROSS_COMPILE
88 SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
89+endif
90
91 AM_CPPFLAGS = \
92 -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@
93@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS}
94 utility_tests_SOURCES = utility_tests.cpp
95 utility_tests_LDADD = ${COMMON_LIBS}
96
97+if ! CROSS_COMPILE
98 TESTS = ${check_PROGRAMS}
99+endif
100diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
101index dfcd6eca..d8b51892 100644
102--- a/libutil/tests/Makefile.am
103+++ b/libutil/tests/Makefile.am
104@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a
105 string_tests_SOURCES = string_tests.c
106 string_tests_LDADD = ../libutil.a
107
108+if ! CROSS_COMPILE
109 TESTS = ${check_PROGRAMS}
110+endif
111--
1122.31.0
113