diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-27 15:50:59 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-08-27 15:50:59 +0300 |
commit | 8b077af2c3338166b24839ff42c47ab72f9fd538 (patch) | |
tree | 036efab84b8cdf2f12ba578a0078a74c1899ea39 | |
parent | 6d8b8abf3b3b4ab25f05612e495f25e6945cb617 (diff) | |
parent | c500935d7a946da32a8c0bf80b05b277dac75b34 (diff) |
Merge branch 'master' into api-next
49 files changed, 310 insertions, 197 deletions
@@ -12,6 +12,7 @@ .deps/ .dirstamp .libs/ +.scmversion CUnit-Memory-Dump.xml ID Makefile diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c index c1974dc..5c2eb06 100644 --- a/example/generator/odp_generator.c +++ b/example/generator/odp_generator.c @@ -43,6 +43,7 @@ */ typedef struct { int cpu_count; /**< system CPU count */ + const char *mask; /**< CPU mask */ int if_count; /**< Number of interfaces to be used */ char **if_names; /**< Array of pointers to interface names */ char *if_str; /**< Storage for interface names */ @@ -101,6 +102,7 @@ static void usage(char *progname); static int scan_ip(char *buf, unsigned int *paddr); static int scan_mac(char *in, odph_ethaddr_t *des); static void tv_sub(struct timeval *recvtime, struct timeval *sendtime); +static void print_global_stats(int num_workers); /** * Sleep for the specified amount of milliseconds @@ -376,7 +378,6 @@ 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; @@ -398,7 +399,6 @@ static void *gen_send_thread(void *arg) return NULL; } - start = odp_time_cycles(); printf(" [%02i] created mode: SEND\n", thr); for (;;) { int err; @@ -439,15 +439,6 @@ 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 */ @@ -465,15 +456,6 @@ static void *gen_send_thread(void *arg) } } - /* print info */ - if (args->appl.mode == APPL_MODE_UDP) { - printf(" [%02i] total send: %ju\n", - thr, odp_atomic_load_u64(&counters.seq)); - } else if (args->appl.mode == APPL_MODE_PING) { - printf(" [%02i] total send: %ju total receive: %ju\n", - thr, odp_atomic_load_u64(&counters.seq), - odp_atomic_load_u64(&counters.icmp)); - } return arg; } @@ -489,7 +471,6 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) odp_packet_t pkt; char *buf; odph_ipv4hdr_t *ip; - odph_udphdr_t *udp; odph_icmphdr_t *icmp; struct timeval tvrecv; struct timeval tvsend; @@ -507,20 +488,13 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) continue; odp_atomic_inc_u64(&counters.ip); - rlen += sprintf(msg, "receive Packet proto:IP "); buf = odp_packet_data(pkt); ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt)); - rlen += sprintf(msg + rlen, "id %d ", - odp_be_to_cpu_16(ip->id)); offset = odp_packet_l4_offset(pkt); /* udp */ if (ip->proto == ODPH_IPPROTO_UDP) { odp_atomic_inc_u64(&counters.udp); - udp = (odph_udphdr_t *)(buf + offset); - rlen += sprintf(msg + rlen, "UDP payload %d ", - odp_be_to_cpu_16(udp->length) - - ODPH_UDPHDR_LEN); } /* icmp */ @@ -544,10 +518,10 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len) rlen += sprintf(msg + rlen, "Icmp Echo Request"); } - } - msg[rlen] = '\0'; - printf(" [%02i] %s\n", thr, msg); + msg[rlen] = '\0'; + printf(" [%02i] %s\n", thr, msg); + } } } @@ -577,6 +551,12 @@ static void *gen_recv_thread(void *arg) printf(" [%02i] created mode: RECEIVE\n", thr); for (;;) { + if (args->appl.number != -1 && + odp_atomic_load_u64(&counters.icmp) >= + (unsigned int)args->appl.number) { + break; + } + /* Use schedule to get buf from any input queue */ ev = odp_schedule(NULL, ODP_SCHED_WAIT); @@ -594,6 +574,64 @@ static void *gen_recv_thread(void *arg) return arg; } + +/** + * printing verbose statistics + * + */ +static void print_global_stats(int num_workers) +{ + uint64_t start, now, diff; + uint64_t pkts, pkts_prev = 0, pps, maximum_pps = 0; + int verbose_interval = 20; + odp_thrmask_t thrd_mask; + + while (odp_thrmask_worker(&thrd_mask) < num_workers) + continue; + + start = odp_time_cycles(); + + while (odp_thrmask_worker(&thrd_mask) == num_workers) { + if (args->appl.number != -1 && + odp_atomic_load_u64(&counters.seq) >= + (unsigned int)args->appl.number) { + break; + } + + now = odp_time_cycles(); + diff = odp_time_diff_cycles(start, now); + if (odp_time_cycles_to_ns(diff) < + verbose_interval * ODP_TIME_SEC) { + continue; + } + + start = odp_time_cycles(); + + if (args->appl.mode == APPL_MODE_RCV) { + pkts = odp_atomic_load_u64(&counters.udp); + printf(" total receive(UDP: %" PRIu64 ")\n", pkts); + continue; + } + + if (args->appl.mode == APPL_MODE_PING) { + pkts = odp_atomic_load_u64(&counters.icmp); + printf(" total receive(ICMP: %" PRIu64 ")\n", pkts); + } + + pkts = odp_atomic_load_u64(&counters.seq); + printf(" total sent: %" PRIu64 "\n", pkts); + + if (args->appl.mode == APPL_MODE_UDP) { + pps = (pkts - pkts_prev) / verbose_interval; + if (pps > maximum_pps) + maximum_pps = pps; + printf(" %" PRIu64 " pps, %" PRIu64 " max pps\n", + pps, maximum_pps); + pkts_prev = pkts; + } + } +} + /** * ODP packet example main function */ @@ -650,18 +688,28 @@ int main(int argc, char *argv[]) if (args->appl.cpu_count) num_workers = args->appl.cpu_count; - /* ping mode need two worker */ - if (args->appl.mode == APPL_MODE_PING) - num_workers = 2; - - /* Get default worker cpumask */ num_workers = odp_cpumask_def_worker(&cpumask, num_workers); + if (args->appl.mask) { + odp_cpumask_from_str(&cpumask, args->appl.mask); + num_workers = odp_cpumask_count(&cpumask); + } + (void)odp_cpumask_to_str(&cpumask, cpumaskstr, sizeof(cpumaskstr)); printf("num worker threads: %i\n", num_workers); printf("first CPU: %i\n", odp_cpumask_first(&cpumask)); printf("cpu mask: %s\n", cpumaskstr); + /* ping mode need two workers */ + if (args->appl.mode == APPL_MODE_PING) { + if (num_workers < 2) { + EXAMPLE_ERR("Need at least two worker threads\n"); + exit(EXIT_FAILURE); + } else { + num_workers = 2; + } + } + /* Create packet pool */ odp_pool_param_init(¶ms); params.pkt.seg_len = SHM_PKT_POOL_BUF_SIZE; @@ -709,12 +757,13 @@ int main(int argc, char *argv[]) memset(thread_tbl, 0, sizeof(thread_tbl)); if (args->appl.mode == APPL_MODE_PING) { - odp_cpumask_t cpu0_mask; + odp_cpumask_t cpu_mask; odp_queue_t tq; + int cpu_first, cpu_next; - /* Previous code forced both threads to CPU 0 */ - odp_cpumask_zero(&cpu0_mask); - odp_cpumask_set(&cpu0_mask, 0); + odp_cpumask_zero(&cpu_mask); + cpu_first = odp_cpumask_first(&cpumask); + odp_cpumask_set(&cpu_mask, cpu_first); tq = odp_queue_create("", ODP_QUEUE_TYPE_POLL, NULL); if (tq == ODP_QUEUE_INVALID) @@ -730,7 +779,7 @@ int main(int argc, char *argv[]) if (args->thread[1].tmo_ev == ODP_TIMEOUT_INVALID) abort(); args->thread[1].mode = args->appl.mode; - odph_linux_pthread_create(&thread_tbl[1], &cpu0_mask, + odph_linux_pthread_create(&thread_tbl[1], &cpu_mask, gen_recv_thread, &args->thread[1]); tq = odp_queue_create("", ODP_QUEUE_TYPE_POLL, NULL); @@ -747,11 +796,12 @@ int main(int argc, char *argv[]) if (args->thread[0].tmo_ev == ODP_TIMEOUT_INVALID) abort(); args->thread[0].mode = args->appl.mode; - odph_linux_pthread_create(&thread_tbl[0], &cpu0_mask, + cpu_next = odp_cpumask_next(&cpumask, cpu_first); + odp_cpumask_zero(&cpu_mask); + odp_cpumask_set(&cpu_mask, cpu_next); + odph_linux_pthread_create(&thread_tbl[0], &cpu_mask, gen_send_thread, &args->thread[0]); - /* only wait send thread to join */ - num_workers = 1; } else { int cpu = odp_cpumask_first(&cpumask); for (i = 0; i < num_workers; ++i) { @@ -801,6 +851,8 @@ int main(int argc, char *argv[]) } } + print_global_stats(num_workers); + /* Master thread waits for other threads to exit */ odph_linux_pthread_join(thread_tbl, num_workers); @@ -825,15 +877,17 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) int long_index; char *token; size_t len; - int i; + odp_cpumask_t cpumask, cpumask_args, cpumask_and; + int i, num_workers; static struct option longopts[] = { {"interface", required_argument, NULL, 'I'}, {"workers", required_argument, NULL, 'w'}, + {"cpumask", required_argument, NULL, 'c'}, {"srcmac", required_argument, NULL, 'a'}, {"dstmac", required_argument, NULL, 'b'}, - {"srcip", required_argument, NULL, 'c'}, + {"srcip", required_argument, NULL, 's'}, {"dstip", required_argument, NULL, 'd'}, - {"packetsize", required_argument, NULL, 's'}, + {"packetsize", required_argument, NULL, 'p'}, {"mode", required_argument, NULL, 'm'}, {"count", required_argument, NULL, 'n'}, {"timeout", required_argument, NULL, 't'}, @@ -848,8 +902,8 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) appl_args->timeout = -1; while (1) { - opt = getopt_long(argc, argv, "+I:a:b:c:d:s:i:m:n:t:w:h", - longopts, &long_index); + opt = getopt_long(argc, argv, "+I:a:b:s:d:p:i:m:n:t:w:c:h", + longopts, &long_index); if (opt == -1) break; /* No more options */ @@ -857,6 +911,18 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) case 'w': appl_args->cpu_count = atoi(optarg); break; + case 'c': + appl_args->mask = optarg; + odp_cpumask_from_str(&cpumask_args, args->appl.mask); + num_workers = odp_cpumask_def_worker(&cpumask, 0); + odp_cpumask_and(&cpumask_and, &cpumask_args, &cpumask); + if (odp_cpumask_count(&cpumask_and) < + odp_cpumask_count(&cpumask_args)) { + EXAMPLE_ERR("Wrong cpu mask, max cpu's:%d\n", + num_workers); + exit(EXIT_FAILURE); + } + break; /* parse packet-io interface names */ case 'I': len = strlen(optarg); @@ -925,7 +991,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) } break; - case 'c': + case 's': if (scan_ip(optarg, &appl_args->srcip) != 1) { EXAMPLE_ERR("wrong src ip:%s\n", optarg); exit(EXIT_FAILURE); @@ -939,7 +1005,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) } break; - case 's': + case 'p': appl_args->payload = atoi(optarg); break; @@ -1032,26 +1098,29 @@ static void usage(char *progname) " 2.receive udp packets\n" " odp_generator -I eth0 -m r\n" " 3.work likes ping\n" - " odp_generator -I eth0 --srcmac fe:0f:97:c9:e0:44 --dstmac 32:cb:9b:27:2f:1a --srcip 192.168.0.1 --dstip 192.168.0.2 -m p\n" + " odp_generator -I eth0 --srcmac fe:0f:97:c9:e0:44 --dstmac 32:cb:9b:27:2f:1a --srcip 192.168.0.1 --dstip 192.168.0.2 --cpumask 0xc -m p\n" "\n" "Mandatory OPTIONS:\n" " -I, --interface Eth interfaces (comma-separated, no spaces)\n" " -a, --srcmac src mac address\n" " -b, --dstmac dst mac address\n" - " -c, --srcip src ip address\n" + " -s, --srcip src ip address\n" " -d, --dstip dst ip address\n" - " -s, --packetsize payload length of the packets\n" " -m, --mode work mode: send udp(u), receive(r), send icmp(p)\n" - " -n, --count the number of packets to be send\n" - " -t, --timeout only for ping mode, wait ICMP reply timeout seconds\n" - " -i, --interval wait interval ms between sending each packet\n" - " default is 1000ms. 0 for flood mode\n" "\n" "Optional OPTIONS\n" " -h, --help Display help and exit.\n" " environment variables: ODP_PKTIO_DISABLE_SOCKET_MMAP\n" " ODP_PKTIO_DISABLE_SOCKET_MMSG\n" " can be used to advanced pkt I/O selection for linux-generic\n" + " -p, --packetsize payload length of the packets\n" + " -t, --timeout only for ping mode, wait ICMP reply timeout seconds\n" + " -i, --interval wait interval ms between sending each packet\n" + " default is 1000ms. 0 for flood mode\n" + " -w, --workers specify number of workers need to be assigned to application\n" + " default is to assign all\n" + " -n, --count the number of packets to be send\n" + " -c, --cpumask to set on cores\n" "\n", NO_PATH(progname), NO_PATH(progname) ); } diff --git a/platform/Makefile.inc b/platform/Makefile.inc index f64e37c..8e8e97b 100644 --- a/platform/Makefile.inc +++ b/platform/Makefile.inc @@ -12,6 +12,6 @@ lib_LTLIBRARIES = $(LIB)/libodp.la AM_LDFLAGS += -version-number '$(ODP_LIBSO_VERSION)' -GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh` +GIT_DESC = `$(top_srcdir)/scripts/git_hash.sh $(top_srcdir)` AM_CFLAGS += "-DGIT_HASH=$(GIT_DESC)" AM_CFLAGS += -DPLATFORM=${with_platform} diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 0763c30..f2c081a 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -1,3 +1,6 @@ +# Uncomment this if you need to change the CUSTOM_STR string +#export CUSTOM_STR=https://git.linaro.org/lng/odp.git + include $(top_srcdir)/platform/Makefile.inc AM_CFLAGS += -I$(srcdir)/include diff --git a/platform/linux-generic/test/pktio/pktio_run b/platform/linux-generic/test/pktio/pktio_run index 76a8419..4860455 100755 --- a/platform/linux-generic/test/pktio/pktio_run +++ b/platform/linux-generic/test/pktio/pktio_run @@ -46,9 +46,8 @@ run_test() { local ret=0 - # the linux-generic implementation uses environment variables to - # control which socket method is used, so try each combination to - # ensure decent coverage. + # environment variables are used to control which socket method is + # used, so try each combination to ensure decent coverage. for distype in MMAP MMSG; do unset ODP_PKTIO_DISABLE_SOCKET_${distype} done @@ -67,26 +66,34 @@ run_test() echo "!!! FAILED !!!" fi - exit $ret + return $ret } run() { - #need to be root to set the interface: if not, run with default loopback. + echo "pktio: using 'loop' device" + pktio_main${EXEEXT} + loop_ret=$? + + # need to be root to run tests with real interfaces if [ "$(id -u)" != "0" ]; then - echo "pktio: using 'loop' device" - pktio_main${EXEEXT} - exit $? + exit $ret fi if [ "$ODP_PKTIO_IF0" = "" ]; then - # no interfaces specified on linux-generic, use defaults + # no interfaces specified, use default veth interfaces + # setup by the pktio_env script setup_pktio_env clean export ODP_PKTIO_IF0=$IF0 export ODP_PKTIO_IF1=$IF1 fi run_test + ret=$? + + [ $ret = 0 ] && ret=$loop_ret + + exit $ret } case "$1" in diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 617eadc..431e537 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = git_hash.sh odp_version.sh +EXTRA_DIST = git_hash.sh odp_version.sh ../.scmversion diff --git a/scripts/git_hash.sh b/scripts/git_hash.sh index c9f1faf..6cfec2f 100755 --- a/scripts/git_hash.sh +++ b/scripts/git_hash.sh @@ -1,9 +1,19 @@ #!/bin/bash -repo=https://git.linaro.org/lng/odp.git -hash=$(git describe | tr -d "\n") -if git diff-index --name-only HEAD &>/dev/null ; then - dirty=-dirty +if [ -z ${1} ]; then + echo "should be called with a path" + exit fi +ROOTDIR=${1} -echo -n "'${repo}' (${hash}${dirty})" +CUSTOM_STR=${CUSTOM_STR:-https://git.linaro.org/lng/odp.git} +if [ -d ${ROOTDIR}/.git ]; then + hash=$(git describe | tr -d "\n") + if git diff-index --name-only HEAD &>/dev/null ; then + dirty=-dirty + fi + + echo -n "'${CUSTOM_STR}' (${hash}${dirty})">${ROOTDIR}/.scmversion +fi + +cat ${ROOTDIR}/.scmversion diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am index ae2973e..721615b 100644 --- a/test/performance/Makefile.am +++ b/test/performance/Makefile.am @@ -27,3 +27,5 @@ noinst_HEADERS = \ dist_odp_atomic_SOURCES = odp_atomic.c dist_odp_scheduling_SOURCES = odp_scheduling.c dist_odp_pktio_perf_SOURCES = odp_pktio_perf.c + +EXTRA_DIST = $(TESTSCRIPTS) diff --git a/test/validation/buffer/Makefile.am b/test/validation/buffer/Makefile.am index e1b1233..05da40b 100644 --- a/test/validation/buffer/Makefile.am +++ b/test/validation/buffer/Makefile.am @@ -6,3 +6,5 @@ libbuffer_la_SOURCES = buffer.c bin_PROGRAMS = buffer_main$(EXEEXT) dist_buffer_main_SOURCES = buffer_main.c buffer_main_LDADD = libbuffer.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = buffer.h diff --git a/test/validation/buffer/buffer.c b/test/validation/buffer/buffer.c index 52585b9..c62938d 100644 --- a/test/validation/buffer/buffer.c +++ b/test/validation/buffer/buffer.c @@ -8,9 +8,6 @@ #include "odp_cunit_common.h" #include "buffer.h" -/* Helper macro for CU_TestInfo initialization */ -#define _CU_TEST_INFO(test_func) {#test_func, test_func} - static odp_pool_t raw_pool; static odp_buffer_t raw_buffer = ODP_BUFFER_INVALID; static const size_t raw_buffer_size = 1500; diff --git a/test/validation/classification/Makefile.am b/test/validation/classification/Makefile.am index ba468fa..7ab1dd9 100644 --- a/test/validation/classification/Makefile.am +++ b/test/validation/classification/Makefile.am @@ -8,3 +8,5 @@ libclassification_la_SOURCES = odp_classification_basic.c \ bin_PROGRAMS = classification_main$(EXEEXT) dist_classification_main_SOURCES = classification_main.c classification_main_LDADD = libclassification.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = classification.h odp_classification_testsuites.h diff --git a/test/validation/classification/odp_classification_basic.c b/test/validation/classification/odp_classification_basic.c index 79c775e..3ae0128 100644 --- a/test/validation/classification/odp_classification_basic.c +++ b/test/validation/classification/odp_classification_basic.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <odp_cunit_common.h> #include "odp_classification_testsuites.h" #include "classification.h" diff --git a/test/validation/classification/odp_classification_tests.c b/test/validation/classification/odp_classification_tests.c index c44ceb9..e22d00d 100644 --- a/test/validation/classification/odp_classification_tests.c +++ b/test/validation/classification/odp_classification_tests.c @@ -411,6 +411,7 @@ void configure_cls_pmr_chain(void) retval = odp_cos_set_queue(cos_list[CLS_PMR_CHAIN_DST], queue_list[CLS_PMR_CHAIN_DST]); + CU_ASSERT(retval == 0); parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask); pmr_list[CLS_PMR_CHAIN_SRC] = odp_pmr_create(ODP_PMR_SIP_ADDR, &addr, diff --git a/test/validation/classification/odp_classification_testsuites.h b/test/validation/classification/odp_classification_testsuites.h index f603f30..37c019d 100644 --- a/test/validation/classification/odp_classification_testsuites.h +++ b/test/validation/classification/odp_classification_testsuites.h @@ -11,9 +11,6 @@ #include <CUnit/CUnit.h> #include <CUnit/Basic.h> -/* Helper macro for CU_TestInfo initialization */ -#define _CU_TEST_INFO(test_func) {#test_func, test_func} - extern CU_TestInfo classification_suite[]; extern CU_TestInfo classification_suite_basic[]; diff --git a/test/validation/common/Makefile.am b/test/validation/common/Makefile.am index 2cb0956..fd41fb4 100644 --- a/test/validation/common/Makefile.am +++ b/test/validation/common/Makefile.am @@ -9,3 +9,5 @@ libcpumask_common_la_SOURCES = mask_common.c libthrmask_common_la_SOURCES = mask_common.c libthrmask_common_la_CFLAGS = $(AM_CFLAGS) -DTEST_THRMASK + +EXTRA_DIST = mask_common.h odp_cunit_common.h diff --git a/test/validation/common/mask_common.c b/test/validation/common/mask_common.c index fce7725..9b1a23f 100644 --- a/test/validation/common/mask_common.c +++ b/test/validation/common/mask_common.c @@ -145,6 +145,7 @@ MASK_TESTFUNC(to_from_str) str_sz = _odp_mask_to_str(&mask, buf_out, stringlen(TEST_MASK_0) + 1); + CU_ASSERT(str_sz == (int32_t)stringlen(TEST_MASK_0) + 1); CU_ASSERT_NSTRING_EQUAL(buf_out, TEST_MASK_0, stringlen(TEST_MASK_0) + 1); diff --git a/test/validation/common/odp_cunit_common.h b/test/validation/common/odp_cunit_common.h index 7c2a9dd..6cafaaa 100644 --- a/test/validation/common/odp_cunit_common.h +++ b/test/validation/common/odp_cunit_common.h @@ -21,6 +21,9 @@ /* the function, called by module main(), to run the testsuites: */ int odp_cunit_run(CU_SuiteInfo testsuites[]); +/* the macro used to have test names (strings) matching function symbols */ +#define _CU_TEST_INFO(test_func) {#test_func, test_func} + typedef struct { uint32_t foo; uint32_t bar; diff --git a/test/validation/cpumask/Makefile.am b/test/validation/cpumask/Makefile.am index 795d9ff..5a05c7a 100644 --- a/test/validation/cpumask/Makefile.am +++ b/test/validation/cpumask/Makefile.am @@ -7,3 +7,5 @@ libcpumask_la_LIBADD = $(LIBCPUMASK_COMMON) bin_PROGRAMS = cpumask_main$(EXEEXT) dist_cpumask_main_SOURCES = cpumask_main.c cpumask_main_LDADD = libcpumask.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = cpumask.h diff --git a/test/validation/cpumask/cpumask.c b/test/validation/cpumask/cpumask.c index 029baad..6d57028 100644 --- a/test/validation/cpumask/cpumask.c +++ b/test/validation/cpumask/cpumask.c @@ -73,24 +73,24 @@ void cpumask_test_odp_cpumask_def(void) } 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}, - {"odp_cpumask_set()", cpumask_test_odp_cpumask_set}, - {"odp_cpumask_clr()", cpumask_test_odp_cpumask_clr}, - {"odp_cpumask_isset()", cpumask_test_odp_cpumask_isset}, - {"odp_cpumask_count()", cpumask_test_odp_cpumask_count}, - {"odp_cpumask_and()", cpumask_test_odp_cpumask_and}, - {"odp_cpumask_or()", cpumask_test_odp_cpumask_or}, - {"odp_cpumask_xor()", cpumask_test_odp_cpumask_xor}, - {"odp_cpumask_copy()", cpumask_test_odp_cpumask_copy}, - {"odp_cpumask_first()", cpumask_test_odp_cpumask_first}, - {"odp_cpumask_last()", cpumask_test_odp_cpumask_last}, - {"odp_cpumask_next()", cpumask_test_odp_cpumask_next}, - {"odp_cpumask_setall()", cpumask_test_odp_cpumask_setall}, - {"odp_cpumask_def_control()", cpumask_test_odp_cpumask_def_control}, - {"odp_cpumask_def_worker()", cpumask_test_odp_cpumask_def_worker}, - {"odp_cpumask_def()", cpumask_test_odp_cpumask_def}, + _CU_TEST_INFO(cpumask_test_odp_cpumask_to_from_str), + _CU_TEST_INFO(cpumask_test_odp_cpumask_equal), + _CU_TEST_INFO(cpumask_test_odp_cpumask_zero), + _CU_TEST_INFO(cpumask_test_odp_cpumask_set), + _CU_TEST_INFO(cpumask_test_odp_cpumask_clr), + _CU_TEST_INFO(cpumask_test_odp_cpumask_isset), + _CU_TEST_INFO(cpumask_test_odp_cpumask_count), + _CU_TEST_INFO(cpumask_test_odp_cpumask_and), + _CU_TEST_INFO(cpumask_test_odp_cpumask_or), + _CU_TEST_INFO(cpumask_test_odp_cpumask_xor), + _CU_TEST_INFO(cpumask_test_odp_cpumask_copy), + _CU_TEST_INFO(cpumask_test_odp_cpumask_first), + _CU_TEST_INFO(cpumask_test_odp_cpumask_last), + _CU_TEST_INFO(cpumask_test_odp_cpumask_next), + _CU_TEST_INFO(cpumask_test_odp_cpumask_setall), + _CU_TEST_INFO(cpumask_test_odp_cpumask_def_control), + _CU_TEST_INFO(cpumask_test_odp_cpumask_def_worker), + _CU_TEST_INFO(cpumask_test_odp_cpumask_def), CU_TEST_INFO_NULL, }; diff --git a/test/validation/crypto/Makefile.am b/test/validation/crypto/Makefile.am index 6c7a94b..ee04d34 100644 --- a/test/validation/crypto/Makefile.am +++ b/test/validation/crypto/Makefile.am @@ -7,3 +7,5 @@ libcrypto_la_SOURCES = crypto.c \ bin_PROGRAMS = crypto_main$(EXEEXT) dist_crypto_main_SOURCES = crypto_main.c crypto_main_LDADD = libcrypto.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = crypto.h odp_crypto_test_inp.h test_vectors.h test_vectors_len.h diff --git a/test/validation/crypto/odp_crypto_test_inp.c b/test/validation/crypto/odp_crypto_test_inp.c index 90fe8d0..187a04c 100644 --- a/test/validation/crypto/odp_crypto_test_inp.c +++ b/test/validation/crypto/odp_crypto_test_inp.c @@ -6,6 +6,7 @@ #include <odp.h> #include <CUnit/Basic.h> +#include <odp_cunit_common.h> #include "test_vectors.h" #include "odp_crypto_test_inp.h" #include "crypto.h" @@ -132,7 +133,6 @@ cleanup: * operation for 3DES_CBC algorithm. IV for the operation is the session IV. * 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" void crypto_test_enc_alg_3des_cbc(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, @@ -165,7 +165,6 @@ void crypto_test_enc_alg_3des_cbc(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * 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" void crypto_test_enc_alg_3des_cbc_ovr_iv(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, @@ -199,7 +198,6 @@ void crypto_test_enc_alg_3des_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -#define ASYNC_INP_DEC_ALG_3DES_CBC "DEC_ALG_3DES_CBC" void crypto_test_dec_alg_3des_cbc(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, @@ -234,7 +232,6 @@ void crypto_test_dec_alg_3des_cbc(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -#define ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV "DEC_ALG_3DES_CBC_OVR_IV" void crypto_test_dec_alg_3des_cbc_ovr_iv(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, @@ -270,7 +267,6 @@ void crypto_test_dec_alg_3des_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -#define ASYNC_INP_ALG_HMAC_MD5 "ALG_HMAC_MD5" void crypto_test_alg_hmac_md5(void) { odp_crypto_key_t cipher_key = { .data = NULL, .length = 0 }, @@ -324,12 +320,10 @@ int crypto_suite_async_init(void) } CU_TestInfo crypto_suite[] = { - {ASYNC_INP_ENC_ALG_3DES_CBC, crypto_test_enc_alg_3des_cbc }, - {ASYNC_INP_DEC_ALG_3DES_CBC, crypto_test_dec_alg_3des_cbc }, - {ASYNC_INP_ENC_ALG_3DES_CBC_OVR_IV, - crypto_test_enc_alg_3des_cbc_ovr_iv }, - {ASYNC_INP_DEC_ALG_3DES_CBC_OVR_IV, - crypto_test_dec_alg_3des_cbc_ovr_iv }, - {ASYNC_INP_ALG_HMAC_MD5, crypto_test_alg_hmac_md5 }, + _CU_TEST_INFO(crypto_test_enc_alg_3des_cbc), + _CU_TEST_INFO(crypto_test_dec_alg_3des_cbc), + _CU_TEST_INFO(crypto_test_enc_alg_3des_cbc_ovr_iv), + _CU_TEST_INFO(crypto_test_dec_alg_3des_cbc_ovr_iv), + _CU_TEST_INFO(crypto_test_alg_hmac_md5), CU_TEST_INFO_NULL, }; diff --git a/test/validation/errno/Makefile.am b/test/validation/errno/Makefile.am index ab3ef88..44575d9 100644 --- a/test/validation/errno/Makefile.am +++ b/test/validation/errno/Makefile.am @@ -6,3 +6,5 @@ liberrno_la_SOURCES = errno.c bin_PROGRAMS = errno_main$(EXEEXT) dist_errno_main_SOURCES = errno_main.c errno_main_LDADD = liberrno.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = errno.h diff --git a/test/validation/errno/errno.c b/test/validation/errno/errno.c index 9b6b125..c4f4aab 100644 --- a/test/validation/errno/errno.c +++ b/test/validation/errno/errno.c @@ -20,7 +20,7 @@ void errno_test_odp_errno_sunny_day(void) } CU_TestInfo errno_suite[] = { - {"sunny day", errno_test_odp_errno_sunny_day}, + _CU_TEST_INFO(errno_test_odp_errno_sunny_day), CU_TEST_INFO_NULL, }; diff --git a/test/validation/init/Makefile.am b/test/validation/init/Makefile.am index a54e29a..51cb4ad 100644 --- a/test/validation/init/Makefile.am +++ b/test/validation/init/Makefile.am @@ -12,3 +12,5 @@ dist_init_main_ok_SOURCES = init_main_ok.c init_main_abort_LDADD = libinit.la $(LIBCUNIT_COMMON) $(LIBODP) init_main_log_LDADD = libinit.la $(LIBCUNIT_COMMON) $(LIBODP) init_main_ok_LDADD = libinit.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = init.h diff --git a/test/validation/init/init.c b/test/validation/init/init.c index 12aa554..ee4483c 100644 --- a/test/validation/init/init.c +++ b/test/validation/init/init.c @@ -38,7 +38,7 @@ void init_test_odp_init_global_replace_abort(void) } CU_TestInfo init_suite_abort[] = { - {"replace abort", init_test_odp_init_global_replace_abort}, + _CU_TEST_INFO(init_test_odp_init_global_replace_abort), CU_TEST_INFO_NULL, }; @@ -83,7 +83,7 @@ void init_test_odp_init_global_replace_log(void) } CU_TestInfo init_suite_log[] = { - {"replace log", init_test_odp_init_global_replace_log}, + _CU_TEST_INFO(init_test_odp_init_global_replace_log), CU_TEST_INFO_NULL, }; @@ -131,7 +131,7 @@ void init_test_odp_init_global(void) } CU_TestInfo init_suite_ok[] = { - {"test_odp_init_global", init_test_odp_init_global}, + _CU_TEST_INFO(init_test_odp_init_global), CU_TEST_INFO_NULL, }; diff --git a/test/validation/packet/Makefile.am b/test/validation/packet/Makefile.am index 7ba7a47..9c783d5 100644 --- a/test/validation/packet/Makefile.am +++ b/test/validation/packet/Makefile.am @@ -6,3 +6,5 @@ libpacket_la_SOURCES = packet.c bin_PROGRAMS = packet_main$(EXEEXT) dist_packet_main_SOURCES = packet_main.c packet_main_LDADD = libpacket.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = packet.h diff --git a/test/validation/packet/packet.c b/test/validation/packet/packet.c index 99a6745..97ffd14 100644 --- a/test/validation/packet/packet.c +++ b/test/validation/packet/packet.c @@ -10,9 +10,6 @@ #include "odp_cunit_common.h" #include "packet.h" -/* Helper macro for CU_TestInfo initialization */ -#define _CU_TEST_INFO(test_func) {#test_func, test_func} - #define PACKET_BUF_LEN ODP_CONFIG_PACKET_SEG_LEN_MIN /* Reserve some tailroom for tests */ #define PACKET_TAILROOM_RESERVE 4 diff --git a/test/validation/pktio/Makefile.am b/test/validation/pktio/Makefile.am index 86127a1..37efeaa 100644 --- a/test/validation/pktio/Makefile.am +++ b/test/validation/pktio/Makefile.am @@ -6,3 +6,5 @@ libpktio_la_SOURCES = pktio.c bin_PROGRAMS = pktio_main$(EXEEXT) dist_pktio_main_SOURCES = pktio_main.c pktio_main_LDADD = libpktio.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = pktio.h diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c index 33a672a..82f8b13 100644 --- a/test/validation/pktio/pktio.c +++ b/test/validation/pktio/pktio.c @@ -750,18 +750,18 @@ int pktio_suite_term(void) } CU_TestInfo pktio_suite_unsegmented[] = { - {"pktio open", pktio_test_open}, - {"pktio lookup", pktio_test_lookup}, - {"pktio inq", pktio_test_inq}, - {"pktio poll queues", pktio_test_poll_queue}, - {"pktio poll multi", pktio_test_poll_multi}, - {"pktio sched queues", pktio_test_sched_queue}, - {"pktio sched multi", pktio_test_sched_multi}, - {"pktio jumbo frames", pktio_test_jumbo}, - {"pktio mtu", pktio_test_mtu}, - {"pktio promisc mode", pktio_test_promisc}, - {"pktio mac", pktio_test_mac}, - {"pktio inq_remdef", pktio_test_inq_remdef}, + _CU_TEST_INFO(pktio_test_open), + _CU_TEST_INFO(pktio_test_lookup), + _CU_TEST_INFO(pktio_test_inq), + _CU_TEST_INFO(pktio_test_poll_queue), + _CU_TEST_INFO(pktio_test_poll_multi), + _CU_TEST_INFO(pktio_test_sched_queue), + _CU_TEST_INFO(pktio_test_sched_multi), + _CU_TEST_INFO(pktio_test_jumbo), + _CU_TEST_INFO(pktio_test_mtu), + _CU_TEST_INFO(pktio_test_promisc), + _CU_TEST_INFO(pktio_test_mac), + _CU_TEST_INFO(pktio_test_inq_remdef), CU_TEST_INFO_NULL }; diff --git a/test/validation/pool/Makefile.am b/test/validation/pool/Makefile.am index 97f3eb4..8f626e7 100644 --- a/test/validation/pool/Makefile.am +++ b/test/validation/pool/Makefile.am @@ -6,3 +6,5 @@ libpool_la_SOURCES = pool.c bin_PROGRAMS = pool_main$(EXEEXT) dist_pool_main_SOURCES = pool_main.c pool_main_LDADD = libpool.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = pool.h diff --git a/test/validation/pool/pool.c b/test/validation/pool/pool.c index 9247557..44ba155 100644 --- a/test/validation/pool/pool.c +++ b/test/validation/pool/pool.c @@ -99,8 +99,6 @@ void pool_test_lookup_info_print(void) CU_ASSERT(odp_pool_destroy(pool) == 0); } -#define _CU_TEST_INFO(test_func) {#test_func, test_func} - CU_TestInfo pool_suite[] = { _CU_TEST_INFO(pool_test_create_destroy_buffer), _CU_TEST_INFO(pool_test_create_destroy_packet), diff --git a/test/validation/queue/Makefile.am b/test/validation/queue/Makefile.am index adeefc7..c4e5f96 100644 --- a/test/validation/queue/Makefile.am +++ b/test/validation/queue/Makefile.am @@ -6,3 +6,5 @@ libqueue_la_SOURCES = queue.c bin_PROGRAMS = queue_main$(EXEEXT) dist_queue_main_SOURCES = queue_main.c queue_main_LDADD = libqueue.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = queue.h diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c index 3429b3f..02a5538 100644 --- a/test/validation/queue/queue.c +++ b/test/validation/queue/queue.c @@ -126,7 +126,7 @@ void queue_test_sunnydays(void) } CU_TestInfo queue_suite[] = { - {"queue sunnyday", queue_test_sunnydays}, + _CU_TEST_INFO(queue_test_sunnydays), CU_TEST_INFO_NULL, }; diff --git a/test/validation/random/Makefile.am b/test/validation/random/Makefile.am index 85056d5..8f871bc 100644 --- a/test/validation/random/Makefile.am +++ b/test/validation/random/Makefile.am @@ -6,3 +6,5 @@ librandom_la_SOURCES = random.c bin_PROGRAMS = random_main$(EXEEXT) dist_random_main_SOURCES = random_main.c random_main_LDADD = librandom.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = random.h diff --git a/test/validation/random/random.c b/test/validation/random/random.c index 039c7a3..b6426f4 100644 --- a/test/validation/random/random.c +++ b/test/validation/random/random.c @@ -8,9 +8,6 @@ #include <odp_cunit_common.h> #include "random.h" -/* Helper macro for CU_TestInfo initialization */ -#define _CU_TEST_INFO(test_func) {#test_func, test_func} - void random_test_get_size(void) { int32_t ret; diff --git a/test/validation/scheduler/Makefile.am b/test/validation/scheduler/Makefile.am index d569691..e3947fa 100644 --- a/test/validation/scheduler/Makefile.am +++ b/test/validation/scheduler/Makefile.am @@ -6,3 +6,5 @@ libscheduler_la_SOURCES = scheduler.c bin_PROGRAMS = scheduler_main$(EXEEXT) dist_scheduler_main_SOURCES = scheduler_main.c scheduler_main_LDADD = libscheduler.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = scheduler.h diff --git a/test/validation/scheduler/scheduler.c b/test/validation/scheduler/scheduler.c index 67a0782..04cd166 100644 --- a/test/validation/scheduler/scheduler.c +++ b/test/validation/scheduler/scheduler.c @@ -773,36 +773,36 @@ int scheduler_suite_term(void) } 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}, - {"schedule_1q_1t_n", scheduler_test_1q_1t_n}, - {"schedule_1q_1t_a", scheduler_test_1q_1t_a}, - {"schedule_1q_1t_o", scheduler_test_1q_1t_o}, - {"schedule_mq_1t_n", scheduler_test_mq_1t_n}, - {"schedule_mq_1t_a", scheduler_test_mq_1t_a}, - {"schedule_mq_1t_o", scheduler_test_mq_1t_o}, - {"schedule_mq_1t_prio_n", scheduler_test_mq_1t_prio_n}, - {"schedule_mq_1t_prio_a", scheduler_test_mq_1t_prio_a}, - {"schedule_mq_1t_prio_o", scheduler_test_mq_1t_prio_o}, - {"schedule_mq_mt_prio_n", scheduler_test_mq_mt_prio_n}, - {"schedule_mq_mt_prio_a", scheduler_test_mq_mt_prio_a}, - {"schedule_mq_mt_prio_o", scheduler_test_mq_mt_prio_o}, - {"schedule_1q_mt_a_excl", scheduler_test_1q_mt_a_excl}, - {"schedule_multi_1q_1t_n", scheduler_test_multi_1q_1t_n}, - {"schedule_multi_1q_1t_a", scheduler_test_multi_1q_1t_a}, - {"schedule_multi_1q_1t_o", scheduler_test_multi_1q_1t_o}, - {"schedule_multi_mq_1t_n", scheduler_test_multi_mq_1t_n}, - {"schedule_multi_mq_1t_a", scheduler_test_multi_mq_1t_a}, - {"schedule_multi_mq_1t_o", scheduler_test_multi_mq_1t_o}, - {"schedule_multi_mq_1t_prio_n", scheduler_test_multi_mq_1t_prio_n}, - {"schedule_multi_mq_1t_prio_a", scheduler_test_multi_mq_1t_prio_a}, - {"schedule_multi_mq_1t_prio_o", scheduler_test_multi_mq_1t_prio_o}, - {"schedule_multi_mq_mt_prio_n", scheduler_test_multi_mq_mt_prio_n}, - {"schedule_multi_mq_mt_prio_a", scheduler_test_multi_mq_mt_prio_a}, - {"schedule_multi_mq_mt_prio_o", scheduler_test_multi_mq_mt_prio_o}, - {"schedule_multi_1q_mt_a_excl", scheduler_test_multi_1q_mt_a_excl}, - {"schedule_pause_resume", scheduler_test_pause_resume}, + _CU_TEST_INFO(scheduler_test_wait_time), + _CU_TEST_INFO(scheduler_test_num_prio), + _CU_TEST_INFO(scheduler_test_queue_destroy), + _CU_TEST_INFO(scheduler_test_1q_1t_n), + _CU_TEST_INFO(scheduler_test_1q_1t_a), + _CU_TEST_INFO(scheduler_test_1q_1t_o), + _CU_TEST_INFO(scheduler_test_mq_1t_n), + _CU_TEST_INFO(scheduler_test_mq_1t_a), + _CU_TEST_INFO(scheduler_test_mq_1t_o), + _CU_TEST_INFO(scheduler_test_mq_1t_prio_n), + _CU_TEST_INFO(scheduler_test_mq_1t_prio_a), + _CU_TEST_INFO(scheduler_test_mq_1t_prio_o), + _CU_TEST_INFO(scheduler_test_mq_mt_prio_n), + _CU_TEST_INFO(scheduler_test_mq_mt_prio_a), + _CU_TEST_INFO(scheduler_test_mq_mt_prio_o), + _CU_TEST_INFO(scheduler_test_1q_mt_a_excl), + _CU_TEST_INFO(scheduler_test_multi_1q_1t_n), + _CU_TEST_INFO(scheduler_test_multi_1q_1t_a), + _CU_TEST_INFO(scheduler_test_multi_1q_1t_o), + _CU_TEST_INFO(scheduler_test_multi_mq_1t_n), + _CU_TEST_INFO(scheduler_test_multi_mq_1t_a), + _CU_TEST_INFO(scheduler_test_multi_mq_1t_o), + _CU_TEST_INFO(scheduler_test_multi_mq_1t_prio_n), + _CU_TEST_INFO(scheduler_test_multi_mq_1t_prio_a), + _CU_TEST_INFO(scheduler_test_multi_mq_1t_prio_o), + _CU_TEST_INFO(scheduler_test_multi_mq_mt_prio_n), + _CU_TEST_INFO(scheduler_test_multi_mq_mt_prio_a), + _CU_TEST_INFO(scheduler_test_multi_mq_mt_prio_o), + _CU_TEST_INFO(scheduler_test_multi_1q_mt_a_excl), + _CU_TEST_INFO(scheduler_test_pause_resume), CU_TEST_INFO_NULL, }; diff --git a/test/validation/shmem/Makefile.am b/test/validation/shmem/Makefile.am index d81303d..b2d94ed 100644 --- a/test/validation/shmem/Makefile.am +++ b/test/validation/shmem/Makefile.am @@ -6,3 +6,5 @@ libshmem_la_SOURCES = shmem.c bin_PROGRAMS = shmem_main$(EXEEXT) dist_shmem_main_SOURCES = shmem_main.c shmem_main_LDADD = libshmem.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = shmem.h diff --git a/test/validation/shmem/shmem.c b/test/validation/shmem/shmem.c index 3abba0c..6dc579a 100644 --- a/test/validation/shmem/shmem.c +++ b/test/validation/shmem/shmem.c @@ -77,7 +77,7 @@ void shmem_test_odp_shm_sunnyday(void) } CU_TestInfo shmem_suite[] = { - {"test_odp_shm_creat", shmem_test_odp_shm_sunnyday}, + _CU_TEST_INFO(shmem_test_odp_shm_sunnyday), CU_TEST_INFO_NULL, }; diff --git a/test/validation/synchronizers/Makefile.am b/test/validation/synchronizers/Makefile.am index ecb9886..4cd313c 100644 --- a/test/validation/synchronizers/Makefile.am +++ b/test/validation/synchronizers/Makefile.am @@ -6,3 +6,5 @@ libsynchronizers_la_SOURCES = synchronizers.c bin_PROGRAMS = synchronizers_main$(EXEEXT) dist_synchronizers_main_SOURCES = synchronizers_main.c synchronizers_main_LDADD = libsynchronizers.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = synchronizers.h diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 7c521ca..0a31a40 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -941,8 +941,8 @@ void synchronizers_test_barrier_functional(void) } CU_TestInfo synchronizers_suite_barrier[] = { - {"no_barrier_functional", synchronizers_test_no_barrier_functional}, - {"barrier_functional", synchronizers_test_barrier_functional}, + _CU_TEST_INFO(synchronizers_test_no_barrier_functional), + _CU_TEST_INFO(synchronizers_test_barrier_functional), CU_TEST_INFO_NULL }; @@ -957,7 +957,7 @@ void synchronizers_test_no_lock_functional(void) } CU_TestInfo synchronizers_suite_no_locking[] = { - {"no_lock_functional", synchronizers_test_no_lock_functional}, + _CU_TEST_INFO(synchronizers_test_no_lock_functional), CU_TEST_INFO_NULL }; @@ -982,8 +982,8 @@ void synchronizers_test_spinlock_functional(void) } CU_TestInfo synchronizers_suite_spinlock[] = { - {"spinlock_api", synchronizers_test_spinlock_api}, - {"spinlock_functional", synchronizers_test_spinlock_functional}, + _CU_TEST_INFO(synchronizers_test_spinlock_api), + _CU_TEST_INFO(synchronizers_test_spinlock_functional), CU_TEST_INFO_NULL }; @@ -1009,8 +1009,8 @@ void synchronizers_test_ticketlock_functional(void) } CU_TestInfo synchronizers_suite_ticketlock[] = { - {"ticketlock_api", synchronizers_test_ticketlock_api}, - {"ticketlock_functional", synchronizers_test_ticketlock_functional}, + _CU_TEST_INFO(synchronizers_test_ticketlock_api), + _CU_TEST_INFO(synchronizers_test_ticketlock_functional), CU_TEST_INFO_NULL }; @@ -1035,8 +1035,8 @@ void synchronizers_test_rwlock_functional(void) } CU_TestInfo synchronizers_suite_rwlock[] = { - {"rwlock_api", synchronizers_test_rwlock_api}, - {"rwlock_functional", synchronizers_test_rwlock_functional}, + _CU_TEST_INFO(synchronizers_test_rwlock_api), + _CU_TEST_INFO(synchronizers_test_rwlock_functional), CU_TEST_INFO_NULL }; @@ -1187,10 +1187,10 @@ void synchronizers_test_atomic_fetch_add_sub(void) } 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}, - {"atomic_fetch_add_sub", synchronizers_test_atomic_fetch_add_sub}, + _CU_TEST_INFO(synchronizers_test_atomic_inc_dec), + _CU_TEST_INFO(synchronizers_test_atomic_add_sub), + _CU_TEST_INFO(synchronizers_test_atomic_fetch_inc_dec), + _CU_TEST_INFO(synchronizers_test_atomic_fetch_add_sub), CU_TEST_INFO_NULL, }; diff --git a/test/validation/system/Makefile.am b/test/validation/system/Makefile.am index dd7759c..1c7de86 100644 --- a/test/validation/system/Makefile.am +++ b/test/validation/system/Makefile.am @@ -6,3 +6,5 @@ libsystem_la_SOURCES = system.c bin_PROGRAMS = system_main$(EXEEXT) dist_system_main_SOURCES = system_main.c system_main_LDADD = libsystem.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = system.h diff --git a/test/validation/system/system.c b/test/validation/system/system.c index 7687f20..15f3ac4 100644 --- a/test/validation/system/system.c +++ b/test/validation/system/system.c @@ -12,7 +12,7 @@ void system_test_odp_version_numbers(void) { - int char_ok; + int char_ok = 0; char version_string[128]; char *s = version_string; @@ -84,13 +84,13 @@ void system_test_odp_sys_cpu_hz(void) } 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}, - {"odp_sys_cpu_model_str", system_test_odp_sys_cpu_model_str}, - {"odp_sys_page_size", system_test_odp_sys_page_size}, - {"odp_sys_huge_page_size", system_test_odp_sys_huge_page_size}, - {"odp_sys_cpu_hz", system_test_odp_sys_cpu_hz}, + _CU_TEST_INFO(system_test_odp_version_numbers), + _CU_TEST_INFO(system_test_odp_cpu_count), + _CU_TEST_INFO(system_test_odp_sys_cache_line_size), + _CU_TEST_INFO(system_test_odp_sys_cpu_model_str), + _CU_TEST_INFO(system_test_odp_sys_page_size), + _CU_TEST_INFO(system_test_odp_sys_huge_page_size), + _CU_TEST_INFO(system_test_odp_sys_cpu_hz), CU_TEST_INFO_NULL, }; diff --git a/test/validation/thread/Makefile.am b/test/validation/thread/Makefile.am index c18bc50..20b7f13 100644 --- a/test/validation/thread/Makefile.am +++ b/test/validation/thread/Makefile.am @@ -8,3 +8,5 @@ libthread_la_LIBADD = $(LIBTHRMASK_COMMON) bin_PROGRAMS = thread_main$(EXEEXT) dist_thread_main_SOURCES = thread_main.c thread_main_LDADD = libthread.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = thread.h diff --git a/test/validation/thread/thread.c b/test/validation/thread/thread.c index f95172a..d4f3ee0 100644 --- a/test/validation/thread/thread.c +++ b/test/validation/thread/thread.c @@ -10,9 +10,6 @@ #include <test_debug.h> #include "thread.h" -/* Helper macro for CU_TestInfo initialization */ -#define _CU_TEST_INFO(test_func) {#test_func, test_func} - /* Test thread entry and exit synchronization barriers */ odp_barrier_t bar_entry; odp_barrier_t bar_exit; diff --git a/test/validation/time/Makefile.am b/test/validation/time/Makefile.am index 418107d..0e8742e 100644 --- a/test/validation/time/Makefile.am +++ b/test/validation/time/Makefile.am @@ -6,3 +6,5 @@ libtime_la_SOURCES = time.c bin_PROGRAMS = time_main$(EXEEXT) dist_time_main_SOURCES = time_main.c time_main_LDADD = libtime.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = time.h diff --git a/test/validation/time/time.c b/test/validation/time/time.c index 4fa2eaf..4b81c2c 100644 --- a/test/validation/time/time.c +++ b/test/validation/time/time.c @@ -62,9 +62,9 @@ void time_test_odp_time_conversion(void) } CU_TestInfo time_suite_time[] = { - {"cycles diff", time_test_odp_cycles_diff}, - {"negative diff", time_test_odp_cycles_negative_diff}, - {"conversion", time_test_odp_time_conversion}, + _CU_TEST_INFO(time_test_odp_cycles_diff), + _CU_TEST_INFO(time_test_odp_cycles_negative_diff), + _CU_TEST_INFO(time_test_odp_time_conversion), CU_TEST_INFO_NULL }; diff --git a/test/validation/timer/Makefile.am b/test/validation/timer/Makefile.am index 591dfb6..01e4fd3 100644 --- a/test/validation/timer/Makefile.am +++ b/test/validation/timer/Makefile.am @@ -6,3 +6,5 @@ libtimer_la_SOURCES = timer.c bin_PROGRAMS = timer_main$(EXEEXT) dist_timer_main_SOURCES = timer_main.c timer_main_LDADD = libtimer.la $(LIBCUNIT_COMMON) $(LIBODP) + +EXTRA_DIST = timer.h diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 96d2425..7a8b98a 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -530,10 +530,10 @@ void timer_test_odp_timer_all(void) } 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}, - {"test_odp_timer_all", timer_test_odp_timer_all}, + _CU_TEST_INFO(timer_test_timeout_pool_alloc), + _CU_TEST_INFO(timer_test_timeout_pool_free), + _CU_TEST_INFO(timer_test_odp_timer_cancel), + _CU_TEST_INFO(timer_test_odp_timer_all), CU_TEST_INFO_NULL, }; |