aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Uvarov <maxim.uvarov@linaro.org>2015-08-11 16:36:34 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-08-11 16:36:34 +0300
commitd8b3ffe6552ef72f6d6dd4ff35ef541c2c5d1393 (patch)
treea57471d538b7629e095b7066c4ce019f57ee3ea6
parent1a7daf45862ab3a8785b9f5e6d6950eff6637c63 (diff)
parent4450e0a0e9f6ac7f63e6b30b94f456386e07011b (diff)
Merge branch 'master' into api-next
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Conflicts: example/timer/odp_timer_test.c
-rw-r--r--DEPENDENCIES14
-rw-r--r--README5
-rw-r--r--configure.ac56
-rw-r--r--doc/Makefile.am6
-rw-r--r--doc/doxygen.cfg2
-rw-r--r--doc/implementers-guide/Makefile.am10
-rw-r--r--doc/implementers-guide/implementers-guide.adoc211
-rw-r--r--doc/odp.dox4
-rw-r--r--example/classifier/odp_classifier.c18
-rw-r--r--example/generator/odp_generator.c14
-rw-r--r--example/timer/odp_timer_test.c45
-rw-r--r--helper/Makefile.am3
-rw-r--r--platform/linux-generic/Makefile.am7
-rw-r--r--platform/linux-generic/arch/linux/odp_time_cycles.c (renamed from platform/linux-generic/arch/linux/odp_time.c)0
-rw-r--r--platform/linux-generic/arch/mips64/odp_time_cycles.c (renamed from platform/linux-generic/arch/mips64/odp_time.c)0
-rw-r--r--platform/linux-generic/arch/x86/odp_time_cycles.c (renamed from platform/linux-generic/arch/x86/odp_time.c)0
-rw-r--r--platform/linux-generic/m4/configure.m47
-rw-r--r--platform/linux-generic/m4/odp_openssl.m432
-rw-r--r--platform/linux-generic/m4/odp_pthread.m413
-rw-r--r--scripts/Makefile.am2
-rw-r--r--test/Makefile.inc5
-rw-r--r--test/performance/odp_l2fwd.c9
-rw-r--r--test/performance/odp_pktio_perf.c12
-rw-r--r--test/validation/Makefile.inc5
-rw-r--r--test/validation/buffer/buffer.c14
-rw-r--r--test/validation/buffer/buffer.h18
-rw-r--r--test/validation/classification/classification.c2
-rw-r--r--test/validation/classification/classification.h31
-rw-r--r--test/validation/classification/odp_classification_basic.c17
-rw-r--r--test/validation/classification/odp_classification_tests.c13
-rw-r--r--test/validation/cpumask/cpumask.c12
-rw-r--r--test/validation/cpumask/cpumask.h16
-rw-r--r--test/validation/crypto/crypto.c6
-rw-r--r--test/validation/crypto/crypto.h24
-rw-r--r--test/validation/crypto/odp_crypto_test_inp.c11
-rw-r--r--test/validation/errno/errno.c3
-rw-r--r--test/validation/errno/errno.h12
-rw-r--r--test/validation/init/init.c18
-rw-r--r--test/validation/init/init.h18
-rw-r--r--test/validation/packet/packet.c44
-rw-r--r--test/validation/packet/packet.h33
-rw-r--r--test/validation/pktio/pktio.c32
-rw-r--r--test/validation/pktio/pktio.h27
-rw-r--r--test/validation/pool/pool.c12
-rw-r--r--test/validation/pool/pool.h16
-rw-r--r--test/validation/queue/queue.c10
-rw-r--r--test/validation/queue/queue.h16
-rw-r--r--test/validation/random/random.c6
-rw-r--r--test/validation/random/random.h12
-rw-r--r--test/validation/scheduler/scheduler.c68
-rw-r--r--test/validation/scheduler/scheduler.h45
-rw-r--r--test/validation/shmem/shmem.c6
-rw-r--r--test/validation/shmem/shmem.h12
-rw-r--r--test/validation/synchronizers/synchronizers.c52
-rw-r--r--test/validation/synchronizers/synchronizers.h35
-rw-r--r--test/validation/system/system.c18
-rw-r--r--test/validation/system/system.h18
-rw-r--r--test/validation/thread/thread.c14
-rw-r--r--test/validation/thread/thread.h21
-rw-r--r--test/validation/time/time.c8
-rw-r--r--test/validation/time/time.h14
-rw-r--r--test/validation/timer/timer.c12
-rw-r--r--test/validation/timer/timer.h15
63 files changed, 981 insertions, 260 deletions
diff --git a/DEPENDENCIES b/DEPENDENCIES
index e2052bb..852beeb 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -111,14 +111,24 @@ Prerequisites for building the OpenDataPlane (ODP) API
5.0 Documentation & Doxygen
+5.1 API Guide
See http://www.stack.nl/~dimitri/doxygen/manual/install.html
The tested version of doxygen is 1.8.8
-5.1 HTML
+5.1.1 HTML
# Debian/Ubuntu
$ apt-get install doxygen graphviz
-5.2 PDF
+5.1.2 PDF
# Debian/Ubuntu
$ apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
+
+5.2 User guides
+
+5.2.1 HTML
+ # Ubuntu
+ $ apt-get install asciidoc
+
+ # Debian
+ $ apt-get install asciidoc source-highlight
diff --git a/README b/README
index ccdbed6..cad5138 100644
--- a/README
+++ b/README
@@ -29,6 +29,11 @@ Main git repository:
./configure --enable-test-perf --enable-test-vald
make check
+ To generate the users guides:
+ ./bootstrap
+ ./configure --enable-user-guide
+ make
+
Patches tracking system:
http://patches.opendataplane.org/project/lng-odp/list/
diff --git a/configure.ac b/configure.ac
index 24a3fa1..15dc6cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,8 +153,6 @@ AC_ARG_ENABLE([test-helper],
AM_CONDITIONAL([test_helper], [test x$test_helper = xyes ])
##########################################################################
-
-##########################################################################
# Enable/disable test-cpp
##########################################################################
test_cpp=no
@@ -202,18 +200,6 @@ AC_ARG_ENABLE([debug],
ODP_CFLAGS="$ODP_CFLAGS -DODP_DEBUG=$ODP_DEBUG"
##########################################################################
-# Check for pthreads availability
-##########################################################################
-
-AX_PTHREAD([CC="$PTHREAD_CC"], [
- echo "Error! We require pthreads to be available"
- exit -1
- ])
-LIBS="$PTHREAD_LIBS $LIBS"
-AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
-AM_LDFLAGS="$AM_LDFLAGS $PTHREAD_LDFLAGS"
-
-##########################################################################
# Check for doxygen availability
##########################################################################
AC_CHECK_PROGS([DOXYGEN], [doxygen])
@@ -224,15 +210,28 @@ fi
AM_CONDITIONAL([HAVE_DOXYGEN], [test "x${DOXYGEN}" = "xdoxygen"])
##########################################################################
-# Set optional OpenSSL path
+# Check for asciidoc availability
##########################################################################
-AC_ARG_WITH([openssl-path],
-AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers],
- [(or in the default path if not specified).]),
- [OPENSSL_PATH=$withval
- AM_CPPFLAGS="$AM_CPPFLAGS -I$OPENSSL_PATH/include"
- AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib"
- ],[])
+AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
+if test -z "$ASCIIDOC";
+ then AC_MSG_WARN([asciidoc not found - continuing without asciidoc support])
+fi
+
+##########################################################################
+# Enable/disable user guide generation
+##########################################################################
+user_guides=no
+AC_ARG_ENABLE([user-guides],
+ [ --enable-user-guides generate supplemental users guides],
+ [if test "x$enableval" = "xyes"; then
+ if test -z "$ASCIIDOC";
+ then AC_MSG_ERROR([cannot generate user guides without asciidoc])
+ else
+ user_guides=yes
+ fi
+ fi])
+
+AM_CONDITIONAL([user_guide], [test "x${user_guides}" = "xyes" ])
##########################################################################
# Save and set temporary compilation flags
@@ -258,14 +257,6 @@ fi
AM_CONDITIONAL([cunit_support], [test x$cunit_support = xyes ])
##########################################################################
-# Check for OpenSSL availability
-##########################################################################
-AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
- [AC_MSG_FAILURE([OpenSSL libraries required])])
-AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
- [AC_MSG_ERROR([OpenSSL headers required])])
-
-##########################################################################
# Restore old saved variables
##########################################################################
LDFLAGS=$OLD_LDFLAGS
@@ -288,6 +279,7 @@ AM_CXXFLAGS="-std=c++11"
AC_CONFIG_FILES([Makefile
doc/Makefile
+ doc/implementers-guide/Makefile
example/Makefile
example/classifier/Makefile
example/generator/Makefile
@@ -298,8 +290,6 @@ AC_CONFIG_FILES([Makefile
helper/test/Makefile
pkgconfig/libodp.pc
pkgconfig/libodphelper.pc
- platform/linux-generic/Makefile
- platform/linux-generic/test/pktio/Makefile
scripts/Makefile
test/Makefile
test/api_test/Makefile
@@ -332,8 +322,6 @@ AC_SEARCH_LIBS([timer_create],[rt posix4])
##########################################################################
# distribute the changed variables among the Makefiles
-AM_LDFLAGS="$AM_LDFLAGS -pthread -lrt"
-
AC_SUBST([LIBS])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([CPPFLAGS])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d2f123a..73bd8e2 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,6 +1,8 @@
if HAVE_DOXYGEN
-
-
clean-local:
rm -rf output
endif
+
+if user_guide
+SUBDIRS = implementers-guide
+endif
diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg
index 213a903..f28ec24 100644
--- a/doc/doxygen.cfg
+++ b/doc/doxygen.cfg
@@ -28,7 +28,7 @@ CLASS_DIAGRAMS = NO
HAVE_DOT = YES
CALL_GRAPH = YES
DOT_MULTI_TARGETS = NO
-EXAMPLE_PATH = $(SRCDIR)/example $(SRCDIR)/platform
+EXAMPLE_PATH = $(SRCDIR)/example $(SRCDIR)/platform $(SRCDIR)
EXAMPLE_PATTERNS = *.c
EXAMPLE_RECURSIVE = YES
IMAGE_PATH = $(SRCDIR)/doc/images
diff --git a/doc/implementers-guide/Makefile.am b/doc/implementers-guide/Makefile.am
new file mode 100644
index 0000000..25437d3
--- /dev/null
+++ b/doc/implementers-guide/Makefile.am
@@ -0,0 +1,10 @@
+TARGET = $(top_srcdir)/doc/output/implementers-guide.html
+
+all-local: $(TARGET)
+
+$(TARGET): implementers-guide.adoc
+ @mkdir -p $(top_srcdir)/doc/output
+ asciidoc --out-file=$@ $<
+
+clean-local:
+ rm -f $(TARGET)
diff --git a/doc/implementers-guide/implementers-guide.adoc b/doc/implementers-guide/implementers-guide.adoc
new file mode 100644
index 0000000..56d6e05
--- /dev/null
+++ b/doc/implementers-guide/implementers-guide.adoc
@@ -0,0 +1,211 @@
+OpenDataPlane (ODP) Implementers-Guide
+=======================================
+:toc:
+
+:numbered!:
+[abstract]
+Abstract
+--------
+This document is intended to guide a new ODP developer.
+Further details about ODP may be found at http://opendataplane.org[ODP homepage]
+
+
+:numbered:
+The validation Suite
+--------------------
+ODP provides a comprehensive set of API validation tests that are intended to be used by implementers during development and by application developers to verify that a particular implementation meets their requirements.
+
+The list of these tests is expected to grow as ODP grows.
+
+The list of test executables is run by the automake test harness, when running "make check".
+Therefore, as required by this harness, each executable should return 0 on success (tests passed), 77 on inconclusive, or any other values on failure.
+The automake functionality shows a status line (PASSED/FAIL...) for each of the ran test executables.
+
+It is expected that ODP developers will need to run tests as early as possible in the development cycle, before all APIs have been implemented.
+Besides, although there are no APIs that are formally listed as optional, it is also expected that there may be cases where a subset of APIs remain unimplemented on a particular platform.
+Moreover, some platforms may require specific initialization/termination code prior/after running the standard tests.
+
+To accommodate with these platform disparities, the ODP validation has been divided in two distinct areas:
+
+* The platform agnostic area,
+* A platform dependent area (one per platform).
+
+Platform agnostic
+~~~~~~~~~~~~~~~~~
+This grouping defines tests that are expected to be executable and succeed on any platform, though possibly with very different performances, depending on the underlying platform.
+They are written in plain C code, and may only use functions defined in the standard libC library (besides the ODP functions being tested, of course).
+No other languages (like scripting) are allowed as their usage would make assumptions on the platform capability.
+
+This area is located at: '<ODP_ROOT>/test/validation/'
+
+The ODP API itself is ordered by module, where each module groups the set of ODP API functions related to the same "topic".
+Examples of modules includes "classification" (API functions dealing with ingres packets classification), time (functions dealing with time, excluding timers which have their own module), timer,...
+The complete module list can be seen at: http://docs.opendataplane.org/linux-generic-doxygen-html/modules.html[ODP Modules] +
+Within the platform agnostic area, the tests are also grouped by modules, matching the ODP API modules: '<ODP_ROOT>/test/validation/' mainly contains a list of directories matching each module name (as defined by the doxygen "@defgroup" or "@ingroup" statement present in each API ".h" file).
+
+Within each of these directories, a library (called "lib<module>.la") and its associated ".h" file (called "<module>.h") defines all the test functions for this module as well as few other functions to initialize, terminate, and group the tests.
+An executable called "<module>_main*", is also built. It is permissible to generate more than one executable to cover the functionality in the test library for the module.
+These executable(s) shall call all the tests for this module. +
+See <<anchor-1, Module test and naming convention>> for more details.
+
+It is important to be aware that the tests defined for a given module (defined in 'test/validation/<module>') are focused to test the ODP functions belonging to this module, but are not limited to use this module's ODP functions only: many modules needs some interaction with some other module to be tested.
+The obvious illustration of this is for module "init" whose functions are required by all tests of all other modules (as ODP needs to be initialized to test anything else). +
+
+There is a "Makefile.am" located at the top of the platform agnostic area. Its role is limited to the construction of the different test libraries and the "<module>_main*" executables. No tests are run from this area when "make check" is performed.
+
+A convenience library '.../test/validation/libodptests.la' (and its associated .h file, '.../test/validation/odptest.h') regrouping all tests symbols of all modules may be built in the future. (The superlib)
+
+C_UNIT
+^^^^^^
+Within a given test executable C_UNIT is used to run the different tests. The usage of C_UNIT implies the following structure:
+
+* Tests are simple C functions.
+* Tests are grouped in arrays called test suites. Each test suite can be associated with a suite initialization/termination function(s), called by C_UNIT before and after the whole suite is ran.
+* An array of test suites (and associated init/term functions) defines the test registry ran by the test executable.
+
+Moreover, two extra functions can be used to initialize/terminate the test executable (these are not part of C_UNIT). +
+A test executable return success (0) if every tests of each suite succeed.
+
+More details about http://cunit.sourceforge.net/doc/index.html[C_Unit users guide]
+
+[[anchor-1]]
+Module test and naming convention
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+* Tests, i.e. C functions which are used in CUNIT test suites are named:
+ *<Module>_test_+++*+++* +
+ where the suffix idendify the test.
+
+* Test arrays, i.e. arrays of CU_TestInfo, listing the test functions belonging to a suite, are called:
+ *<Module>_suite+++[_*]+++* +
+ where the possible suffix can be used if many suites are declared.
+
+* CUNIT suite init and termination functions are called:
+ *<Module>+++_suite[_*]_init()+++* and *<Module>+++_suite[_*]_term()+++* respectively. +
+ where the possible extra middle pattern can be used if many suites are declared.
+
+* Suite arrays, i.e. arrays of CU_SuiteInfo used in executables (C_UNIT registry) are called:
+ *<Module>+++_suites[_*]+++* +
+ where the possible suffix identifies the executable using it, if many.
+
+* Main executable function(s), are called:
+ *<Module>+++_main[_*]+++* +
+ where the possible suffix identifies the executable, if many, using it.
+
+* Init/term functions for the whole executable are called:
+ *<Module>_init*
+ *<Module>_term*
+
+All the above symbols are part of the generated lib<Module>.la libraries. The generated main executable(s) (named <module>_+++main[_*]+++, where the optional suffix is used to distinguish the executables belonging to the same module, if many) simply call(s) the related <Module>_main+++[_*]+++ from the library.
+
+Platform specific
+~~~~~~~~~~~~~~~~~
+These tests are located under '<ODP_ROOT>/platform/<platform>/test'. There is one such area for each platform implementing ODP.
+This location will be referred as <PLATFORM_SPECIFIC> in the rest of this document.
+
+The normal case
+^^^^^^^^^^^^^^^
+If the considered platform needs nothing specific to be tested this directory will contain a single "Makefile.am".
+This "Makefile.am" then only lists the executables to be run on "make check" (in the automake TEST variable): when the platform has nothing specific to it, this just list the "<module>_main+++[_*]+++" executables, picked from the platform agnostic area.
+For the linux-generic platform, most tested modules fall into this category: currently, the '<ODP_ROOT>/platform/linux-generic/test/Makefile.am' looks as follows:
+
+[source,am]
+----
+include $(top_srcdir)/test/Makefile.inc
+TESTS_ENVIRONMENT += TEST_DIR=${top_builddir}/test/validation
+
+ODP_MODULES = pktio
+
+if test_vald
+TESTS = pktio/pktio_run \
+ ${top_builddir}/test/validation/buffer/buffer_main$(EXEEXT) \
+ ${top_builddir}/test/validation/classification/classification_main$(EXEEXT) \
+ ${top_builddir}/test/validation/cpumask/cpumask_main$(EXEEXT) \
+ ${top_builddir}/test/validation/crypto/crypto_main$(EXEEXT) \
+ ${top_builddir}/test/validation/errno/errno_main$(EXEEXT) \
+ ${top_builddir}/test/validation/init/init_main_ok$(EXEEXT) \
+ ${top_builddir}/test/validation/init/init_main_abort$(EXEEXT) \
+ ${top_builddir}/test/validation/init/init_main_log$(EXEEXT) \
+ ${top_builddir}/test/validation/packet/packet_main$(EXEEXT) \
+ ${top_builddir}/test/validation/pool/pool_main$(EXEEXT) \
+ ${top_builddir}/test/validation/queue/queue_main$(EXEEXT) \
+ ${top_builddir}/test/validation/random/random_main$(EXEEXT) \
+ ${top_builddir}/test/validation/scheduler/scheduler_main$(EXEEXT) \
+ ${top_builddir}/test/validation/synchronizers/synchronizers_main$(EXEEXT) \
+ ${top_builddir}/test/validation/thread/thread_main$(EXEEXT) \
+ ${top_builddir}/test/validation/time/time_main$(EXEEXT) \
+ ${top_builddir}/test/validation/timer/timer_main$(EXEEXT) \
+ ${top_builddir}/test/validation/shmem/shmem_main$(EXEEXT) \
+ ${top_builddir}/test/validation/system/system_main$(EXEEXT)
+
+SUBDIRS = $(ODP_MODULES)
+endif
+
+----
+
+With the exception for module pktio, all other modules testing just involves calling the platform agnostic <module>_main executables (in test/validation).
+
+When no platform specific testing is required, the '<PLATFORM_SPECIFIC>/Makefile.am' is used to list the tests executables to be run only, as these tests are actually built from the platform agnostic side by the 'test/validation/Makefile.am' (and subdirectories). '<PLATFORM_SPECIFIC>/Makefile.am' is involved in building only when platform specific tests exists, as discussed below.
+
+Using other languages
+^^^^^^^^^^^^^^^^^^^^^
+The pktio module, above, is actually tested using a bash script. This script is needed to set up the interfaces used by the tests. The pktio_run script actually eventually calls the platform agnostic 'test/validation/pktio/pktio_main' after setting up the interfaces needed by the tests.
+Notice that the path to the script is '<PLATFORM_SPECIFIC>/pktio/pktio_run', i.e. it is private to this platform. Any languages supported by the tested platform can be used there, as it will not impact other platforms.
+The platform "private" executables (such as this script), of course, must also return one of the return code expected by the automake test harness (0 for success, 77 for inconclusive, other values for errors).
+
+Defining test wrappers
+^^^^^^^^^^^^^^^^^^^^^^
+The pktio case above is actually using a script as wrapper around the "standard" (platform independent) test executable. Wrappers can also be defined by using the LOG_COMPILER variable of automake.
+This is applicable in cases where the same wrapper should be used for more then one test, as the test name is passed has parameter to the wrapper. A wrapper is just a program expecting one argument: the test name.
+
+Automake also supports the usage different wrappers based of the executable filename suffix. See https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html[Parallel-Test-Harness] for more information.
+
+To add a wrapper around the executed test, just add the following LOG_COMPILER definition line in the '<PLATFORM_SPECIFIC>/Makefile.am':
+
+[source,am]
+----
+...
+if test_vald
+LOG_COMPILER = $(top_srcdir)/platform/linux-generic/test/wrapper-script
+TESTS = pktio/pktio_run \
+...
+----
+
+Here follows a dummy example of what wrapper-script could be:
+
+[source,bash]
+----
+#!/bin/bash
+
+# The parameter, $1, is the name of the test executable to run
+echo "WRAPPER!!!"
+echo "running $1!"
+
+# run the test:
+$1
+# remember the test result:
+res=$?
+
+echo "Do something to clean up the mess here :-)"
+# return the test result.
+exit $res
+----
+
+Note how the above script stores the return code of the test executable to return it properly to the automake test harness.
+
+Defining platform specific tests
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Sometimes, it may be necessary to call platform specific system calls to check some functionality: For instance, testing odp_cpumask_* could involve checking the underlying system CPU mask. On linux, such a test would require using the CPU_ISSET macro, which is linux specific. Such a test would be written in '<PLATFORM_SPECIFIC>/cpumask/...' The contents of this directory would be very similar to the contents of the platform agnostic side cpu_mask tests (including a Makefile.am...), but platform specific test would be written there.
+'<PLATFORM_SPECIFIC>/Makefile.am' would then trigger the building of the platform specific tests (by listing their module name in SUBDIRS and therefore calling the appropriate Makefile.am) and then it would call both the platform agnostic executable(s) and the platform specific test executable.
+
+Skipping tests during development
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+During ODP development, it may be useful to skip some test. This can be achieved by creating a new test executable (still on the platform side), picking up the required tests from the platform agnostic lib<module>.la.
+
+The top Makefile would then call only the platform specific executable, hence skipping the tests which have been omitted.
+
+TIP: You probably want to copy the platform-agnostic module main function and prune it from the undesired tests when writing your own platform specific main, for a given module.
+
+Permanently skipping test
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+If a platform wants to permanently skip a test (i.e. a part of the ODP API is and will not be supported on that platform), it is recommended to use the function odp_cunit_TBD() to removed the tests or suite from the list of tests. This gives a chance to the test environment to trace this removal.
diff --git a/doc/odp.dox b/doc/odp.dox
index 0a3bc73..0bff5ad 100644
--- a/doc/odp.dox
+++ b/doc/odp.dox
@@ -41,3 +41,7 @@
* - Bug tracking is https://bugs.linaro.org/buglist.cgi?product=OpenDataPlane
*
*/
+
+/**@page contributing Contributing Guide Lines
+ * @verbinclude CONTRIBUTING
+ */
diff --git a/example/classifier/odp_classifier.c b/example/classifier/odp_classifier.c
index 3a16279..ac204af 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -122,7 +122,7 @@ void print_cls_statistics(appl_args_t *args)
printf("-");
printf("\n");
for (i = 0; i < args->policy_count; i++)
- printf("%s\t", args->stats[i].queue_name);
+ printf("%-12s ", args->stats[i].queue_name);
printf("Total Packets");
printf("\n");
@@ -135,17 +135,19 @@ void print_cls_statistics(appl_args_t *args)
for (; timeout > 0 || infinite; timeout--) {
for (i = 0; i < args->policy_count; i++)
- printf("%"PRIu64"\t",
+ printf("%-12" PRIu64 " ",
odp_atomic_load_u64(&args->stats[i]
.packet_count));
- printf("\t%"PRIu64"\t", odp_atomic_load_u64(&args->
- total_packets));
+ printf("%-" PRIu64, odp_atomic_load_u64(&args->
+ total_packets));
sleep(1);
printf("\r");
fflush(stdout);
}
+
+ printf("\n");
}
static inline
@@ -608,10 +610,12 @@ static int parse_pmr_policy(appl_args_t *appl_args, char *argv[], char *optarg)
switch (term) {
case ODP_PMR_SIP_ADDR:
token = strtok(NULL, ":");
- strncpy(stats[policy_count].value, token, DISPLAY_STRING_LEN);
+ strncpy(stats[policy_count].value, token,
+ DISPLAY_STRING_LEN - 1);
parse_ipv4_addr(token, &stats[policy_count].rule.val);
token = strtok(NULL, ":");
- strncpy(stats[policy_count].mask, token, DISPLAY_STRING_LEN);
+ strncpy(stats[policy_count].mask, token,
+ DISPLAY_STRING_LEN - 1);
parse_ipv4_mask(token, &stats[policy_count].rule.mask);
stats[policy_count].val_sz = 4;
break;
@@ -623,7 +627,7 @@ static int parse_pmr_policy(appl_args_t *appl_args, char *argv[], char *optarg)
/* Queue Name */
token = strtok(NULL, ":");
- strncpy(stats[policy_count].queue_name, token, ODP_QUEUE_NAME_LEN);
+ strncpy(stats[policy_count].queue_name, token, ODP_QUEUE_NAME_LEN - 1);
appl_args->policy_count++;
free(pmr_str);
return 0;
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 2c0aa76..35a6fa8 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -26,6 +26,7 @@
#define MAX_WORKERS 32 /**< max number of works */
#define SHM_PKT_POOL_SIZE (512*2048) /**< pkt pool size */
#define SHM_PKT_POOL_BUF_SIZE 1856 /**< pkt pool buf size */
+#define DEFAULT_PKT_INTERVAL 1000 /**< interval btw each pkt */
#define APPL_MODE_UDP 0 /**< UDP mode */
#define APPL_MODE_PING 1 /**< ping mode */
@@ -375,6 +376,7 @@ static odp_pktio_t create_pktio(const char *dev, odp_pool_t pool)
static void *gen_send_thread(void *arg)
{
int thr;
+ uint64_t start, now, diff;
odp_pktio_t pktio;
thread_args_t *thr_args;
odp_queue_t outq_def;
@@ -396,6 +398,7 @@ static void *gen_send_thread(void *arg)
return NULL;
}
+ start = odp_time_cycles();
printf(" [%02i] created mode: SEND\n", thr);
for (;;) {
int err;
@@ -436,6 +439,15 @@ static void *gen_send_thread(void *arg)
>= (unsigned int)args->appl.number) {
break;
}
+
+ now = odp_time_cycles();
+ diff = odp_time_diff_cycles(start, now);
+ if (odp_time_cycles_to_ns(diff) > 20 * ODP_TIME_SEC) {
+ start = odp_time_cycles();
+ printf(" [%02i] total send: %ju\n",
+ thr, odp_atomic_load_u64(&counters.seq));
+ fflush(stdout);
+ }
}
/* receive number of reply pks until timeout */
@@ -444,7 +456,7 @@ static void *gen_send_thread(void *arg)
if (odp_atomic_load_u64(&counters.icmp) >=
(unsigned int)args->appl.number)
break;
- millisleep(1000,
+ millisleep(DEFAULT_PKT_INTERVAL,
thr_args->tp,
thr_args->tim,
thr_args->tq,
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index 5d362ec..49630b0 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -21,6 +21,7 @@
#define MAX_WORKERS 32 /**< Max worker threads */
#define NUM_TMOS 10000 /**< Number of timers */
+#define WAIT_NUM 10 /**< Max tries to rx last tmo per worker */
/** Test arguments */
@@ -47,6 +48,7 @@ typedef struct {
odp_timer_pool_t tp; /**< Timer pool handle*/
odp_atomic_u32_t remain; /**< Number of timeouts to receive*/
struct test_timer tt[256]; /**< Array of all timer helper structs*/
+ uint32_t num_workers; /**< Number of threads */
} test_globals_t;
/** @private Timer set status ASCII strings */
@@ -87,6 +89,7 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls)
uint64_t tick;
struct test_timer *ttp;
odp_timeout_t tmo;
+ uint32_t num_workers = gbls->num_workers;
EXAMPLE_DBG(" [%i] test_timeouts\n", thr);
@@ -115,16 +118,19 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls)
ttp->ev = odp_timeout_to_event(tmo);
tick = odp_timer_current_tick(gbls->tp);
- while ((int)odp_atomic_load_u32(&gbls->remain) > 0) {
+ while (1) {
+ int wait = 0;
odp_event_t ev;
odp_timer_set_t rc;
- tick += period;
- rc = odp_timer_set_abs(ttp->tim, tick, &ttp->ev);
- if (odp_unlikely(rc != ODP_TIMER_SUCCESS)) {
- /* Too early or too late timeout requested */
- EXAMPLE_ABORT("odp_timer_set_abs() failed: %s\n",
- timerset2str(rc));
+ if (ttp) {
+ tick += period;
+ rc = odp_timer_set_abs(ttp->tim, tick, &ttp->ev);
+ if (odp_unlikely(rc != ODP_TIMER_SUCCESS)) {
+ /* Too early or too late timeout requested */
+ EXAMPLE_ABORT("odp_timer_set_abs() failed: %s\n",
+ timerset2str(rc));
+ }
}
/* Get the next expired timeout.
@@ -139,6 +145,9 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls)
ev = odp_schedule(&queue, sched_tmo);
/* Check if odp_schedule() timed out, possibly there
* are no remaining timeouts to receive */
+ if (++wait > WAIT_NUM &&
+ odp_atomic_load_u32(&gbls->remain) < num_workers)
+ EXAMPLE_ABORT("At least one TMO was lost\n");
} while (ev == ODP_EVENT_INVALID &&
(int)odp_atomic_load_u32(&gbls->remain) > 0);
@@ -161,18 +170,18 @@ static void test_abs_timeouts(int thr, test_globals_t *gbls)
}
EXAMPLE_DBG(" [%i] timeout, tick %"PRIu64"\n", thr, tick);
- odp_atomic_dec_u32(&gbls->remain);
- }
+ uint32_t rx_num = odp_atomic_fetch_dec_u32(&gbls->remain);
+
+ if (!rx_num)
+ EXAMPLE_ABORT("Unexpected timeout received (timer %x, tick %"PRIu64")\n",
+ ttp->tim, tick);
+ else if (rx_num > num_workers)
+ continue;
- /* Cancel and free last timer used */
- (void)odp_timer_cancel(ttp->tim, &ttp->ev);
- if (ttp->ev != ODP_EVENT_INVALID)
odp_event_free(ttp->ev);
- else
- EXAMPLE_ERR("Lost timeout event at timer cancel\n");
- /* Since we have cancelled the timer, there is no timeout event to
- * return from odp_timer_free() */
- (void)odp_timer_free(ttp->tim);
+ odp_timer_free(ttp->tim);
+ ttp = NULL;
+ }
/* Remove any prescheduled events */
remove_prescheduled_events();
@@ -457,6 +466,8 @@ int main(int argc, char *argv[])
printf("\n");
+ gbls->num_workers = num_workers;
+
/* Initialize number of timeouts to receive */
odp_atomic_init_u32(&gbls->remain, gbls->args.tmo_count * num_workers);
diff --git a/helper/Makefile.am b/helper/Makefile.am
index 44bcc3d..1a74e8e 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -7,7 +7,8 @@ AM_CFLAGS += -I$(top_srcdir)/platform/@with_platform@/include
AM_CFLAGS += -I$(top_srcdir)/platform/linux-generic/include
AM_CFLAGS += -I$(top_srcdir)/include
-include_HEADERS = \
+helperincludedir = $(includedir)/odp/helper/
+helperinclude_HEADERS = \
$(srcdir)/include/odp/helper/ring.h \
$(srcdir)/include/odp/helper/linux.h \
$(srcdir)/include/odp/helper/chksum.h\
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index 82ede46..82215bc 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -162,4 +162,9 @@ __LIB__libodp_la_SOURCES = \
odp_timer.c \
odp_version.c \
odp_weak.c \
- arch/@ARCH@/odp_time.c
+ arch/@ARCH@/odp_time_cycles.c
+
+EXTRA_DIST = \
+ arch/linux/odp_time_cycles.c \
+ arch/mips64/odp_time_cycles.c \
+ arch/x86/odp_time_cycles.c
diff --git a/platform/linux-generic/arch/linux/odp_time.c b/platform/linux-generic/arch/linux/odp_time_cycles.c
index 4dc0764..4dc0764 100644
--- a/platform/linux-generic/arch/linux/odp_time.c
+++ b/platform/linux-generic/arch/linux/odp_time_cycles.c
diff --git a/platform/linux-generic/arch/mips64/odp_time.c b/platform/linux-generic/arch/mips64/odp_time_cycles.c
index 4fb790b..4fb790b 100644
--- a/platform/linux-generic/arch/mips64/odp_time.c
+++ b/platform/linux-generic/arch/mips64/odp_time_cycles.c
diff --git a/platform/linux-generic/arch/x86/odp_time.c b/platform/linux-generic/arch/x86/odp_time_cycles.c
index a111561..a111561 100644
--- a/platform/linux-generic/arch/x86/odp_time.c
+++ b/platform/linux-generic/arch/x86/odp_time_cycles.c
diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4
index 55124f1..9658274 100644
--- a/platform/linux-generic/m4/configure.m4
+++ b/platform/linux-generic/m4/configure.m4
@@ -16,4 +16,9 @@ AC_LINK_IFELSE(
echo "Use newer version. For gcc > 4.7.0"
exit -1)
-AC_CONFIG_FILES([platform/linux-generic/test/Makefile])
+m4_include([platform/linux-generic/m4/odp_pthread.m4])
+m4_include([platform/linux-generic/m4/odp_openssl.m4])
+
+AC_CONFIG_FILES([platform/linux-generic/Makefile
+ platform/linux-generic/test/Makefile
+ platform/linux-generic/test/pktio/Makefile])
diff --git a/platform/linux-generic/m4/odp_openssl.m4 b/platform/linux-generic/m4/odp_openssl.m4
new file mode 100644
index 0000000..2344914
--- /dev/null
+++ b/platform/linux-generic/m4/odp_openssl.m4
@@ -0,0 +1,32 @@
+##########################################################################
+# Set optional OpenSSL path
+##########################################################################
+AC_ARG_WITH([openssl-path],
+AC_HELP_STRING([--with-openssl-path=DIR path to openssl libs and headers],
+ [(or in the default path if not specified).]),
+ [OPENSSL_PATH=$withval
+ AM_CPPFLAGS="$AM_CPPFLAGS -I$OPENSSL_PATH/include"
+ AM_LDFLAGS="$AM_LDFLAGS -L$OPENSSL_PATH/lib"
+ ],[])
+
+##########################################################################
+# Save and set temporary compilation flags
+##########################################################################
+OLD_LDFLAGS=$LDFLAGS
+OLD_CPPFLAGS=$CPPFLAGS
+LDFLAGS="$AM_LDFLAGS $LDFLAGS"
+CPPFLAGS="$AM_CPPFLAGS $CPPFLAGS"
+
+##########################################################################
+# Check for OpenSSL availability
+##########################################################################
+AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
+ [AC_MSG_FAILURE([OpenSSL libraries required])])
+AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
+ [AC_MSG_ERROR([OpenSSL headers required])])
+
+##########################################################################
+# Restore old saved variables
+##########################################################################
+LDFLAGS=$OLD_LDFLAGS
+CPPFLAGS=$OLD_CPPFLAGS
diff --git a/platform/linux-generic/m4/odp_pthread.m4 b/platform/linux-generic/m4/odp_pthread.m4
new file mode 100644
index 0000000..7f39103
--- /dev/null
+++ b/platform/linux-generic/m4/odp_pthread.m4
@@ -0,0 +1,13 @@
+##########################################################################
+# Check for pthreads availability
+##########################################################################
+
+AX_PTHREAD([CC="$PTHREAD_CC"], [
+ echo "Error! We require pthreads to be available"
+ exit -1
+ ])
+LIBS="$PTHREAD_LIBS $LIBS"
+AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
+AM_LDFLAGS="$AM_LDFLAGS $PTHREAD_LDFLAGS"
+
+AM_LDFLAGS="$AM_LDFLAGS -pthread -lrt"
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 27ec6ab..617eadc 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1 +1 @@
-EXTRA_DIST = git_hash.sh
+EXTRA_DIST = git_hash.sh odp_version.sh
diff --git a/test/Makefile.inc b/test/Makefile.inc
index d5b4770..2700b18 100644
--- a/test/Makefile.inc
+++ b/test/Makefile.inc
@@ -6,8 +6,7 @@ LIB = $(top_builddir)/lib
#before libodp by setting PRE_LDADD before the inclusion.
LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp.la
-INCFLAGS = -I$(srcdir) \
- -I$(top_srcdir)/test \
+INCFLAGS = -I$(top_srcdir)/test \
-I$(top_srcdir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/linux-generic/include \
-I$(top_srcdir)/include \
@@ -20,4 +19,4 @@ AM_LDFLAGS += -L$(LIB)
@VALGRIND_CHECK_RULES@
valgrind_tools = memcheck drd sgcheck
-TESTS_ENVIRONMENT= ODP_PLATFORM=${with_platform} EXEEXT=${EXEEXT} \ No newline at end of file
+TESTS_ENVIRONMENT= ODP_PLATFORM=${with_platform} EXEEXT=${EXEEXT}
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index f5bfd55..366bb15 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -109,6 +109,8 @@ typedef struct {
/** Global pointer to args */
static args_t *gbl_args;
+/** Global barrier to synchronize main and workers */
+static odp_barrier_t barrier;
/* helper funcs */
static inline odp_queue_t lookup_dest_q(odp_packet_t pkt);
@@ -136,6 +138,7 @@ static void *pktio_queue_thread(void *arg)
thr = odp_thread_id();
printf("[%02i] QUEUE mode\n", thr);
+ odp_barrier_wait(&barrier);
/* Loop packets */
while (!exit_threads) {
@@ -219,6 +222,7 @@ static void *pktio_ifburst_thread(void *arg)
gbl_args->appl.if_names[src_idx],
gbl_args->appl.if_names[dst_idx],
odp_pktio_to_u64(pktio_src), odp_pktio_to_u64(pktio_dst));
+ odp_barrier_wait(&barrier);
/* Loop packets */
while (!exit_threads) {
@@ -332,6 +336,9 @@ static void print_speed_stats(int num_workers, stats_t **thr_stats,
int i, elapsed = 0;
int loop_forever = (duration == 0);
+ /* Wait for all threads to be ready*/
+ odp_barrier_wait(&barrier);
+
do {
pkts = 0;
drops = 0;
@@ -454,6 +461,8 @@ int main(int argc, char *argv[])
stats_t **stats = calloc(1, sizeof(stats_t) * num_workers);
+ odp_barrier_init(&barrier, num_workers + 1);
+
/* Create worker threads */
cpu = odp_cpumask_first(&cpumask);
for (i = 0; i < num_workers; ++i) {
diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index b09055f..1552579 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -123,6 +123,8 @@ typedef struct {
odp_pktio_t pktio_rx;
pkt_rx_stats_t rx_stats[ODP_CONFIG_MAX_THREADS];
pkt_tx_stats_t tx_stats[ODP_CONFIG_MAX_THREADS];
+ uint8_t src_mac[ODPH_ETHADDR_LEN];
+ uint8_t dst_mac[ODPH_ETHADDR_LEN];
} test_globals_t;
/* Status of max rate search */
@@ -169,7 +171,6 @@ static odp_packet_t pktio_create_packet(void)
uint32_t offset;
pkt_head_t pkt_hdr;
size_t payload_len;
- uint8_t mac[ODPH_ETHADDR_LEN] = {0};
payload_len = sizeof(pkt_hdr) + gbl_args->args.pkt_len;
@@ -186,8 +187,8 @@ static odp_packet_t pktio_create_packet(void)
offset = 0;
odp_packet_l2_offset_set(pkt, offset);
eth = (odph_ethhdr_t *)buf;
- memcpy(eth->src.addr, mac, ODPH_ETHADDR_LEN);
- memcpy(eth->dst.addr, mac, ODPH_ETHADDR_LEN);
+ memcpy(eth->src.addr, gbl_args->src_mac, ODPH_ETHADDR_LEN);
+ memcpy(eth->dst.addr, gbl_args->dst_mac, ODPH_ETHADDR_LEN);
eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4);
/* IP */
@@ -746,6 +747,11 @@ static int test_init(void)
gbl_args->pktio_rx = gbl_args->pktio_tx;
}
+ odp_pktio_mac_addr(gbl_args->pktio_tx, gbl_args->src_mac,
+ ODPH_ETHADDR_LEN);
+ odp_pktio_mac_addr(gbl_args->pktio_rx, gbl_args->dst_mac,
+ ODPH_ETHADDR_LEN);
+
if (gbl_args->pktio_rx == ODP_PKTIO_INVALID ||
gbl_args->pktio_tx == ODP_PKTIO_INVALID) {
LOG_ERR("failed to open pktio\n");
diff --git a/test/validation/Makefile.inc b/test/validation/Makefile.inc
index ac80814..49efbda 100644
--- a/test/validation/Makefile.inc
+++ b/test/validation/Makefile.inc
@@ -2,6 +2,11 @@ include $(top_srcdir)/test/Makefile.inc
COMMON_DIR = $(top_builddir)/test/validation/common
+#the following option ensure that option '-I.' is not passed to gcc,
+#therefore distinguishing between '#include "X"' and '#include <X>'.
+#It allows common filenames (such as 'errno.h') to be used locally.
+AUTOMAKE_OPTIONS = nostdinc
+
AM_CFLAGS += -I$(top_srcdir)/test/validation/common
AM_LDFLAGS += -static
diff --git a/test/validation/buffer/buffer.c b/test/validation/buffer/buffer.c
index f67c55f..52585b9 100644
--- a/test/validation/buffer/buffer.c
+++ b/test/validation/buffer/buffer.c
@@ -15,7 +15,7 @@ static odp_pool_t raw_pool;
static odp_buffer_t raw_buffer = ODP_BUFFER_INVALID;
static const size_t raw_buffer_size = 1500;
-static int buffer_suite_init(void)
+int buffer_suite_init(void)
{
odp_pool_param_t params = {
.buf = {
@@ -35,7 +35,7 @@ static int buffer_suite_init(void)
return 0;
}
-static int buffer_suite_term(void)
+int buffer_suite_term(void)
{
odp_buffer_free(raw_buffer);
if (odp_pool_destroy(raw_pool) != 0)
@@ -43,7 +43,7 @@ static int buffer_suite_term(void)
return 0;
}
-static void buffer_test_pool_alloc(void)
+void buffer_test_pool_alloc(void)
{
odp_pool_t pool;
const int num = 3;
@@ -95,7 +95,7 @@ static void buffer_test_pool_alloc(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-static void buffer_test_pool_free(void)
+void buffer_test_pool_free(void)
{
odp_pool_t pool;
odp_buffer_t buffer;
@@ -127,7 +127,7 @@ static void buffer_test_pool_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-static void buffer_test_management_basic(void)
+void buffer_test_management_basic(void)
{
odp_event_t ev = odp_buffer_to_event(raw_buffer);
@@ -142,14 +142,14 @@ static void buffer_test_management_basic(void)
CU_ASSERT(odp_event_to_u64(ev) != odp_event_to_u64(ODP_EVENT_INVALID));
}
-static CU_TestInfo buffer_suite[] = {
+CU_TestInfo buffer_suite[] = {
_CU_TEST_INFO(buffer_test_pool_alloc),
_CU_TEST_INFO(buffer_test_pool_free),
_CU_TEST_INFO(buffer_test_management_basic),
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo buffer_suites[] = {
+CU_SuiteInfo buffer_suites[] = {
{ .pName = "buffer tests",
.pTests = buffer_suite,
.pInitFunc = buffer_suite_init,
diff --git a/test/validation/buffer/buffer.h b/test/validation/buffer/buffer.h
index 6269c63..4916624 100644
--- a/test/validation/buffer/buffer.h
+++ b/test/validation/buffer/buffer.h
@@ -7,6 +7,24 @@
#ifndef _ODP_TEST_BUFFER_H_
#define _ODP_TEST_BUFFER_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void buffer_test_pool_alloc(void);
+void buffer_test_pool_free(void);
+void buffer_test_management_basic(void);
+
+/* test arrays: */
+extern CU_TestInfo buffer_suite[];
+
+/* test array init/term functions: */
+int buffer_suite_init(void);
+int buffer_suite_term(void);
+
+/* test registry: */
+extern CU_SuiteInfo buffer_suites[];
+
+/* main test program: */
int buffer_main(void);
#endif
diff --git a/test/validation/classification/classification.c b/test/validation/classification/classification.c
index 2582aaa..d0fef93 100644
--- a/test/validation/classification/classification.c
+++ b/test/validation/classification/classification.c
@@ -9,7 +9,7 @@
#include "odp_classification_testsuites.h"
#include "classification.h"
-static CU_SuiteInfo classification_suites[] = {
+CU_SuiteInfo classification_suites[] = {
{ .pName = "classification basic",
.pTests = classification_suite_basic,
},
diff --git a/test/validation/classification/classification.h b/test/validation/classification/classification.h
index 63ad022..d2847e5 100644
--- a/test/validation/classification/classification.h
+++ b/test/validation/classification/classification.h
@@ -7,6 +7,37 @@
#ifndef _ODP_TEST_CLASSIFICATION_H_
#define _ODP_TEST_CLASSIFICATION_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void classification_test_create_cos(void);
+void classification_test_destroy_cos(void);
+void classification_test_create_pmr_match(void);
+void classification_test_destroy_pmr(void);
+void classification_test_cos_set_queue(void);
+void classification_test_cos_set_drop(void);
+void classification_test_pmr_match_set_create(void);
+void classification_test_pmr_match_set_destroy(void);
+
+void classification_test_pktio_set_skip(void);
+void classification_test_pktio_set_headroom(void);
+void classification_test_pmr_terms_avail(void);
+void classification_test_pmr_terms_cap(void);
+void classification_test_pktio_configure(void);
+void classification_test_pktio_test(void);
+
+/* test arrays: */
+extern CU_TestInfo classification_suite_basic[];
+extern CU_TestInfo classification_suite[];
+
+/* test array init/term functions: */
+int classification_suite_init(void);
+int classification_suite_term(void);
+
+/* test registry: */
+extern CU_SuiteInfo classification_suites[];
+
+/* main test program: */
int classification_main(void);
#endif
diff --git a/test/validation/classification/odp_classification_basic.c b/test/validation/classification/odp_classification_basic.c
index 99202ee..79c775e 100644
--- a/test/validation/classification/odp_classification_basic.c
+++ b/test/validation/classification/odp_classification_basic.c
@@ -5,10 +5,11 @@
*/
#include "odp_classification_testsuites.h"
+#include "classification.h"
#define PMR_SET_NUM 5
-static void classification_test_create_cos(void)
+void classification_test_create_cos(void)
{
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -19,7 +20,7 @@ static void classification_test_create_cos(void)
odp_cos_destroy(cos);
}
-static void classification_test_destroy_cos(void)
+void classification_test_destroy_cos(void)
{
odp_cos_t cos;
char name[ODP_COS_NAME_LEN];
@@ -33,7 +34,7 @@ static void classification_test_destroy_cos(void)
CU_ASSERT(retval < 0);
}
-static void classification_test_create_pmr_match(void)
+void classification_test_create_pmr_match(void)
{
odp_pmr_t pmr;
uint16_t val;
@@ -46,7 +47,7 @@ static void classification_test_create_pmr_match(void)
odp_pmr_destroy(pmr);
}
-static void classification_test_destroy_pmr(void)
+void classification_test_destroy_pmr(void)
{
odp_pmr_t pmr;
uint16_t val;
@@ -62,7 +63,7 @@ static void classification_test_destroy_pmr(void)
CU_ASSERT(retval < 0);
}
-static void classification_test_cos_set_queue(void)
+void classification_test_cos_set_queue(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -87,7 +88,7 @@ static void classification_test_cos_set_queue(void)
odp_queue_destroy(queue_cos);
}
-static void classification_test_cos_set_drop(void)
+void classification_test_cos_set_drop(void)
{
int retval;
char cosname[ODP_COS_NAME_LEN];
@@ -103,7 +104,7 @@ static void classification_test_cos_set_drop(void)
odp_cos_destroy(cos_drop);
}
-static void classification_test_pmr_match_set_create(void)
+void classification_test_pmr_match_set_create(void)
{
odp_pmr_set_t pmr_set;
int retval;
@@ -127,7 +128,7 @@ static void classification_test_pmr_match_set_create(void)
CU_ASSERT(retval == 0);
}
-static void classification_test_pmr_match_set_destroy(void)
+void classification_test_pmr_match_set_destroy(void)
{
odp_pmr_set_t pmr_set;
int retval;
diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c
index ecf9db0..c44ceb9 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -5,6 +5,7 @@
*/
#include "odp_classification_testsuites.h"
+#include "classification.h"
#include <odp_cunit_common.h>
#include <odp/helper/eth.h>
#include <odp/helper/ip.h>
@@ -568,7 +569,7 @@ void test_pktio_error_cos(void)
odp_packet_free(pkt);
}
-static void classification_test_pktio_set_skip(void)
+void classification_test_pktio_set_skip(void)
{
int retval;
size_t offset = 5;
@@ -585,7 +586,7 @@ static void classification_test_pktio_set_skip(void)
CU_ASSERT(retval == 0);
}
-static void classification_test_pktio_set_headroom(void)
+void classification_test_pktio_set_headroom(void)
{
size_t headroom;
int retval;
@@ -797,7 +798,7 @@ void test_pktio_pmr_match_set_cos(void)
odp_packet_free(pkt);
}
-static void classification_test_pmr_terms_avail(void)
+void classification_test_pmr_terms_avail(void)
{
int retval;
/* Since this API called at the start of the suite the return value
@@ -806,7 +807,7 @@ static void classification_test_pmr_terms_avail(void)
CU_ASSERT(retval > 0);
}
-static void classification_test_pmr_terms_cap(void)
+void classification_test_pmr_terms_cap(void)
{
unsigned long long retval;
/* Need to check different values for different platforms */
@@ -814,7 +815,7 @@ static void classification_test_pmr_terms_cap(void)
CU_ASSERT(retval & (1 << ODP_PMR_IPPROTO));
}
-static void classification_test_pktio_configure(void)
+void classification_test_pktio_configure(void)
{
/* Configure the Different CoS for the pktio interface */
if (TEST_DEFAULT)
@@ -831,7 +832,7 @@ static void classification_test_pktio_configure(void)
configure_pktio_pmr_match_set_cos();
}
-static void classification_test_pktio_test(void)
+void classification_test_pktio_test(void)
{
/* Test Different CoS on the pktio interface */
if (TEST_DEFAULT)
diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c
index 76b7648..029baad 100644
--- a/test/validation/cpumask/cpumask.c
+++ b/test/validation/cpumask/cpumask.c
@@ -10,10 +10,10 @@
#include "cpumask.h"
#include "mask_common.h"
-/* default worker paramiter to get all that may be available */
+/* default worker parameter to get all that may be available */
#define ALL_AVAILABLE 0
-static void cpumask_test_odp_cpumask_def_control(void)
+void cpumask_test_odp_cpumask_def_control(void)
{
unsigned num;
unsigned mask_count;
@@ -28,7 +28,7 @@ static void cpumask_test_odp_cpumask_def_control(void)
CU_ASSERT(num <= max_cpus);
}
-static void cpumask_test_odp_cpumask_def_worker(void)
+void cpumask_test_odp_cpumask_def_worker(void)
{
unsigned num;
unsigned mask_count;
@@ -43,7 +43,7 @@ static void cpumask_test_odp_cpumask_def_worker(void)
CU_ASSERT(num <= max_cpus);
}
-static void cpumask_test_odp_cpumask_def(void)
+void cpumask_test_odp_cpumask_def(void)
{
unsigned mask_count;
unsigned num_worker;
@@ -72,7 +72,7 @@ static void cpumask_test_odp_cpumask_def(void)
CU_ASSERT(num_worker > 0);
}
-static CU_TestInfo cpumask_suite[] = {
+CU_TestInfo cpumask_suite[] = {
{"odp_cpumask_to/from_str()", cpumask_test_odp_cpumask_to_from_str},
{"odp_cpumask_equal()", cpumask_test_odp_cpumask_equal},
{"odp_cpumask_zero()", cpumask_test_odp_cpumask_zero},
@@ -94,7 +94,7 @@ static CU_TestInfo cpumask_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo cpumask_suites[] = {
+CU_SuiteInfo cpumask_suites[] = {
{"Cpumask", NULL, NULL, NULL, NULL, cpumask_suite},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/cpumask/cpumask.h b/test/validation/cpumask/cpumask.h
index 2c6fb4a..7a58b5d 100644
--- a/test/validation/cpumask/cpumask.h
+++ b/test/validation/cpumask/cpumask.h
@@ -7,6 +7,22 @@
#ifndef _ODP_TEST_CPUMASK_H_
#define _ODP_TEST_CPUMASK_H_
+#include <odp.h>
+#include <CUnit/Basic.h>
+
+/* test functions: */
+#include "mask_common.h"
+void cpumask_test_odp_cpumask_def_control(void);
+void cpumask_test_odp_cpumask_def_worker(void);
+void cpumask_test_odp_cpumask_def(void);
+
+/* test arrays: */
+extern CU_TestInfo cpumask_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo cpumask_suites[];
+
+/* main test program: */
int cpumask_main(void);
#endif
diff --git a/test/validation/crypto/crypto.c b/test/validation/crypto/crypto.c
index 9965432..cad6601 100644
--- a/test/validation/crypto/crypto.c
+++ b/test/validation/crypto/crypto.c
@@ -15,7 +15,7 @@
#define SHM_COMPL_POOL_SIZE (128 * 1024)
#define SHM_COMPL_POOL_BUF_SIZE 128
-static CU_SuiteInfo crypto_suites[] = {
+CU_SuiteInfo crypto_suites[] = {
{ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, NULL, NULL, NULL,
crypto_suite},
{ODP_CRYPTO_ASYNC_INP, crypto_suite_async_init, NULL, NULL, NULL,
@@ -23,7 +23,7 @@ static CU_SuiteInfo crypto_suites[] = {
CU_SUITE_INFO_NULL,
};
-static int crypto_init(void)
+int crypto_init(void)
{
odp_pool_param_t params;
odp_pool_t pool;
@@ -60,7 +60,7 @@ static int crypto_init(void)
return 0;
}
-static int crypto_term(void)
+int crypto_term(void)
{
odp_pool_t pool;
odp_queue_t out_queue;
diff --git a/test/validation/crypto/crypto.h b/test/validation/crypto/crypto.h
index 9ab641b..41dd4ed 100644
--- a/test/validation/crypto/crypto.h
+++ b/test/validation/crypto/crypto.h
@@ -7,6 +7,30 @@
#ifndef _ODP_TEST_CRYPTO_H_
#define _ODP_TEST_CRYPTO_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void crypto_test_enc_alg_3des_cbc(void);
+void crypto_test_enc_alg_3des_cbc_ovr_iv(void);
+void crypto_test_dec_alg_3des_cbc(void);
+void crypto_test_dec_alg_3des_cbc_ovr_iv(void);
+void crypto_test_alg_hmac_md5(void);
+
+/* test arrays: */
+extern CU_TestInfo crypto_suite[];
+
+/* test array init/term functions: */
+int crypto_suite_sync_init(void);
+int crypto_suite_async_init(void);
+
+/* test registry: */
+extern CU_SuiteInfo crypto_suites[];
+
+/* executable init/term functions: */
+int crypto_init(void);
+int crypto_term(void);
+
+/* main test program: */
int crypto_main(void);
#endif
diff --git a/test/validation/crypto/odp_crypto_test_inp.c b/test/validation/crypto/odp_crypto_test_inp.c
index c1c08af..90fe8d0 100644
--- a/test/validation/crypto/odp_crypto_test_inp.c
+++ b/test/validation/crypto/odp_crypto_test_inp.c
@@ -8,6 +8,7 @@
#include <CUnit/Basic.h>
#include "test_vectors.h"
#include "odp_crypto_test_inp.h"
+#include "crypto.h"
struct suite_context_s {
enum odp_crypto_op_mode pref_mode;
@@ -132,7 +133,7 @@ cleanup:
* In addition the test verifies if the implementation can use the
* packet buffer as completion event buffer.*/
#define ASYNC_INP_ENC_ALG_3DES_CBC "ENC_ALG_3DES_CBC"
-static void crypto_test_enc_alg_3des_cbc(void)
+void crypto_test_enc_alg_3des_cbc(void)
{
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
auth_key = { .data = NULL, .length = 0 };
@@ -165,7 +166,7 @@ static void crypto_test_enc_alg_3des_cbc(void)
* operation for 3DES_CBC algorithm. IV for the operation is the operation IV.
* */
#define ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV "ENC_ALG_3DES_CBC_OVR_IV"
-static void crypto_test_enc_alg_3des_cbc_ovr_iv(void)
+void crypto_test_enc_alg_3des_cbc_ovr_iv(void)
{
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
auth_key = { .data = NULL, .length = 0 };
@@ -199,7 +200,7 @@ static void crypto_test_enc_alg_3des_cbc_ovr_iv(void)
* packet buffer as completion event buffer.
* */
#define ASYNC_INP_DEC_ALG_3DES_CBC "DEC_ALG_3DES_CBC"
-static void crypto_test_dec_alg_3des_cbc(void)
+void crypto_test_dec_alg_3des_cbc(void)
{
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
auth_key = { .data = NULL, .length = 0 };
@@ -234,7 +235,7 @@ static void crypto_test_dec_alg_3des_cbc(void)
* packet buffer as completion event buffer.
* */
#define ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV "DEC_ALG_3DES_CBC_OVR_IV"
-static void crypto_test_dec_alg_3des_cbc_ovr_iv(void)
+void crypto_test_dec_alg_3des_cbc_ovr_iv(void)
{
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
auth_key = { .data = NULL, .length = 0 };
@@ -270,7 +271,7 @@ static void crypto_test_dec_alg_3des_cbc_ovr_iv(void)
* packet buffer as completion event buffer.
* */
#define ASYNC_INP_ALG_HMAC_MD5 "ALG_HMAC_MD5"
-static void crypto_test_alg_hmac_md5(void)
+void crypto_test_alg_hmac_md5(void)
{
odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 },
auth_key = { .data = NULL, .length = 0 };
diff --git a/test/validation/errno/errno.c b/test/validation/errno/errno.c
index ac1d93c..9b6b125 100644
--- a/test/validation/errno/errno.c
+++ b/test/validation/errno/errno.c
@@ -6,8 +6,9 @@
#include <odp.h>
#include "odp_cunit_common.h"
+#include "errno.h"
-static void errno_test_odp_errno_sunny_day(void)
+void errno_test_odp_errno_sunny_day(void)
{
int my_errno;
diff --git a/test/validation/errno/errno.h b/test/validation/errno/errno.h
index 5923768..374a3c9 100644
--- a/test/validation/errno/errno.h
+++ b/test/validation/errno/errno.h
@@ -7,6 +7,18 @@
#ifndef _ODP_TEST_ERRNO_H_
#define _ODP_TEST_ERRNO_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void errno_test_odp_errno_sunny_day(void);
+
+/* test arrays: */
+extern CU_TestInfo errno_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo errno_suites[];
+
+/* main test program: */
int errno_main(void);
#endif
diff --git a/test/validation/init/init.c b/test/validation/init/init.c
index 169bd5c..12aa554 100644
--- a/test/validation/init/init.c
+++ b/test/validation/init/init.c
@@ -22,7 +22,7 @@ ODP_PRINTF_FORMAT(2, 3)
static int odp_init_log(odp_log_level_e level, const char *fmt, ...);
/* test ODP global init, with alternate abort function */
-static void init_test_odp_init_global_replace_abort(void)
+void init_test_odp_init_global_replace_abort(void)
{
int status;
struct odp_init_t init_data;
@@ -37,12 +37,12 @@ static void init_test_odp_init_global_replace_abort(void)
CU_ASSERT(status == 0);
}
-static CU_TestInfo init_suite_abort[] = {
+CU_TestInfo init_suite_abort[] = {
{"replace abort", init_test_odp_init_global_replace_abort},
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo init_suites_abort[] = {
+CU_SuiteInfo init_suites_abort[] = {
{"Init", NULL, NULL, NULL, NULL, init_suite_abort},
CU_SUITE_INFO_NULL,
};
@@ -63,7 +63,7 @@ int init_main_abort(void)
}
/* test ODP global init, with alternate log function */
-static void init_test_odp_init_global_replace_log(void)
+void init_test_odp_init_global_replace_log(void)
{
int status;
struct odp_init_t init_data;
@@ -82,12 +82,12 @@ static void init_test_odp_init_global_replace_log(void)
CU_ASSERT(status == 0);
}
-static CU_TestInfo init_suite_log[] = {
+CU_TestInfo init_suite_log[] = {
{"replace log", init_test_odp_init_global_replace_log},
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo init_suites_log[] = {
+CU_SuiteInfo init_suites_log[] = {
{"Init", NULL, NULL, NULL, NULL, init_suite_log},
CU_SUITE_INFO_NULL,
};
@@ -119,7 +119,7 @@ int init_main_log(void)
}
/* test normal ODP global init */
-static void init_test_odp_init_global(void)
+void init_test_odp_init_global(void)
{
int status;
@@ -130,12 +130,12 @@ static void init_test_odp_init_global(void)
CU_ASSERT(status == 0);
}
-static CU_TestInfo init_suite_ok[] = {
+CU_TestInfo init_suite_ok[] = {
{"test_odp_init_global", init_test_odp_init_global},
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo init_suites_ok[] = {
+CU_SuiteInfo init_suites_ok[] = {
{"Init", NULL, NULL, NULL, NULL, init_suite_ok},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/init/init.h b/test/validation/init/init.h
index 7e5a082..08f09e5 100644
--- a/test/validation/init/init.h
+++ b/test/validation/init/init.h
@@ -7,6 +7,24 @@
#ifndef _ODP_TEST_INIT_H_
#define _ODP_TEST_INIT_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void init_test_odp_init_global_replace_abort(void);
+void init_test_odp_init_global_replace_log(void);
+void init_test_odp_init_global(void);
+
+/* test arrays: */
+extern CU_TestInfo init_suite_abort[];
+extern CU_TestInfo init_suite_log[];
+extern CU_TestInfo init_suite_ok[];
+
+/* test registry: */
+extern CU_SuiteInfo init_suites_abort[];
+extern CU_SuiteInfo init_suites_log[];
+extern CU_SuiteInfo init_suites_ok[];
+
+/* main test program: */
int init_main_abort(void);
int init_main_log(void);
int init_main_ok(void);
diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c
index 329482a..99a6745 100644
--- a/test/validation/packet/packet.c
+++ b/test/validation/packet/packet.c
@@ -36,7 +36,7 @@ static struct udata_struct {
"abcdefg",
};
-static int packet_suite_init(void)
+int packet_suite_init(void)
{
odp_pool_param_t params = {
.pkt = {
@@ -78,7 +78,7 @@ static int packet_suite_init(void)
return 0;
}
-static int packet_suite_term(void)
+int packet_suite_term(void)
{
odp_packet_free(test_packet);
odp_packet_free(segmented_test_packet);
@@ -87,7 +87,7 @@ static int packet_suite_term(void)
return 0;
}
-static void packet_test_alloc_free(void)
+void packet_test_alloc_free(void)
{
odp_pool_t pool;
odp_packet_t packet;
@@ -126,7 +126,7 @@ static void packet_test_alloc_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-static void packet_test_alloc_segmented(void)
+void packet_test_alloc_segmented(void)
{
odp_packet_t pkt;
const uint32_t len = ODP_CONFIG_PACKET_BUF_LEN_MAX -
@@ -139,7 +139,7 @@ static void packet_test_alloc_segmented(void)
odp_packet_free(pkt);
}
-static void packet_test_event_conversion(void)
+void packet_test_event_conversion(void)
{
odp_packet_t pkt = test_packet;
odp_packet_t tmp_pkt;
@@ -154,7 +154,7 @@ static void packet_test_event_conversion(void)
/** @todo: Need an API to compare packets */
}
-static void packet_test_basic_metadata(void)
+void packet_test_basic_metadata(void)
{
odp_packet_t pkt = test_packet;
@@ -166,7 +166,7 @@ static void packet_test_basic_metadata(void)
CU_ASSERT(odp_packet_input(pkt) == ODP_PKTIO_INVALID);
}
-static void packet_test_length(void)
+void packet_test_length(void)
{
odp_packet_t pkt = test_packet;
uint32_t buf_len, headroom, tailroom;
@@ -185,13 +185,13 @@ static void packet_test_length(void)
CU_ASSERT(buf_len >= packet_len + headroom + tailroom);
}
-static void packet_test_debug(void)
+void packet_test_debug(void)
{
CU_ASSERT(odp_packet_is_valid(test_packet) == 1);
odp_packet_print(test_packet);
}
-static void packet_test_context(void)
+void packet_test_context(void)
{
odp_packet_t pkt = test_packet;
char ptr_test_value = 2;
@@ -213,7 +213,7 @@ static void packet_test_context(void)
odp_packet_reset(pkt, packet_len);
}
-static void packet_test_layer_offsets(void)
+void packet_test_layer_offsets(void)
{
odp_packet_t pkt = test_packet;
uint8_t *l2_addr, *l3_addr, *l4_addr;
@@ -287,7 +287,7 @@ static void _verify_headroom_shift(odp_packet_t packet,
CU_ASSERT(data == data_orig - shift);
}
-static void packet_test_headroom(void)
+void packet_test_headroom(void)
{
odp_packet_t pkt = test_packet;
uint32_t room;
@@ -359,7 +359,7 @@ static void _verify_tailroom_shift(odp_packet_t pkt,
}
}
-static void packet_test_tailroom(void)
+void packet_test_tailroom(void)
{
odp_packet_t pkt = test_packet;
odp_packet_seg_t segment;
@@ -386,7 +386,7 @@ static void packet_test_tailroom(void)
_verify_tailroom_shift(pkt, 0);
}
-static void packet_test_segments(void)
+void packet_test_segments(void)
{
int num_segs, seg_index;
uint32_t data_len, buf_len;
@@ -486,7 +486,7 @@ static void packet_test_segments(void)
CU_ASSERT(seg == ODP_PACKET_SEG_INVALID);
}
-static void packet_test_segment_last(void)
+void packet_test_segment_last(void)
{
odp_packet_t pkt = test_packet;
odp_packet_seg_t seg;
@@ -506,7 +506,7 @@ do { \
CU_ASSERT(odp_packet_has_##flag(packet) != 0); \
} while (0)
-static void packet_test_in_flags(void)
+void packet_test_in_flags(void)
{
odp_packet_t pkt = test_packet;
@@ -529,7 +529,7 @@ static void packet_test_in_flags(void)
TEST_INFLAG(pkt, icmp);
}
-static void packet_test_error_flags(void)
+void packet_test_error_flags(void)
{
odp_packet_t pkt = test_packet;
int err;
@@ -551,7 +551,7 @@ struct packet_metadata {
uint64_t usr_u64;
};
-static void packet_test_add_rem_data(void)
+void packet_test_add_rem_data(void)
{
odp_packet_t pkt, new_pkt;
uint32_t pkt_len, offset, add_len;
@@ -660,7 +660,7 @@ static void _packet_compare_data(odp_packet_t pkt1, odp_packet_t pkt2)
}
}
-static void packet_test_copy(void)
+void packet_test_copy(void)
{
odp_packet_t pkt = test_packet;
odp_packet_t pkt_copy;
@@ -679,7 +679,7 @@ static void packet_test_copy(void)
odp_packet_free(pkt_copy);
}
-static void packet_test_copydata(void)
+void packet_test_copydata(void)
{
odp_packet_t pkt = test_packet;
uint32_t pkt_len = odp_packet_len(pkt);
@@ -710,7 +710,7 @@ static void packet_test_copydata(void)
free(data_buf);
}
-static void packet_test_offset(void)
+void packet_test_offset(void)
{
odp_packet_t pkt = test_packet;
uint32_t seg_len, full_seg_len;
@@ -756,7 +756,7 @@ static void packet_test_offset(void)
CU_ASSERT_PTR_NOT_NULL(ptr);
}
-static CU_TestInfo packet_suite[] = {
+CU_TestInfo packet_suite[] = {
_CU_TEST_INFO(packet_test_alloc_free),
_CU_TEST_INFO(packet_test_alloc_segmented),
_CU_TEST_INFO(packet_test_basic_metadata),
@@ -778,7 +778,7 @@ static CU_TestInfo packet_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo packet_suites[] = {
+CU_SuiteInfo packet_suites[] = {
{ .pName = "packet tests",
.pTests = packet_suite,
.pInitFunc = packet_suite_init,
diff --git a/test/validation/packet/packet.h b/test/validation/packet/packet.h
index 7e210cb..f8a16a8 100644
--- a/test/validation/packet/packet.h
+++ b/test/validation/packet/packet.h
@@ -7,6 +7,39 @@
#ifndef _ODP_TEST_PACKET_H_
#define _ODP_TEST_PACKET_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void packet_test_alloc_free(void);
+void packet_test_alloc_segmented(void);
+void packet_test_event_conversion(void);
+void packet_test_basic_metadata(void);
+void packet_test_length(void);
+void packet_test_debug(void);
+void packet_test_context(void);
+void packet_test_layer_offsets(void);
+void packet_test_headroom(void);
+void packet_test_tailroom(void);
+void packet_test_segments(void);
+void packet_test_segment_last(void);
+void packet_test_in_flags(void);
+void packet_test_error_flags(void);
+void packet_test_add_rem_data(void);
+void packet_test_copy(void);
+void packet_test_copydata(void);
+void packet_test_offset(void);
+
+/* test arrays: */
+extern CU_TestInfo packet_suite[];
+
+/* test array init/term functions: */
+int packet_suite_init(void);
+int packet_suite_term(void);
+
+/* test registry: */
+extern CU_SuiteInfo packet_suites[];
+
+/* main test program: */
int packet_main(void);
#endif
diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index dc8d427..ebe34fa 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -454,34 +454,34 @@ static void test_txrx(odp_queue_type_t q_type, int num_pkts)
}
}
-static void pktio_test_poll_queue(void)
+void pktio_test_poll_queue(void)
{
test_txrx(ODP_QUEUE_TYPE_POLL, 1);
}
-static void pktio_test_poll_multi(void)
+void pktio_test_poll_multi(void)
{
test_txrx(ODP_QUEUE_TYPE_POLL, 4);
}
-static void pktio_test_sched_queue(void)
+void pktio_test_sched_queue(void)
{
test_txrx(ODP_QUEUE_TYPE_SCHED, 1);
}
-static void pktio_test_sched_multi(void)
+void pktio_test_sched_multi(void)
{
test_txrx(ODP_QUEUE_TYPE_SCHED, 4);
}
-static void pktio_test_jumbo(void)
+void pktio_test_jumbo(void)
{
packet_len = PKT_LEN_JUMBO;
pktio_test_sched_multi();
packet_len = PKT_LEN_NORMAL;
}
-static void pktio_test_mtu(void)
+void pktio_test_mtu(void)
{
int ret;
int mtu;
@@ -496,7 +496,7 @@ static void pktio_test_mtu(void)
CU_ASSERT(ret == 0);
}
-static void pktio_test_promisc(void)
+void pktio_test_promisc(void)
{
int ret;
odp_pktio_t pktio = create_pktio(iface_name[0], ODP_QUEUE_TYPE_SCHED, 0);
@@ -519,7 +519,7 @@ static void pktio_test_promisc(void)
CU_ASSERT(ret == 0);
}
-static void pktio_test_mac(void)
+void pktio_test_mac(void)
{
unsigned char mac_addr[ODPH_ETHADDR_LEN];
int mac_len;
@@ -545,7 +545,7 @@ static void pktio_test_mac(void)
CU_ASSERT(0 == ret);
}
-static void pktio_test_inq_remdef(void)
+void pktio_test_inq_remdef(void)
{
odp_pktio_t pktio;
odp_queue_t inq;
@@ -571,7 +571,7 @@ static void pktio_test_inq_remdef(void)
CU_ASSERT(odp_pktio_close(pktio) == 0);
}
-static void pktio_test_open(void)
+void pktio_test_open(void)
{
odp_pktio_t pktio;
odp_pktio_param_t pktio_param;
@@ -591,7 +591,7 @@ static void pktio_test_open(void)
CU_ASSERT(pktio == ODP_PKTIO_INVALID);
}
-static void pktio_test_lookup(void)
+void pktio_test_lookup(void)
{
odp_pktio_t pktio, pktio_inval;
odp_pktio_param_t pktio_param;
@@ -614,7 +614,7 @@ static void pktio_test_lookup(void)
CU_ASSERT(odp_pktio_lookup(iface_name[0]) == ODP_PKTIO_INVALID);
}
-static void pktio_test_inq(void)
+void pktio_test_inq(void)
{
odp_pktio_t pktio;
@@ -648,7 +648,7 @@ static int create_pool(const char *iface, int num)
return 0;
}
-static int pktio_suite_init(void)
+int pktio_suite_init(void)
{
odp_atomic_init_u32(&ip_seq, 0);
iface_name[0] = getenv("ODP_PKTIO_IF0");
@@ -680,7 +680,7 @@ static int pktio_suite_init(void)
return 0;
}
-static int pktio_suite_term(void)
+int pktio_suite_term(void)
{
char pool_name[ODP_POOL_NAME_LEN];
odp_pool_t pool;
@@ -709,7 +709,7 @@ static int pktio_suite_term(void)
return ret;
}
-static CU_TestInfo pktio_suite[] = {
+CU_TestInfo pktio_suite[] = {
{"pktio open", pktio_test_open},
{"pktio lookup", pktio_test_lookup},
{"pktio inq", pktio_test_inq},
@@ -725,7 +725,7 @@ static CU_TestInfo pktio_suite[] = {
CU_TEST_INFO_NULL
};
-static CU_SuiteInfo pktio_suites[] = {
+CU_SuiteInfo pktio_suites[] = {
{"Packet I/O",
pktio_suite_init, pktio_suite_term, NULL, NULL, pktio_suite},
CU_SUITE_INFO_NULL
diff --git a/test/validation/pktio/pktio.h b/test/validation/pktio/pktio.h
index ccf5268..1749d5d 100644
--- a/test/validation/pktio/pktio.h
+++ b/test/validation/pktio/pktio.h
@@ -7,6 +7,33 @@
#ifndef _ODP_TEST_PKTIO_H_
#define _ODP_TEST_PKTIO_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void pktio_test_poll_queue(void);
+void pktio_test_poll_multi(void);
+void pktio_test_sched_queue(void);
+void pktio_test_sched_multi(void);
+void pktio_test_jumbo(void);
+void pktio_test_mtu(void);
+void pktio_test_promisc(void);
+void pktio_test_mac(void);
+void pktio_test_inq_remdef(void);
+void pktio_test_open(void);
+void pktio_test_lookup(void);
+void pktio_test_inq(void);
+
+/* test arrays: */
+extern CU_TestInfo pktio_suite[];
+
+/* test array init/term functions: */
+int pktio_suite_term(void);
+int pktio_suite_init(void);
+
+/* test registry: */
+extern CU_SuiteInfo pktio_suites[];
+
+/* main test program: */
int pktio_main(void);
#endif
diff --git a/test/validation/pool/pool.c b/test/validation/pool/pool.c
index a888b68..9247557 100644
--- a/test/validation/pool/pool.c
+++ b/test/validation/pool/pool.c
@@ -27,7 +27,7 @@ static void pool_create_destroy(odp_pool_param_t *params)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-static void pool_test_create_destroy_buffer(void)
+void pool_test_create_destroy_buffer(void)
{
odp_pool_param_t params = {
.buf = {
@@ -41,7 +41,7 @@ static void pool_test_create_destroy_buffer(void)
pool_create_destroy(&params);
}
-static void pool_test_create_destroy_packet(void)
+void pool_test_create_destroy_packet(void)
{
odp_pool_param_t params = {
.pkt = {
@@ -55,7 +55,7 @@ static void pool_test_create_destroy_packet(void)
pool_create_destroy(&params);
}
-static void pool_test_create_destroy_timeout(void)
+void pool_test_create_destroy_timeout(void)
{
odp_pool_param_t params = {
.tmo = {
@@ -67,7 +67,7 @@ static void pool_test_create_destroy_timeout(void)
pool_create_destroy(&params);
}
-static void pool_test_lookup_info_print(void)
+void pool_test_lookup_info_print(void)
{
odp_pool_t pool;
const char pool_name[] = "pool_for_lookup_test";
@@ -101,7 +101,7 @@ static void pool_test_lookup_info_print(void)
#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-static CU_TestInfo pool_suite[] = {
+CU_TestInfo pool_suite[] = {
_CU_TEST_INFO(pool_test_create_destroy_buffer),
_CU_TEST_INFO(pool_test_create_destroy_packet),
_CU_TEST_INFO(pool_test_create_destroy_timeout),
@@ -109,7 +109,7 @@ static CU_TestInfo pool_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo pool_suites[] = {
+CU_SuiteInfo pool_suites[] = {
{ .pName = "Pool tests",
.pTests = pool_suite,
},
diff --git a/test/validation/pool/pool.h b/test/validation/pool/pool.h
index 8c73d9b..12c6193 100644
--- a/test/validation/pool/pool.h
+++ b/test/validation/pool/pool.h
@@ -7,6 +7,22 @@
#ifndef _ODP_TEST_POOL_H_
#define _ODP_TEST_POOL_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void pool_test_create_destroy_buffer(void);
+void pool_test_create_destroy_packet(void);
+void pool_test_create_destroy_timeout(void);
+void pool_test_create_destroy_buffer_shm(void);
+void pool_test_lookup_info_print(void);
+
+/* test arrays: */
+extern CU_TestInfo pool_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo pool_suites[];
+
+/* main test program: */
int pool_main(void);
#endif
diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c
index a0cdf0f..3429b3f 100644
--- a/test/validation/queue/queue.c
+++ b/test/validation/queue/queue.c
@@ -15,7 +15,7 @@
static int queue_contest = 0xff;
static odp_pool_t pool;
-static int queue_suite_init(void)
+int queue_suite_init(void)
{
odp_pool_param_t params;
@@ -33,12 +33,12 @@ static int queue_suite_init(void)
return 0;
}
-static int queue_suite_term(void)
+int queue_suite_term(void)
{
return odp_pool_destroy(pool);
}
-static void queue_test_sunnydays(void)
+void queue_test_sunnydays(void)
{
odp_queue_t queue_creat_id, queue_id;
odp_event_t enev[MAX_BUFFER_QUEUE];
@@ -125,12 +125,12 @@ static void queue_test_sunnydays(void)
CU_ASSERT(odp_queue_destroy(queue_id) == 0);
}
-static CU_TestInfo queue_suite[] = {
+CU_TestInfo queue_suite[] = {
{"queue sunnyday", queue_test_sunnydays},
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo queue_suites[] = {
+CU_SuiteInfo queue_suites[] = {
{"Queue", queue_suite_init, queue_suite_term,
NULL, NULL, queue_suite},
CU_SUITE_INFO_NULL,
diff --git a/test/validation/queue/queue.h b/test/validation/queue/queue.h
index 8302912..d2765ce 100644
--- a/test/validation/queue/queue.h
+++ b/test/validation/queue/queue.h
@@ -7,6 +7,22 @@
#ifndef _ODP_TEST_QUEUE_H_
#define _ODP_TEST_QUEUE_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void queue_test_sunnydays(void);
+
+/* test arrays: */
+extern CU_TestInfo queue_suite[];
+
+/* test array init/term functions: */
+int queue_suite_init(void);
+int queue_suite_term(void);
+
+/* test registry: */
+extern CU_SuiteInfo queue_suites[];
+
+/* main test program: */
int queue_main(void);
#endif
diff --git a/test/validation/random/random.c b/test/validation/random/random.c
index a42523f..039c7a3 100644
--- a/test/validation/random/random.c
+++ b/test/validation/random/random.c
@@ -11,7 +11,7 @@
/* Helper macro for CU_TestInfo initialization */
#define _CU_TEST_INFO(test_func) {#test_func, test_func}
-static void random_test_get_size(void)
+void random_test_get_size(void)
{
int32_t ret;
uint8_t buf[32];
@@ -20,12 +20,12 @@ static void random_test_get_size(void)
CU_ASSERT(ret == sizeof(buf));
}
-static CU_TestInfo random_suite[] = {
+CU_TestInfo random_suite[] = {
_CU_TEST_INFO(random_test_get_size),
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo random_suites[] = {
+CU_SuiteInfo random_suites[] = {
{"Random", NULL, NULL, NULL, NULL, random_suite},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/random/random.h b/test/validation/random/random.h
index 34e375c..cda1843 100644
--- a/test/validation/random/random.h
+++ b/test/validation/random/random.h
@@ -7,6 +7,18 @@
#ifndef _ODP_TEST_RANDOM_H_
#define _ODP_TEST_RANDOM_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void random_test_get_size(void);
+
+/* test arrays: */
+extern CU_TestInfo random_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo random_suites[];
+
+/* main test program: */
int random_main(void);
#endif
diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c
index fe03ab7..67a0782 100644
--- a/test/validation/scheduler/scheduler.c
+++ b/test/validation/scheduler/scheduler.c
@@ -75,7 +75,7 @@ static int exit_schedule_loop(void)
return ret;
}
-static void scheduler_test_wait_time(void)
+void scheduler_test_wait_time(void)
{
uint64_t wait_time;
@@ -88,7 +88,7 @@ static void scheduler_test_wait_time(void)
CU_ASSERT(wait_time > 0);
}
-static void scheduler_test_num_prio(void)
+void scheduler_test_num_prio(void)
{
int prio;
@@ -98,7 +98,7 @@ static void scheduler_test_num_prio(void)
CU_ASSERT(prio == odp_schedule_num_prio());
}
-static void scheduler_test_queue_destroy(void)
+void scheduler_test_queue_destroy(void)
{
odp_pool_t p;
odp_pool_param_t params;
@@ -365,25 +365,25 @@ static void parallel_execute(odp_schedule_sync_t sync, int num_queues,
}
/* 1 queue 1 thread ODP_SCHED_SYNC_NONE */
-static void scheduler_test_1q_1t_n(void)
+void scheduler_test_1q_1t_n(void)
{
schedule_common(ODP_SCHED_SYNC_NONE, ONE_Q, ONE_PRIO, SCHD_ONE);
}
/* 1 queue 1 thread ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_1q_1t_a(void)
+void scheduler_test_1q_1t_a(void)
{
schedule_common(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_ONE);
}
/* 1 queue 1 thread ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_1q_1t_o(void)
+void scheduler_test_1q_1t_o(void)
{
schedule_common(ODP_SCHED_SYNC_ORDERED, ONE_Q, ONE_PRIO, SCHD_ONE);
}
/* Many queues 1 thread ODP_SCHED_SYNC_NONE */
-static void scheduler_test_mq_1t_n(void)
+void scheduler_test_mq_1t_n(void)
{
/* Only one priority involved in these tests, but use
the same number of queues the more general case uses */
@@ -391,19 +391,19 @@ static void scheduler_test_mq_1t_n(void)
}
/* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_mq_1t_a(void)
+void scheduler_test_mq_1t_a(void)
{
schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_ONE);
}
/* Many queues 1 thread ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_mq_1t_o(void)
+void scheduler_test_mq_1t_o(void)
{
schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_ONE);
}
/* Many queues 1 thread check priority ODP_SCHED_SYNC_NONE */
-static void scheduler_test_mq_1t_prio_n(void)
+void scheduler_test_mq_1t_prio_n(void)
{
int prio = odp_schedule_num_prio();
@@ -411,7 +411,7 @@ static void scheduler_test_mq_1t_prio_n(void)
}
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_mq_1t_prio_a(void)
+void scheduler_test_mq_1t_prio_a(void)
{
int prio = odp_schedule_num_prio();
@@ -419,7 +419,7 @@ static void scheduler_test_mq_1t_prio_a(void)
}
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_mq_1t_prio_o(void)
+void scheduler_test_mq_1t_prio_o(void)
{
int prio = odp_schedule_num_prio();
@@ -427,7 +427,7 @@ static void scheduler_test_mq_1t_prio_o(void)
}
/* Many queues many threads check priority ODP_SCHED_SYNC_NONE */
-static void scheduler_test_mq_mt_prio_n(void)
+void scheduler_test_mq_mt_prio_n(void)
{
int prio = odp_schedule_num_prio();
@@ -436,7 +436,7 @@ static void scheduler_test_mq_mt_prio_n(void)
}
/* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC */
-static void scheduler_test_mq_mt_prio_a(void)
+void scheduler_test_mq_mt_prio_a(void)
{
int prio = odp_schedule_num_prio();
@@ -445,7 +445,7 @@ static void scheduler_test_mq_mt_prio_a(void)
}
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED */
-static void scheduler_test_mq_mt_prio_o(void)
+void scheduler_test_mq_mt_prio_o(void)
{
int prio = odp_schedule_num_prio();
@@ -454,32 +454,32 @@ static void scheduler_test_mq_mt_prio_o(void)
}
/* 1 queue many threads check exclusive access on ATOMIC queues */
-static void scheduler_test_1q_mt_a_excl(void)
+void scheduler_test_1q_mt_a_excl(void)
{
parallel_execute(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_ONE,
ENABLE_EXCL_ATOMIC);
}
/* 1 queue 1 thread ODP_SCHED_SYNC_NONE multi */
-static void scheduler_test_multi_1q_1t_n(void)
+void scheduler_test_multi_1q_1t_n(void)
{
schedule_common(ODP_SCHED_SYNC_NONE, ONE_Q, ONE_PRIO, SCHD_MULTI);
}
/* 1 queue 1 thread ODP_SCHED_SYNC_ATOMIC multi */
-static void scheduler_test_multi_1q_1t_a(void)
+void scheduler_test_multi_1q_1t_a(void)
{
schedule_common(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_MULTI);
}
/* 1 queue 1 thread ODP_SCHED_SYNC_ORDERED multi */
-static void scheduler_test_multi_1q_1t_o(void)
+void scheduler_test_multi_1q_1t_o(void)
{
schedule_common(ODP_SCHED_SYNC_ORDERED, ONE_Q, ONE_PRIO, SCHD_MULTI);
}
/* Many queues 1 thread ODP_SCHED_SYNC_NONE multi */
-static void scheduler_test_multi_mq_1t_n(void)
+void scheduler_test_multi_mq_1t_n(void)
{
/* Only one priority involved in these tests, but use
the same number of queues the more general case uses */
@@ -487,19 +487,19 @@ static void scheduler_test_multi_mq_1t_n(void)
}
/* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC multi */
-static void scheduler_test_multi_mq_1t_a(void)
+void scheduler_test_multi_mq_1t_a(void)
{
schedule_common(ODP_SCHED_SYNC_ATOMIC, MANY_QS, ONE_PRIO, SCHD_MULTI);
}
/* Many queues 1 thread ODP_SCHED_SYNC_ORDERED multi */
-static void scheduler_test_multi_mq_1t_o(void)
+void scheduler_test_multi_mq_1t_o(void)
{
schedule_common(ODP_SCHED_SYNC_ORDERED, MANY_QS, ONE_PRIO, SCHD_MULTI);
}
/* Many queues 1 thread check priority ODP_SCHED_SYNC_NONE multi */
-static void scheduler_test_multi_mq_1t_prio_n(void)
+void scheduler_test_multi_mq_1t_prio_n(void)
{
int prio = odp_schedule_num_prio();
@@ -507,7 +507,7 @@ static void scheduler_test_multi_mq_1t_prio_n(void)
}
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC multi */
-static void scheduler_test_multi_mq_1t_prio_a(void)
+void scheduler_test_multi_mq_1t_prio_a(void)
{
int prio = odp_schedule_num_prio();
@@ -515,7 +515,7 @@ static void scheduler_test_multi_mq_1t_prio_a(void)
}
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED multi */
-static void scheduler_test_multi_mq_1t_prio_o(void)
+void scheduler_test_multi_mq_1t_prio_o(void)
{
int prio = odp_schedule_num_prio();
@@ -523,7 +523,7 @@ static void scheduler_test_multi_mq_1t_prio_o(void)
}
/* Many queues many threads check priority ODP_SCHED_SYNC_NONE multi */
-static void scheduler_test_multi_mq_mt_prio_n(void)
+void scheduler_test_multi_mq_mt_prio_n(void)
{
int prio = odp_schedule_num_prio();
@@ -531,7 +531,7 @@ static void scheduler_test_multi_mq_mt_prio_n(void)
}
/* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC multi */
-static void scheduler_test_multi_mq_mt_prio_a(void)
+void scheduler_test_multi_mq_mt_prio_a(void)
{
int prio = odp_schedule_num_prio();
@@ -539,7 +539,7 @@ static void scheduler_test_multi_mq_mt_prio_a(void)
}
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED multi */
-static void scheduler_test_multi_mq_mt_prio_o(void)
+void scheduler_test_multi_mq_mt_prio_o(void)
{
int prio = odp_schedule_num_prio();
@@ -547,13 +547,13 @@ static void scheduler_test_multi_mq_mt_prio_o(void)
}
/* 1 queue many threads check exclusive access on ATOMIC queues multi */
-static void scheduler_test_multi_1q_mt_a_excl(void)
+void scheduler_test_multi_1q_mt_a_excl(void)
{
parallel_execute(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_MULTI,
ENABLE_EXCL_ATOMIC);
}
-static void scheduler_test_pause_resume(void)
+void scheduler_test_pause_resume(void)
{
odp_queue_t queue;
odp_buffer_t buf;
@@ -658,7 +658,7 @@ static int create_queues(void)
return 0;
}
-static int scheduler_suite_init(void)
+int scheduler_suite_init(void)
{
odp_cpumask_t mask;
odp_shm_t shm;
@@ -756,7 +756,7 @@ static int destroy_queues(void)
return 0;
}
-static int scheduler_suite_term(void)
+int scheduler_suite_term(void)
{
odp_pool_t pool;
@@ -772,7 +772,7 @@ static int scheduler_suite_term(void)
return 0;
}
-static struct CU_TestInfo scheduler_suite[] = {
+CU_TestInfo scheduler_suite[] = {
{"schedule_wait_time", scheduler_test_wait_time},
{"schedule_num_prio", scheduler_test_num_prio},
{"schedule_queue_destroy", scheduler_test_queue_destroy},
@@ -806,7 +806,7 @@ static struct CU_TestInfo scheduler_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo scheduler_suites[] = {
+CU_SuiteInfo scheduler_suites[] = {
{"Scheduler",
scheduler_suite_init, scheduler_suite_term, NULL, NULL, scheduler_suite
},
diff --git a/test/validation/scheduler/scheduler.h b/test/validation/scheduler/scheduler.h
index db0f289..31f02ca 100644
--- a/test/validation/scheduler/scheduler.h
+++ b/test/validation/scheduler/scheduler.h
@@ -7,6 +7,51 @@
#ifndef _ODP_TEST_SCHEDULER_H_
#define _ODP_TEST_SCHEDULER_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void scheduler_test_wait_time(void);
+void scheduler_test_num_prio(void);
+void scheduler_test_queue_destroy(void);
+void scheduler_test_1q_1t_n(void);
+void scheduler_test_1q_1t_a(void);
+void scheduler_test_1q_1t_o(void);
+void scheduler_test_mq_1t_n(void);
+void scheduler_test_mq_1t_a(void);
+void scheduler_test_mq_1t_o(void);
+void scheduler_test_mq_1t_prio_n(void);
+void scheduler_test_mq_1t_prio_a(void);
+void scheduler_test_mq_1t_prio_o(void);
+void scheduler_test_mq_mt_prio_n(void);
+void scheduler_test_mq_mt_prio_a(void);
+void scheduler_test_mq_mt_prio_o(void);
+void scheduler_test_1q_mt_a_excl(void);
+void scheduler_test_multi_1q_1t_n(void);
+void scheduler_test_multi_1q_1t_a(void);
+void scheduler_test_multi_1q_1t_o(void);
+void scheduler_test_multi_mq_1t_n(void);
+void scheduler_test_multi_mq_1t_a(void);
+void scheduler_test_multi_mq_1t_o(void);
+void scheduler_test_multi_mq_1t_prio_n(void);
+void scheduler_test_multi_mq_1t_prio_a(void);
+void scheduler_test_multi_mq_1t_prio_o(void);
+void scheduler_test_multi_mq_mt_prio_n(void);
+void scheduler_test_multi_mq_mt_prio_a(void);
+void scheduler_test_multi_mq_mt_prio_o(void);
+void scheduler_test_multi_1q_mt_a_excl(void);
+void scheduler_test_pause_resume(void);
+
+/* test arrays: */
+extern CU_TestInfo scheduler_suite[];
+
+/* test array init/term functions: */
+int scheduler_suite_init(void);
+int scheduler_suite_term(void);
+
+/* test registry: */
+extern CU_SuiteInfo scheduler_suites[];
+
+/* main test program: */
int scheduler_main(void);
#endif
diff --git a/test/validation/shmem/shmem.c b/test/validation/shmem/shmem.c
index 0c713c6..3abba0c 100644
--- a/test/validation/shmem/shmem.c
+++ b/test/validation/shmem/shmem.c
@@ -44,7 +44,7 @@ static void *run_shm_thread(void *arg)
return arg;
}
-static void shmem_test_odp_shm_sunnyday(void)
+void shmem_test_odp_shm_sunnyday(void)
{
pthrd_arg thrdarg;
odp_shm_t shm;
@@ -76,12 +76,12 @@ static void shmem_test_odp_shm_sunnyday(void)
odp_cunit_thread_exit(&thrdarg);
}
-static CU_TestInfo shmem_suite[] = {
+CU_TestInfo shmem_suite[] = {
{"test_odp_shm_creat", shmem_test_odp_shm_sunnyday},
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo shmem_suites[] = {
+CU_SuiteInfo shmem_suites[] = {
{"Shared Memory", NULL, NULL, NULL, NULL, shmem_suite},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/shmem/shmem.h b/test/validation/shmem/shmem.h
index f9cf523..8de0bc6 100644
--- a/test/validation/shmem/shmem.h
+++ b/test/validation/shmem/shmem.h
@@ -7,6 +7,18 @@
#ifndef _ODP_TEST_SHMEM_H_
#define _ODP_TEST_SHMEM_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void shmem_test_odp_shm_sunnyday(void);
+
+/* test arrays: */
+extern CU_TestInfo shmem_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo shmem_suites[];
+
+/* main test program: */
int shmem_main(void);
#endif
diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c
index ed56c8f..7c521ca 100644
--- a/test/validation/synchronizers/synchronizers.c
+++ b/test/validation/synchronizers/synchronizers.c
@@ -920,7 +920,7 @@ static void test_atomic_validate(void)
}
/* Barrier tests */
-static void synchronizers_test_no_barrier_functional(void)
+void synchronizers_test_no_barrier_functional(void)
{
pthrd_arg arg;
@@ -930,7 +930,7 @@ static void synchronizers_test_no_barrier_functional(void)
odp_cunit_thread_exit(&arg);
}
-static void synchronizers_test_barrier_functional(void)
+void synchronizers_test_barrier_functional(void)
{
pthrd_arg arg;
@@ -940,14 +940,14 @@ static void synchronizers_test_barrier_functional(void)
odp_cunit_thread_exit(&arg);
}
-static CU_TestInfo synchronizers_suite_barrier[] = {
+CU_TestInfo synchronizers_suite_barrier[] = {
{"no_barrier_functional", synchronizers_test_no_barrier_functional},
{"barrier_functional", synchronizers_test_barrier_functional},
CU_TEST_INFO_NULL
};
/* Thread-unsafe tests */
-static void synchronizers_test_no_lock_functional(void)
+void synchronizers_test_no_lock_functional(void)
{
pthrd_arg arg;
@@ -956,13 +956,13 @@ static void synchronizers_test_no_lock_functional(void)
odp_cunit_thread_exit(&arg);
}
-static CU_TestInfo synchronizers_suite_no_locking[] = {
+CU_TestInfo synchronizers_suite_no_locking[] = {
{"no_lock_functional", synchronizers_test_no_lock_functional},
CU_TEST_INFO_NULL
};
/* Spin lock tests */
-static void synchronizers_test_spinlock_api(void)
+void synchronizers_test_spinlock_api(void)
{
pthrd_arg arg;
@@ -971,7 +971,7 @@ static void synchronizers_test_spinlock_api(void)
odp_cunit_thread_exit(&arg);
}
-static void synchronizers_test_spinlock_functional(void)
+void synchronizers_test_spinlock_functional(void)
{
pthrd_arg arg;
@@ -981,14 +981,14 @@ static void synchronizers_test_spinlock_functional(void)
odp_cunit_thread_exit(&arg);
}
-static CU_TestInfo synchronizers_suite_spinlock[] = {
+CU_TestInfo synchronizers_suite_spinlock[] = {
{"spinlock_api", synchronizers_test_spinlock_api},
{"spinlock_functional", synchronizers_test_spinlock_functional},
CU_TEST_INFO_NULL
};
/* Ticket lock tests */
-static void synchronizers_test_ticketlock_api(void)
+void synchronizers_test_ticketlock_api(void)
{
pthrd_arg arg;
@@ -997,7 +997,7 @@ static void synchronizers_test_ticketlock_api(void)
odp_cunit_thread_exit(&arg);
}
-static void synchronizers_test_ticketlock_functional(void)
+void synchronizers_test_ticketlock_functional(void)
{
pthrd_arg arg;
@@ -1008,14 +1008,14 @@ static void synchronizers_test_ticketlock_functional(void)
odp_cunit_thread_exit(&arg);
}
-static CU_TestInfo synchronizers_suite_ticketlock[] = {
+CU_TestInfo synchronizers_suite_ticketlock[] = {
{"ticketlock_api", synchronizers_test_ticketlock_api},
{"ticketlock_functional", synchronizers_test_ticketlock_functional},
CU_TEST_INFO_NULL
};
/* RW lock tests */
-static void synchronizers_test_rwlock_api(void)
+void synchronizers_test_rwlock_api(void)
{
pthrd_arg arg;
@@ -1024,7 +1024,7 @@ static void synchronizers_test_rwlock_api(void)
odp_cunit_thread_exit(&arg);
}
-static void synchronizers_test_rwlock_functional(void)
+void synchronizers_test_rwlock_functional(void)
{
pthrd_arg arg;
@@ -1034,13 +1034,13 @@ static void synchronizers_test_rwlock_functional(void)
odp_cunit_thread_exit(&arg);
}
-static CU_TestInfo synchronizers_suite_rwlock[] = {
+CU_TestInfo synchronizers_suite_rwlock[] = {
{"rwlock_api", synchronizers_test_rwlock_api},
{"rwlock_functional", synchronizers_test_rwlock_functional},
CU_TEST_INFO_NULL
};
-static int synchronizers_suite_init(void)
+int synchronizers_suite_init(void)
{
uint32_t num_threads, idx;
@@ -1052,10 +1052,11 @@ static int synchronizers_suite_init(void)
return 0;
}
-static int synchronizers_init(void)
+int synchronizers_init(void)
{
- uint32_t core_count, max_threads;
+ uint32_t workers_count, max_threads;
int ret = 0;
+ odp_cpumask_t mask;
if (0 != odp_init_global(NULL, NULL)) {
fprintf(stderr, "error: odp_init_global() failed.\n");
@@ -1081,9 +1082,10 @@ static int synchronizers_init(void)
global_mem->g_iterations = MAX_ITERATIONS;
global_mem->g_verbose = VERBOSE;
- core_count = odp_cpu_count();
+ workers_count = odp_cpumask_def_worker(&mask, 0);
- max_threads = (core_count >= MAX_WORKERS) ? MAX_WORKERS : core_count;
+ max_threads = (workers_count >= MAX_WORKERS) ?
+ MAX_WORKERS : workers_count;
if (max_threads < global_mem->g_num_threads) {
printf("Requested num of threads is too large\n");
@@ -1164,27 +1166,27 @@ static void test_atomic_functional(void *func_ptr(void *))
test_atomic_validate();
}
-static void synchronizers_test_atomic_inc_dec(void)
+void synchronizers_test_atomic_inc_dec(void)
{
test_atomic_functional(test_atomic_inc_dec_thread);
}
-static void synchronizers_test_atomic_add_sub(void)
+void synchronizers_test_atomic_add_sub(void)
{
test_atomic_functional(test_atomic_add_sub_thread);
}
-static void synchronizers_test_atomic_fetch_inc_dec(void)
+void synchronizers_test_atomic_fetch_inc_dec(void)
{
test_atomic_functional(test_atomic_fetch_inc_dec_thread);
}
-static void synchronizers_test_atomic_fetch_add_sub(void)
+void synchronizers_test_atomic_fetch_add_sub(void)
{
test_atomic_functional(test_atomic_fetch_add_sub_thread);
}
-static CU_TestInfo synchronizers_suite_atomic[] = {
+CU_TestInfo synchronizers_suite_atomic[] = {
{"atomic_inc_dec", synchronizers_test_atomic_inc_dec},
{"atomic_add_sub", synchronizers_test_atomic_add_sub},
{"atomic_fetch_inc_dec", synchronizers_test_atomic_fetch_inc_dec},
@@ -1192,7 +1194,7 @@ static CU_TestInfo synchronizers_suite_atomic[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo synchronizers_suites[] = {
+CU_SuiteInfo synchronizers_suites[] = {
{"barrier", NULL,
NULL, NULL, NULL, synchronizers_suite_barrier},
{"nolocking", synchronizers_suite_init,
diff --git a/test/validation/synchronizers/synchronizers.h b/test/validation/synchronizers/synchronizers.h
index 8a93187..45b90e9 100644
--- a/test/validation/synchronizers/synchronizers.h
+++ b/test/validation/synchronizers/synchronizers.h
@@ -7,6 +7,41 @@
#ifndef _ODP_TEST_SYNCHRONIZERS_H_
#define _ODP_TEST_SYNCHRONIZERS_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void synchronizers_test_no_barrier_functional(void);
+void synchronizers_test_barrier_functional(void);
+void synchronizers_test_no_lock_functional(void);
+void synchronizers_test_spinlock_api(void);
+void synchronizers_test_spinlock_functional(void);
+void synchronizers_test_ticketlock_api(void);
+void synchronizers_test_ticketlock_functional(void);
+void synchronizers_test_rwlock_api(void);
+void synchronizers_test_rwlock_functional(void);
+void synchronizers_test_atomic_inc_dec(void);
+void synchronizers_test_atomic_add_sub(void);
+void synchronizers_test_atomic_fetch_inc_dec(void);
+void synchronizers_test_atomic_fetch_add_sub(void);
+
+/* test arrays: */
+extern CU_TestInfo synchronizers_suite_barrier[];
+extern CU_TestInfo synchronizers_suite_no_locking[];
+extern CU_TestInfo synchronizers_suite_spinlock[];
+extern CU_TestInfo synchronizers_suite_ticketlock[];
+extern CU_TestInfo synchronizers_suite_rwlock[];
+extern CU_TestInfo synchronizers_suite_atomic[];
+
+/* test array init/term functions: */
+int synchronizers_suite_init(void);
+
+/* test registry: */
+extern CU_SuiteInfo synchronizers_suites[];
+
+/* executable init/term functions: */
+int synchronizers_init(void);
+
+/* main test program: */
int synchronizers_main(void);
#endif
diff --git a/test/validation/system/system.c b/test/validation/system/system.c
index b80fd39..7687f20 100644
--- a/test/validation/system/system.c
+++ b/test/validation/system/system.c
@@ -10,7 +10,7 @@
#include "test_debug.h"
#include "system.h"
-static void system_test_odp_version_numbers(void)
+void system_test_odp_version_numbers(void)
{
int char_ok;
char version_string[128];
@@ -32,7 +32,7 @@ static void system_test_odp_version_numbers(void)
CU_ASSERT(char_ok);
}
-static void system_test_odp_cpu_count(void)
+void system_test_odp_cpu_count(void)
{
int cpus;
@@ -40,7 +40,7 @@ static void system_test_odp_cpu_count(void)
CU_ASSERT(0 < cpus);
}
-static void system_test_odp_sys_cache_line_size(void)
+void system_test_odp_sys_cache_line_size(void)
{
uint64_t cache_size;
@@ -49,7 +49,7 @@ static void system_test_odp_sys_cache_line_size(void)
CU_ASSERT(ODP_CACHE_LINE_SIZE == cache_size);
}
-static void system_test_odp_sys_cpu_model_str(void)
+void system_test_odp_sys_cpu_model_str(void)
{
char model[128];
@@ -58,7 +58,7 @@ static void system_test_odp_sys_cpu_model_str(void)
CU_ASSERT(strlen(model) < 127);
}
-static void system_test_odp_sys_page_size(void)
+void system_test_odp_sys_page_size(void)
{
uint64_t page;
@@ -67,7 +67,7 @@ static void system_test_odp_sys_page_size(void)
CU_ASSERT(ODP_PAGE_SIZE == page);
}
-static void system_test_odp_sys_huge_page_size(void)
+void system_test_odp_sys_huge_page_size(void)
{
uint64_t page;
@@ -75,7 +75,7 @@ static void system_test_odp_sys_huge_page_size(void)
CU_ASSERT(0 < page);
}
-static void system_test_odp_sys_cpu_hz(void)
+void system_test_odp_sys_cpu_hz(void)
{
uint64_t hz;
@@ -83,7 +83,7 @@ static void system_test_odp_sys_cpu_hz(void)
CU_ASSERT(0 < hz);
}
-static CU_TestInfo system_suite[] = {
+CU_TestInfo system_suite[] = {
{"odp version", system_test_odp_version_numbers},
{"odp_cpu_count", system_test_odp_cpu_count},
{"odp_sys_cache_line_size", system_test_odp_sys_cache_line_size},
@@ -94,7 +94,7 @@ static CU_TestInfo system_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo system_suites[] = {
+CU_SuiteInfo system_suites[] = {
{"System Info", NULL, NULL, NULL, NULL, system_suite},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/system/system.h b/test/validation/system/system.h
index f00ae57..c8bd2d4 100644
--- a/test/validation/system/system.h
+++ b/test/validation/system/system.h
@@ -7,6 +7,24 @@
#ifndef _ODP_TEST_SYSTEM_H_
#define _ODP_TEST_SYSTEM_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void system_test_odp_version_numbers(void);
+void system_test_odp_cpu_count(void);
+void system_test_odp_sys_cache_line_size(void);
+void system_test_odp_sys_cpu_model_str(void);
+void system_test_odp_sys_page_size(void);
+void system_test_odp_sys_huge_page_size(void);
+void system_test_odp_sys_cpu_hz(void);
+
+/* test arrays: */
+extern CU_TestInfo system_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo system_suites[];
+
+/* main test program: */
int system_main(void);
#endif
diff --git a/test/validation/thread/thread.c b/test/validation/thread/thread.c
index 6fbdaef..f95172a 100644
--- a/test/validation/thread/thread.c
+++ b/test/validation/thread/thread.c
@@ -17,19 +17,19 @@
odp_barrier_t bar_entry;
odp_barrier_t bar_exit;
-static void thread_test_odp_cpu_id(void)
+void thread_test_odp_cpu_id(void)
{
(void)odp_cpu_id();
CU_PASS();
}
-static void thread_test_odp_thread_id(void)
+void thread_test_odp_thread_id(void)
{
(void)odp_thread_id();
CU_PASS();
}
-static void thread_test_odp_thread_count(void)
+void thread_test_odp_thread_count(void)
{
(void)odp_thread_count();
CU_PASS();
@@ -48,7 +48,7 @@ static void *thread_func(void *arg TEST_UNUSED)
return NULL;
}
-static void thread_test_odp_thrmask_worker(void)
+void thread_test_odp_thrmask_worker(void)
{
odp_thrmask_t mask;
int ret;
@@ -85,7 +85,7 @@ static void thread_test_odp_thrmask_worker(void)
odp_cunit_thread_exit(&args);
}
-static void thread_test_odp_thrmask_control(void)
+void thread_test_odp_thrmask_control(void)
{
odp_thrmask_t mask;
int ret;
@@ -98,7 +98,7 @@ static void thread_test_odp_thrmask_control(void)
CU_ASSERT(ret == 1);
}
-static CU_TestInfo thread_suite[] = {
+CU_TestInfo thread_suite[] = {
_CU_TEST_INFO(thread_test_odp_cpu_id),
_CU_TEST_INFO(thread_test_odp_thread_id),
_CU_TEST_INFO(thread_test_odp_thread_count),
@@ -121,7 +121,7 @@ static CU_TestInfo thread_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo thread_suites[] = {
+CU_SuiteInfo thread_suites[] = {
{"thread", NULL, NULL, NULL, NULL, thread_suite},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/thread/thread.h b/test/validation/thread/thread.h
index c0cbb34..ef645b4 100644
--- a/test/validation/thread/thread.h
+++ b/test/validation/thread/thread.h
@@ -7,6 +7,27 @@
#ifndef _ODP_TEST_THREAD_H_
#define _ODP_TEST_THREAD_H_
+#include <odp.h>
+#include <CUnit/Basic.h>
+
+/* test functions: */
+#ifndef TEST_THRMASK
+#define TEST_THRMASK
+#endif
+#include "mask_common.h"
+void thread_test_odp_cpu_id(void);
+void thread_test_odp_thread_id(void);
+void thread_test_odp_thread_count(void);
+void thread_test_odp_thrmask_control(void);
+void thread_test_odp_thrmask_worker(void);
+
+/* test arrays: */
+extern CU_TestInfo thread_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo thread_suites[];
+
+/* main test program: */
int thread_main(void);
#endif
diff --git a/test/validation/time/time.c b/test/validation/time/time.c
index 0aac599..4fa2eaf 100644
--- a/test/validation/time/time.c
+++ b/test/validation/time/time.c
@@ -12,7 +12,7 @@
#define BUSY_LOOP_CNT 100
/* check that a cycles difference gives a reasonable result */
-static void time_test_odp_cycles_diff(void)
+void time_test_odp_cycles_diff(void)
{
/* volatile to stop optimization of busy loop */
volatile int count = 0;
@@ -32,7 +32,7 @@ static void time_test_odp_cycles_diff(void)
}
/* check that a negative cycles difference gives a reasonable result */
-static void time_test_odp_cycles_negative_diff(void)
+void time_test_odp_cycles_negative_diff(void)
{
uint64_t diff, cycles1, cycles2;
@@ -43,7 +43,7 @@ static void time_test_odp_cycles_negative_diff(void)
}
/* check that related conversions come back to the same value */
-static void time_test_odp_time_conversion(void)
+void time_test_odp_time_conversion(void)
{
uint64_t ns1, ns2, cycles;
uint64_t upper_limit, lower_limit;
@@ -68,7 +68,7 @@ CU_TestInfo time_suite_time[] = {
CU_TEST_INFO_NULL
};
-static CU_SuiteInfo time_suites[] = {
+CU_SuiteInfo time_suites[] = {
{"Time", NULL, NULL, NULL, NULL, time_suite_time},
CU_SUITE_INFO_NULL
};
diff --git a/test/validation/time/time.h b/test/validation/time/time.h
index 1cd54d9..1f69826 100644
--- a/test/validation/time/time.h
+++ b/test/validation/time/time.h
@@ -7,6 +7,20 @@
#ifndef _ODP_TEST_TIME_H_
#define _ODP_TEST_TIME_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void time_test_odp_cycles_diff(void);
+void time_test_odp_cycles_negative_diff(void);
+void time_test_odp_time_conversion(void);
+
+/* test arrays: */
+extern CU_TestInfo time_suite_time[];
+
+/* test registry: */
+extern CU_SuiteInfo time_suites[];
+
+/* main test program: */
int time_main(void);
#endif
diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 9d5b341..96d2425 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -50,7 +50,7 @@ struct test_timer {
#define TICK_INVALID (~(uint64_t)0)
-static void timer_test_timeout_pool_alloc(void)
+void timer_test_timeout_pool_alloc(void)
{
odp_pool_t pool;
const int num = 3;
@@ -94,7 +94,7 @@ static void timer_test_timeout_pool_alloc(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-static void timer_test_timeout_pool_free(void)
+void timer_test_timeout_pool_free(void)
{
odp_pool_t pool;
odp_timeout_t tmo;
@@ -125,7 +125,7 @@ static void timer_test_timeout_pool_free(void)
CU_ASSERT(odp_pool_destroy(pool) == 0);
}
-static void timer_test_odp_timer_cancel(void)
+void timer_test_odp_timer_cancel(void)
{
odp_pool_t pool;
odp_pool_param_t params;
@@ -436,7 +436,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
}
/* @private Timer test case entrypoint */
-static void timer_test_odp_timer_all(void)
+void timer_test_odp_timer_all(void)
{
int rc;
odp_pool_param_t params;
@@ -529,7 +529,7 @@ static void timer_test_odp_timer_all(void)
CU_PASS("ODP timer test");
}
-static CU_TestInfo timer_suite[] = {
+CU_TestInfo timer_suite[] = {
{"test_timeout_pool_alloc", timer_test_timeout_pool_alloc},
{"test_timeout_pool_free", timer_test_timeout_pool_free},
{"test_odp_timer_cancel", timer_test_odp_timer_cancel},
@@ -537,7 +537,7 @@ static CU_TestInfo timer_suite[] = {
CU_TEST_INFO_NULL,
};
-static CU_SuiteInfo timer_suites[] = {
+CU_SuiteInfo timer_suites[] = {
{"Timer", NULL, NULL, NULL, NULL, timer_suite},
CU_SUITE_INFO_NULL,
};
diff --git a/test/validation/timer/timer.h b/test/validation/timer/timer.h
index 5bdf908..3694671 100644
--- a/test/validation/timer/timer.h
+++ b/test/validation/timer/timer.h
@@ -7,6 +7,21 @@
#ifndef _ODP_TEST_TIMER_H_
#define _ODP_TEST_TIMER_H_
+#include <CUnit/Basic.h>
+
+/* test functions: */
+void timer_test_timeout_pool_alloc(void);
+void timer_test_timeout_pool_free(void);
+void timer_test_odp_timer_cancel(void);
+void timer_test_odp_timer_all(void);
+
+/* test arrays: */
+extern CU_TestInfo timer_suite[];
+
+/* test registry: */
+extern CU_SuiteInfo timer_suites[];
+
+/* main test program: */
int timer_main(void);
#endif