@@ -302,6 +302,7 @@ AC_CONFIG_FILES([Makefile
test/performance/Makefile
test/validation/Makefile
test/validation/common/Makefile
+ test/validation/pktio/Makefile
test/miscellaneous/Makefile
])
@@ -9,7 +9,6 @@ odp_init
odp_init_abort
odp_init_log
odp_packet
-odp_pktio
odp_pool
odp_queue
odp_random
@@ -25,16 +25,12 @@ EXECUTABLES = odp_buffer \
odp_thread \
odp_ver_abt_log_dbg
-COMPILE_ONLY = odp_pktio
-
-TESTSCRIPTS = odp_pktio_run
+TESTSCRIPTS = pktio/pktio_run
if test_vald
TESTS = $(EXECUTABLES) $(TESTSCRIPTS)
endif
-dist_bin_SCRIPTS = odp_pktio_run
-
bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
ODP_CU_COMMON=common/odp_cunit_common.c
@@ -58,9 +54,6 @@ dist_odp_shared_memory_SOURCES = odp_shared_memory.c
dist_odp_synchronizers_SOURCES = odp_synchronizers.c
dist_odp_time_SOURCES = odp_time.c
dist_odp_timer_SOURCES = odp_timer.c
-odp_pktio_LDADD = $(top_builddir)/test/validation/common/libcunit_common.a \
- $(LIB)/libodp.la
-dist_odp_pktio_SOURCES = odp_pktio.c
dist_odp_packet_SOURCES = odp_packet.c
dist_odp_pool_SOURCES = odp_pool.c
dist_odp_cpumask_SOURCES = odp_cpumask.c
@@ -69,4 +62,6 @@ odp_ver_abt_log_dbg_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/ver_abt_log_dbg
dist_odp_ver_abt_log_dbg_SOURCES = ver_abt_log_dbg/odp_system.c \
ver_abt_log_dbg/odp_errno.c \
ver_abt_log_dbg/odp_ver_abt_log_dbg.c
-SUBDIRS = common
+
+ODP_MODULES = pktio
+SUBDIRS = common $(ODP_MODULES)
new file mode 100644
@@ -0,0 +1,7 @@
+include $(top_srcdir)/test/Makefile.inc
+
+AM_CFLAGS += -I$(top_srcdir)/test/validation/common
+AM_LDFLAGS += -static
+
+LIBCUNIT_COMMON = $(top_builddir)/test/validation/common/libcunit_common.a
+LIBODP = $(LIB)/libodp.la
new file mode 100644
@@ -0,0 +1,2 @@
+libpktio.a
+pktio_main
new file mode 100644
@@ -0,0 +1,10 @@
+include ../Makefile.inc
+
+dist_bin_SCRIPTS = pktio_run
+
+noinst_LIBRARIES = libpktio.a
+libpktio_a_SOURCES = pktio.c
+
+bin_PROGRAMS = pktio_main
+dist_pktio_main_SOURCES = pktio_main.c
+pktio_main_LDADD = libpktio.a $(LIBCUNIT_COMMON) $(LIBODP)
similarity index 99%
rename from test/validation/odp_pktio.c
rename to test/validation/pktio/pktio.c
@@ -12,6 +12,7 @@
#include <odp_internal.h>
#include <stdlib.h>
+#include "pktio.h"
#define PKT_BUF_NUM 32
#define PKT_BUF_SIZE (9 * 1024)
@@ -706,13 +707,7 @@ static CU_SuiteInfo pktio_suites[] = {
CU_SUITE_INFO_NULL
};
-static int pktio_main(void)
+int pktio_main(void)
{
return odp_cunit_run(pktio_suites);
}
-
-/* the following main function will be separated when lib is created */
-int main(void)
-{
- return pktio_main();
-}
new file mode 100644
@@ -0,0 +1,7 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+int pktio_main(void);
new file mode 100644
@@ -0,0 +1,12 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "pktio.h"
+
+int main(void)
+{
+ return pktio_main();
+}
similarity index 85%
rename from test/validation/odp_pktio_run
rename to test/validation/pktio/pktio_run
@@ -11,14 +11,14 @@
# If TEST_DIR is not set it means we are not running with make, and in this case
# there are two situations:
# 1. user build ODP in the same dir as the source (most likely)
-# here the user can simply call odp_pktio_run
+# here the user can simply call pktio_run
# 2. user may have built ODP in a separate build dir (like bitbake usually does)
-# here the user has to do something like $ODP/test/validation/odp_pktio_run
+# here the user has to do something like $ODP/test/validation/pktio_run
#
# In both situations the script assumes that the user is in the directory where
-# odp_pktio exists. If that's not true, then the user has to specify the path
+# pktio_main exists. If that's not true, then the user has to specify the path
# to it and run:
-# TEST_DIR=$builddir $ODP/test/validation/odp_pktio_run
+# TEST_DIR=$builddir $ODP/test/validation/pktio_run
# directory where test binaries have been built
TEST_DIR="${TEST_DIR:-$PWD}"
@@ -37,8 +37,8 @@ elif [ "$ODP_PLATFORM" = "" ]; then
echo "$0: error: ODP_PLATFORM must be defined"
# not skipped as this should never happen via "make check"
exit 1
-elif [ -f ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env ]; then
- . ${TEST_SRC_DIR}/../../platform/$ODP_PLATFORM/test/pktio_env
+elif [ -f ${TEST_SRC_DIR}/../../../platform/$ODP_PLATFORM/test/pktio_env ]; then
+ . ${TEST_SRC_DIR}/../../../platform/$ODP_PLATFORM/test/pktio_env
else
echo "BUG: unable to find pktio_env!"
echo "pktio_env has to be in current directory or in platform/\$ODP_PLATFORM/test."
@@ -61,7 +61,7 @@ run_test()
if [ "$disabletype" != "SKIP" ]; then
export ODP_PKTIO_DISABLE_SOCKET_${distype}=y
fi
- odp_pktio
+ ${TEST_DIR}/pktio/pktio_main
if [ $? -ne 0 ]; then
ret=1
fi
@@ -78,7 +78,7 @@ run()
{
if [ "$ODP_PLATFORM" != "linux-generic" -o "$(id -u)" != "0" ]; then
echo "pktio: using 'loop' device"
- odp_pktio
+ ${TEST_DIR}/pktio/pktio_main
exit $?
fi