aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols/freediameter/files/0001-tests-use-EXTENSIONS_DIR.patch
blob: 4cedc21ce8180eb5a022d410e923ef4979245a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From 935fcac46e2790e0e297ca855b8033895c1b8941 Mon Sep 17 00:00:00 2001
From: Mingli Yu <mingli.yu@windriver.com>
Date: Wed, 24 Aug 2022 13:45:32 +0800
Subject: [PATCH] tests: use EXTENSIONS_DIR

Use EXTENSIONS_DIR to replace BUILD_DIR as the BUILD_DIR is meanlingless
on target and also fix buildpaths issue.

Upstream-Status: Inappropriate [OE ptest specific]

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 tests/CMakeLists.txt    |  1 +
 tests/testloadext.c     | 12 ++++++------
 tests/testmesg_stress.c | 12 ++++++------
 3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8b698ce..2c83cbb 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -37,6 +37,7 @@ SET(TEST_LIST
 
 ADD_DEFINITIONS(-DTEST_DEBUG)
 ADD_DEFINITIONS(-DBUILD_DIR="${CMAKE_BINARY_DIR}")
+ADD_DEFINITIONS(-DEXTENSIONS_DIR="${EXTENSIONS_DIR}")
 
 INCLUDE_DIRECTORIES( "../libfdproto" )
 INCLUDE_DIRECTORIES( "../libfdcore" )
diff --git a/tests/testloadext.c b/tests/testloadext.c
index 452737f..3fffef5 100644
--- a/tests/testloadext.c
+++ b/tests/testloadext.c
@@ -35,9 +35,9 @@
 
 #include "tests.h"
 
-#ifndef BUILD_DIR
-#error "Missing BUILD_DIR information"
-#endif /* BUILD_DIR */
+#ifndef EXTENSIONS_DIR
+#error "Missing EXTENSIONS_DIR information"
+#endif /* EXTENSIONS_DIR */
 
 #include <sys/types.h>
 #include <dirent.h>
@@ -59,9 +59,9 @@ int main(int argc, char *argv[])
 	CHECK( 0, fd_rtdisp_init()  );
 	
 	/* Find all extensions which have been compiled along the test */
-	TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
+	TRACE_DEBUG(INFO, "Loading from: '%s'", EXTENSIONS_DIR);
+	CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 );
+	pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/");
 	
 	while ((dp = readdir (dir)) != NULL) {
 		char * dot = strrchr(dp->d_name, '.');
diff --git a/tests/testmesg_stress.c b/tests/testmesg_stress.c
index 310a9d2..97dfe07 100644
--- a/tests/testmesg_stress.c
+++ b/tests/testmesg_stress.c
@@ -38,9 +38,9 @@
 #include <libgen.h>
 #include <dlfcn.h>
 
-#ifndef BUILD_DIR
-#error "Missing BUILD_DIR information"
-#endif /* BUILD_DIR */
+#ifndef EXTENSIONS_DIR
+#error "Missing EXTENSIONS_DIR information"
+#endif /* EXTENSIONS_DIR */
 
 
 /* The number of times each operation is repeated to measure the average operation time */
@@ -73,9 +73,9 @@ static void load_all_extensions(char * prefix)
 	struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
 
 	/* Find all extensions which have been compiled along the test */
-	LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
-	CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
-	pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
+	LOG_D("Loading %s*.fdx from: '%s'", EXTENSIONS_DIR, prefix ?: "");
+	CHECK( 0, (dir = opendir (EXTENSIONS_DIR)) == NULL ? 1 : 0 );
+	pathlen = snprintf(fullname, sizeof(fullname), EXTENSIONS_DIR "/");
 	
 	while ((dp = readdir (dir)) != NULL) {
 		char * dot = strrchr(dp->d_name, '.');
-- 
2.25.1