aboutsummaryrefslogtreecommitdiffstats
path: root/test/gtest/main.cpp
diff options
context:
space:
mode:
authorKopec, TomaszX <tomaszx.kopec@intel.com>2017-03-06 14:42:26 +0100
committerMohammad Abdul Awal <mohammad.abdul.awal@intel.com>2017-05-09 18:34:40 +0100
commit68f21c315fccc74ee6bec7e3b19da253d2afbf60 (patch)
treec03999343c0cd3c15b1c60a1e638a31cf7fe1581 /test/gtest/main.cpp
parent21e7392fca2c430018cf387bb3e368ea4c665446 (diff)
tldk_test: added copy command to makefile to make test_scapy_gen.py visible
Change-Id: Iedad6db1808a20d0bd00b9d23f489dffd3ef0a4b Signed-off-by: Kopec, TomaszX <tomaszx.kopec@intel.com> Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Diffstat (limited to 'test/gtest/main.cpp')
-rw-r--r--test/gtest/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/gtest/main.cpp b/test/gtest/main.cpp
index 17cdccd..53dcf78 100644
--- a/test/gtest/main.cpp
+++ b/test/gtest/main.cpp
@@ -28,12 +28,14 @@
#include "test_common.h"
struct rte_mempool *mbuf_pool;
+char binpath[PATH_MAX];
int
main(int argc, char *argv[])
{
uint8_t nb_ports = 1;
int rc = 0;
+ char *slash;
/* Initialize GoogleTest&Mock and parse any args */
testing::InitGoogleMock(&argc, argv);
@@ -44,6 +46,13 @@ main(int argc, char *argv[])
argc -= ret;
argv += ret;
+ /* get the path of binary and save in a global variable to be used later*/
+ realpath(argv[0], binpath);
+ slash = NULL;
+ slash = strrchr(binpath, '/');
+ if (strcmp(binpath, "") != 0 && slash != NULL)
+ binpath[slash - binpath] = 0;
+
/*
* Creates a new mempool in memory to hold the mbufs.
* Multiplied by 2 because of mempeool to be used for packet