This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 115de92568af53becceae8300fe2f2b6a3436cfc (commit) via 2f62f234d0b83f4deedcfb75213a6e901e87d902 (commit) via d3e7f84960c29b58ad78de745b4bc3d5f26fc77d (commit) via fd22012f6f8e621fb22d5f4d6c15347f9535a902 (commit) via c2837dee41364443bc95aa97611e3d721ef16813 (commit) via eba4477a5cd5300d608ddfc53ff00cd3e51805a6 (commit) via 3e90ecc0bfa4487a29fbdff7ccc1cf5a2a1e8bc0 (commit) via dfa1ee94dae761166126445739be0dd6843f6792 (commit) via 01014bb374153d7bc879b3e1d26e79a6dfe5c329 (commit) via d7f9a326839de8d731d95ba3a1c45114198887d1 (commit) via b07985be674cef618fabeb7111ffa4dbb3e74fef (commit) via 74948cab5525f59e016dc984d95cb51f2ce2f963 (commit) via 4ffba79dfc573070f61da8894877783601e3aff4 (commit) via 4fc0e934df0bbd0779c6051595add213f752272a (commit) via 69367466a8c3e30509b1f86c4751285aab37efb8 (commit) via d1da7104eb4875287c816aec7e145a7504239156 (commit) via 409d87e542b9f018467c2c62bb07a8e4f2a15993 (commit) via f4d395f2a80646c0609b62fbe37cd14465df74ac (commit) via dab09417bf432da56aeddb2feaef9e6a11b739d7 (commit) via f7938ef11ede6ed6843bb7608a98ab3d15cf8e1c (commit) via 9e40c760b95077a4ca4e652e4d39a4304e5828f6 (commit) via 7c733ea2be5898660a3d02cdd2cf1f0a64a50e0c (commit) via e8d209cc33a34c7ee92053e3f240c542068816dd (commit) via 157737a4629a569f453762f92be2e3d174dfe1e5 (commit) via e4fec7da3e89c20cfe3c4d96c5fbe02ebbea57b3 (commit) from d5419e8857b2bc61d3be17fe53f171550fee426b (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 115de92568af53becceae8300fe2f2b6a3436cfc Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:25:20 2018 +0300
validation: traffic_mngr: do not run the test twice
Currently tm test will be run twice: from the subdir and from main validation/api dir. Run it only once together with the rest of tests.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/traffic_mngr/Makefile.am b/test/validation/api/traffic_mngr/Makefile.am index 1f49d4cb..a9b8550d 100644 --- a/test/validation/api/traffic_mngr/Makefile.am +++ b/test/validation/api/traffic_mngr/Makefile.am @@ -2,14 +2,9 @@ include ../Makefile.inc
TESTS_ENVIRONMENT += TEST_DIR=${builddir}
-TESTSCRIPTS = traffic_mngr.sh -TEST_EXTENSIONS = .sh - -TESTS = $(TESTSCRIPTS) - test_PROGRAMS = traffic_mngr_main traffic_mngr_main_SOURCES = traffic_mngr.c LDADD += -lm
-dist_check_SCRIPTS = $(TESTSCRIPTS) +dist_check_SCRIPTS = traffic_mngr.sh test_SCRIPTS = $(dist_check_SCRIPTS)
commit 2f62f234d0b83f4deedcfb75213a6e901e87d902 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: pktio: simplify test infrastructure
Merge separate file with just main() function into main test files. Split single pktio test into pktio and parser tests.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh index bf9fc456..5ab45094 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_pcap.sh @@ -25,6 +25,7 @@ if [ -x "$pktio_main_path" ] ; then echo "running with $pktio_main_path" else echo "cannot find pktio_main${EXEEXT}: please set you PATH for it." + exit 1 fi
PCAP_FNAME=vald.pcap diff --git a/test/validation/api/pktio/Makefile.am b/test/validation/api/pktio/Makefile.am index a6a16e2f..ffd1827b 100644 --- a/test/validation/api/pktio/Makefile.am +++ b/test/validation/api/pktio/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = pktio_main -pktio_main_SOURCES = pktio_main.c parser.c parser.h pktio.c pktio.h +pktio_main_SOURCES = pktio.c parser.c parser.h diff --git a/test/validation/api/pktio/parser.c b/test/validation/api/pktio/parser.c index 1788d4d6..e0431441 100644 --- a/test/validation/api/pktio/parser.c +++ b/test/validation/api/pktio/parser.c @@ -14,7 +14,6 @@
#include <stdlib.h> #include "parser.h" -#include "pktio.h"
#define MAX_NUM_IFACES 2 #define PKT_POOL_NUM 256 @@ -208,6 +207,21 @@ static odp_packet_t recv_and_cmp_packet(odp_pktin_queue_t pktin, return pkt; }
+static void pktio_pkt_set_macs(odp_packet_t pkt, odp_pktio_t src, odp_pktio_t dst) +{ + uint32_t len; + odph_ethhdr_t *eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, &len); + int ret; + + ret = odp_pktio_mac_addr(src, ð->src, ODP_PKTIO_MACADDR_MAXSIZE); + CU_ASSERT(ret == ODPH_ETHADDR_LEN); + CU_ASSERT(ret <= ODP_PKTIO_MACADDR_MAXSIZE); + + ret = odp_pktio_mac_addr(dst, ð->dst, ODP_PKTIO_MACADDR_MAXSIZE); + CU_ASSERT(ret == ODPH_ETHADDR_LEN); + CU_ASSERT(ret <= ODP_PKTIO_MACADDR_MAXSIZE); +} + /** * Creates a test packet from data array and loops it through the test pktio * interfaces forcing packet parsing. @@ -257,7 +271,7 @@ static odp_packet_t loopback_packet(pktio_info_t *pktio_a, return pkt; }
-void parser_test_arp(void) +static void parser_test_arp(void) { odp_packet_t pkt;
@@ -273,7 +287,7 @@ void parser_test_arp(void) odp_packet_free(pkt); }
-void parser_test_ipv4_icmp(void) +static void parser_test_ipv4_icmp(void) { odp_packet_t pkt;
@@ -291,7 +305,7 @@ void parser_test_ipv4_icmp(void) odp_packet_free(pkt); }
-void parser_test_ipv4_tcp(void) +static void parser_test_ipv4_tcp(void) { odp_packet_t pkt;
@@ -308,7 +322,7 @@ void parser_test_ipv4_tcp(void) odp_packet_free(pkt); }
-void parser_test_ipv4_udp(void) +static void parser_test_ipv4_udp(void) { odp_packet_t pkt;
@@ -325,7 +339,7 @@ void parser_test_ipv4_udp(void) odp_packet_free(pkt); }
-void parser_test_vlan_ipv4_udp(void) +static void parser_test_vlan_ipv4_udp(void) { odp_packet_t pkt;
@@ -343,7 +357,7 @@ void parser_test_vlan_ipv4_udp(void) odp_packet_free(pkt); }
-void parser_test_vlan_qinq_ipv4_udp(void) +static void parser_test_vlan_qinq_ipv4_udp(void) { odp_packet_t pkt;
@@ -362,7 +376,7 @@ void parser_test_vlan_qinq_ipv4_udp(void) odp_packet_free(pkt); }
-void parser_test_ipv6_icmp(void) +static void parser_test_ipv6_icmp(void) { odp_packet_t pkt;
@@ -380,7 +394,7 @@ void parser_test_ipv6_icmp(void) odp_packet_free(pkt); }
-void parser_test_ipv6_tcp(void) +static void parser_test_ipv6_tcp(void) { odp_packet_t pkt;
@@ -397,7 +411,7 @@ void parser_test_ipv6_tcp(void) odp_packet_free(pkt); }
-void parser_test_ipv6_udp(void) +static void parser_test_ipv6_udp(void) { odp_packet_t pkt;
@@ -414,7 +428,7 @@ void parser_test_ipv6_udp(void) odp_packet_free(pkt); }
-void parser_test_vlan_ipv6_udp(void) +static void parser_test_vlan_ipv6_udp(void) { odp_packet_t pkt;
diff --git a/test/validation/api/pktio/parser.h b/test/validation/api/pktio/parser.h index d95ecca1..688990fb 100644 --- a/test/validation/api/pktio/parser.h +++ b/test/validation/api/pktio/parser.h @@ -9,18 +9,6 @@
#include <odp_cunit_common.h>
-/* test functions: */ -void parser_test_arp(void); -void parser_test_ipv4_icmp(void); -void parser_test_ipv4_tcp(void); -void parser_test_ipv4_udp(void); -void parser_test_vlan_ipv4_udp(void); -void parser_test_vlan_qinq_ipv4_udp(void); -void parser_test_ipv6_icmp(void); -void parser_test_ipv6_tcp(void); -void parser_test_ipv6_udp(void); -void parser_test_vlan_ipv6_udp(void); - /* test array init/term functions: */ int parser_suite_term(void); int parser_suite_init(void); diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index b20272ff..a0496642 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -12,7 +12,6 @@ #include <odp/helper/odph_api.h>
#include <stdlib.h> -#include "pktio.h" #include "parser.h"
#define PKT_BUF_NUM 32 @@ -150,7 +149,7 @@ static void set_pool_len(odp_pool_param_t *params, odp_pool_capability_t *capa) } }
-void pktio_pkt_set_macs(odp_packet_t pkt, odp_pktio_t src, odp_pktio_t dst) +static void pktio_pkt_set_macs(odp_packet_t pkt, odp_pktio_t src, odp_pktio_t dst) { uint32_t len; odph_ethhdr_t *eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, &len); @@ -751,59 +750,59 @@ static void test_txrx(odp_pktin_mode_t in_mode, int num_pkts, } }
-void pktio_test_plain_queue(void) +static void pktio_test_plain_queue(void) { test_txrx(ODP_PKTIN_MODE_QUEUE, 1, TXRX_MODE_SINGLE); test_txrx(ODP_PKTIN_MODE_QUEUE, TX_BATCH_LEN, TXRX_MODE_SINGLE); }
-void pktio_test_plain_multi(void) +static void pktio_test_plain_multi(void) { test_txrx(ODP_PKTIN_MODE_QUEUE, TX_BATCH_LEN, TXRX_MODE_MULTI); test_txrx(ODP_PKTIN_MODE_QUEUE, 1, TXRX_MODE_MULTI); }
-void pktio_test_plain_multi_event(void) +static void pktio_test_plain_multi_event(void) { test_txrx(ODP_PKTIN_MODE_QUEUE, 1, TXRX_MODE_MULTI_EVENT); test_txrx(ODP_PKTIN_MODE_QUEUE, TX_BATCH_LEN, TXRX_MODE_MULTI_EVENT); }
-void pktio_test_sched_queue(void) +static void pktio_test_sched_queue(void) { test_txrx(ODP_PKTIN_MODE_SCHED, 1, TXRX_MODE_SINGLE); test_txrx(ODP_PKTIN_MODE_SCHED, TX_BATCH_LEN, TXRX_MODE_SINGLE); }
-void pktio_test_sched_multi(void) +static void pktio_test_sched_multi(void) { test_txrx(ODP_PKTIN_MODE_SCHED, TX_BATCH_LEN, TXRX_MODE_MULTI); test_txrx(ODP_PKTIN_MODE_SCHED, 1, TXRX_MODE_MULTI); }
-void pktio_test_sched_multi_event(void) +static void pktio_test_sched_multi_event(void) { test_txrx(ODP_PKTIN_MODE_SCHED, 1, TXRX_MODE_MULTI_EVENT); test_txrx(ODP_PKTIN_MODE_SCHED, TX_BATCH_LEN, TXRX_MODE_MULTI_EVENT); }
-void pktio_test_recv(void) +static void pktio_test_recv(void) { test_txrx(ODP_PKTIN_MODE_DIRECT, 1, TXRX_MODE_SINGLE); }
-void pktio_test_recv_multi(void) +static void pktio_test_recv_multi(void) { test_txrx(ODP_PKTIN_MODE_DIRECT, TX_BATCH_LEN, TXRX_MODE_MULTI); }
-void pktio_test_recv_multi_event(void) +static void pktio_test_recv_multi_event(void) { test_txrx(ODP_PKTIN_MODE_DIRECT, 1, TXRX_MODE_MULTI_EVENT); test_txrx(ODP_PKTIN_MODE_DIRECT, TX_BATCH_LEN, TXRX_MODE_MULTI_EVENT); }
-void pktio_test_recv_queue(void) +static void pktio_test_recv_queue(void) { odp_pktio_t pktio_tx, pktio_rx; odp_pktio_t pktio[MAX_NUM_IFACES]; @@ -1005,25 +1004,25 @@ static void test_recv_tmo(recv_tmo_mode_e mode) } }
-void pktio_test_recv_tmo(void) +static void pktio_test_recv_tmo(void) { test_recv_tmo(RECV_TMO); }
-void pktio_test_recv_mq_tmo(void) +static void pktio_test_recv_mq_tmo(void) { test_recv_tmo(RECV_MQ_TMO); test_recv_tmo(RECV_MQ_TMO_NO_IDX); }
-void pktio_test_recv_mtu(void) +static void pktio_test_recv_mtu(void) { packet_len = USE_MTU; pktio_test_sched_multi(); packet_len = PKT_LEN_NORMAL; }
-void pktio_test_mtu(void) +static void pktio_test_mtu(void) { int ret; uint32_t maxlen; @@ -1046,7 +1045,7 @@ void pktio_test_mtu(void) CU_ASSERT(ret == 0); }
-void pktio_test_promisc(void) +static void pktio_test_promisc(void) { int ret; odp_pktio_capability_t capa; @@ -1084,7 +1083,7 @@ void pktio_test_promisc(void) CU_ASSERT(ret == 0); }
-void pktio_test_mac(void) +static void pktio_test_mac(void) { unsigned char mac_addr[ODP_PKTIO_MACADDR_MAXSIZE]; unsigned char mac_addr_ref[ODP_PKTIO_MACADDR_MAXSIZE] = { @@ -1137,7 +1136,7 @@ void pktio_test_mac(void) CU_ASSERT(0 == ret); }
-void pktio_test_open(void) +static void pktio_test_open(void) { odp_pktio_t pktio; odp_pktio_param_t pktio_param; @@ -1158,7 +1157,7 @@ void pktio_test_open(void) CU_ASSERT(pktio == ODP_PKTIO_INVALID); }
-void pktio_test_lookup(void) +static void pktio_test_lookup(void) { odp_pktio_t pktio, pktio_inval; odp_pktio_param_t pktio_param; @@ -1181,7 +1180,7 @@ void pktio_test_lookup(void) CU_ASSERT(odp_pktio_lookup(iface_name[0]) == ODP_PKTIO_INVALID); }
-void pktio_test_index(void) +static void pktio_test_index(void) { odp_pktio_t pktio; odp_pktio_param_t pktio_param; @@ -1217,7 +1216,7 @@ static void pktio_test_print(void) } }
-void pktio_test_pktio_config(void) +static void pktio_test_pktio_config(void) { odp_pktio_t pktio; odp_pktio_capability_t capa; @@ -1242,7 +1241,7 @@ void pktio_test_pktio_config(void) CU_ASSERT_FATAL(odp_pktio_close(pktio) == 0); }
-void pktio_test_info(void) +static void pktio_test_info(void) { odp_pktio_t pktio; odp_pktio_info_t pktio_info; @@ -1269,7 +1268,7 @@ void pktio_test_info(void) } }
-void pktio_test_pktin_queue_config_direct(void) +static void pktio_test_pktin_queue_config_direct(void) { odp_pktio_t pktio; odp_pktio_capability_t capa; @@ -1310,7 +1309,7 @@ void pktio_test_pktin_queue_config_direct(void) CU_ASSERT_FATAL(odp_pktio_close(pktio) == 0); }
-void pktio_test_pktin_queue_config_sched(void) +static void pktio_test_pktin_queue_config_sched(void) { odp_pktio_t pktio; odp_pktio_capability_t capa; @@ -1348,7 +1347,7 @@ void pktio_test_pktin_queue_config_sched(void) CU_ASSERT_FATAL(odp_pktio_close(pktio) == 0); }
-void pktio_test_pktin_queue_config_queue(void) +static void pktio_test_pktin_queue_config_queue(void) { odp_pktio_t pktio; odp_pktio_capability_t capa; @@ -1384,7 +1383,7 @@ void pktio_test_pktin_queue_config_queue(void) CU_ASSERT(odp_pktio_close(pktio) == 0); }
-void pktio_test_pktout_queue_config(void) +static void pktio_test_pktout_queue_config(void) { odp_pktio_t pktio; odp_pktio_capability_t capa; @@ -1450,7 +1449,7 @@ static void _print_pktio_stats(odp_pktio_stats_t *s, const char *name) * get statistics counters. ethtool strings are not standardised * and sysfs may not be supported. skip pktio_stats test until * we will solve that.*/ -int pktio_check_statistics_counters(void) +static int pktio_check_statistics_counters(void) { odp_pktio_t pktio; odp_pktio_stats_t stats; @@ -1474,7 +1473,7 @@ int pktio_check_statistics_counters(void) return ODP_TEST_INACTIVE; }
-void pktio_test_statistics_counters(void) +static void pktio_test_statistics_counters(void) { odp_pktio_t pktio_rx, pktio_tx; odp_pktio_t pktio[MAX_NUM_IFACES] = { @@ -1584,7 +1583,7 @@ void pktio_test_statistics_counters(void) } }
-void pktio_test_start_stop(void) +static void pktio_test_start_stop(void) { odp_pktio_t pktio[MAX_NUM_IFACES]; odp_pktio_t pktio_in; @@ -1713,7 +1712,7 @@ void pktio_test_start_stop(void) * biggest packet we can allocate then the test won't be able to * attempt to send packets larger than the max len, so skip the test. */ -int pktio_check_send_failure(void) +static int pktio_check_send_failure(void) { odp_pktio_t pktio_tx; uint32_t maxlen; @@ -1750,7 +1749,7 @@ int pktio_check_send_failure(void) return ODP_TEST_ACTIVE; }
-void pktio_test_send_failure(void) +static void pktio_test_send_failure(void) { odp_pktio_t pktio_tx, pktio_rx; odp_packet_t pkt_tbl[TX_BATCH_LEN]; @@ -1907,7 +1906,7 @@ cleanup: CU_ASSERT(odp_pool_destroy(pkt_pool) == 0); }
-void pktio_test_recv_on_wonly(void) +static void pktio_test_recv_on_wonly(void) { odp_pktio_t pktio; int ret; @@ -1935,7 +1934,7 @@ void pktio_test_recv_on_wonly(void) CU_ASSERT_FATAL(ret == 0); }
-void pktio_test_send_on_ronly(void) +static void pktio_test_send_on_ronly(void) { odp_pktio_t pktio; int ret; @@ -1963,7 +1962,7 @@ void pktio_test_send_on_ronly(void) CU_ASSERT_FATAL(ret == 0); }
-int pktio_check_pktin_ts(void) +static int pktio_check_pktin_ts(void) { odp_pktio_t pktio; odp_pktio_capability_t capa; @@ -1986,7 +1985,7 @@ int pktio_check_pktin_ts(void) return ODP_TEST_ACTIVE; }
-void pktio_test_pktin_ts(void) +static void pktio_test_pktin_ts(void) { odp_pktio_t pktio_tx, pktio_rx; odp_pktio_t pktio[MAX_NUM_IFACES]; @@ -2142,19 +2141,19 @@ static int pktio_suite_init(void) return 0; }
-int pktio_suite_init_unsegmented(void) +static int pktio_suite_init_unsegmented(void) { pool_segmentation = PKT_POOL_UNSEGMENTED; return pktio_suite_init(); }
-int pktio_suite_init_segmented(void) +static int pktio_suite_init_segmented(void) { pool_segmentation = PKT_POOL_SEGMENTED; return pktio_suite_init(); }
-int pktio_suite_term(void) +static int pktio_suite_term(void) { char pool_name[ODP_POOL_NAME_LEN]; odp_pool_t pool; @@ -2245,7 +2244,7 @@ odp_suiteinfo_t pktio_suites[] = { ODP_SUITE_INFO_NULL };
-int pktio_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/pktio/pktio.h b/test/validation/api/pktio/pktio.h deleted file mode 100644 index b8799d9e..00000000 --- a/test/validation/api/pktio/pktio.h +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_PKTIO_H_ -#define _ODP_TEST_PKTIO_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void pktio_test_plain_queue(void); -void pktio_test_plain_multi(void); -void pktio_test_sched_queue(void); -void pktio_test_sched_multi(void); -void pktio_test_recv(void); -void pktio_test_recv_multi(void); -void pktio_test_recv_queue(void); -void pktio_test_recv_tmo(void); -void pktio_test_recv_mq_tmo(void); -void pktio_test_recv_mtu(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_index(void); -void pktio_test_info(void); -void pktio_test_inq(void); -void pktio_test_pktio_config(void); -void pktio_test_pktin_queue_config_direct(void); -void pktio_test_pktin_queue_config_sched(void); -void pktio_test_pktin_queue_config_queue(void); -void pktio_test_pktout_queue_config(void); -void pktio_test_start_stop(void); -int pktio_check_send_failure(void); -void pktio_test_send_failure(void); -void pktio_test_recv_on_wonly(void); -void pktio_test_send_on_ronly(void); -void pktio_test_plain_multi_event(void); -void pktio_test_sched_multi_event(void); -void pktio_test_recv_multi_event(void); -int pktio_check_statistics_counters(void); -void pktio_test_statistics_counters(void); -int pktio_check_pktin_ts(void); -void pktio_test_pktin_ts(void); - -/* test arrays: */ -extern odp_testinfo_t pktio_suite[]; - -/* test array init/term functions: */ -int pktio_suite_term(void); -int pktio_suite_init_segmented(void); -int pktio_suite_init_unsegmented(void); - -/* test registry: */ -extern odp_suiteinfo_t pktio_suites[]; - -/* main test program: */ -int pktio_main(int argc, char *argv[]); - -/* functions shared by parser test suite */ -void pktio_pkt_set_macs(odp_packet_t pkt, odp_pktio_t src, odp_pktio_t dst); - -#endif diff --git a/test/validation/api/pktio/pktio_main.c b/test/validation/api/pktio/pktio_main.c deleted file mode 100644 index 13d2407a..00000000 --- a/test/validation/api/pktio/pktio_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "pktio.h" - -int main(int argc, char *argv[]) -{ - return pktio_main(argc, argv); -}
commit d3e7f84960c29b58ad78de745b4bc3d5f26fc77d Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: classification: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/classification/Makefile.am b/test/validation/api/classification/Makefile.am index 303a3576..e17f9f65 100644 --- a/test/validation/api/classification/Makefile.am +++ b/test/validation/api/classification/Makefile.am @@ -1,7 +1,7 @@ include ../Makefile.inc
test_PROGRAMS = classification_main -classification_main_SOURCES = classification_main.c \ +classification_main_SOURCES = \ odp_classification_basic.c \ odp_classification_tests.c \ odp_classification_testsuites.h \ diff --git a/test/validation/api/classification/classification.c b/test/validation/api/classification/classification.c index ef621f72..e89ffbee 100644 --- a/test/validation/api/classification/classification.c +++ b/test/validation/api/classification/classification.c @@ -28,7 +28,7 @@ odp_suiteinfo_t classification_suites[] = { ODP_SUITE_INFO_NULL, };
-int classification_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/classification/classification.h b/test/validation/api/classification/classification.h index 326177ad..4a540218 100644 --- a/test/validation/api/classification/classification.h +++ b/test/validation/api/classification/classification.h @@ -76,46 +76,4 @@ #define DEFAULT_TOS ((DEFAULT_DSCP << ODPH_IP_TOS_DSCP_SHIFT) | \ DEFAULT_ECN)
-/* test functions: */ -void classification_test_create_cos(void); -void classification_test_destroy_cos(void); -void classification_test_create_pmr_match(void); -void classification_test_cos_set_queue(void); -void classification_test_cos_set_pool(void); -void classification_test_cos_set_drop(void); -void classification_test_pmr_composite_create(void); -void classification_test_pmr_composite_destroy(void); - -void classification_test_pktio_set_skip(void); -void classification_test_pktio_set_headroom(void); -void classification_test_pktio_configure(void); -void classification_test_pktio_test(void); - -void classification_test_pmr_term_tcp_dport(void); -void classification_test_pmr_term_tcp_sport(void); -void classification_test_pmr_term_udp_dport(void); -void classification_test_pmr_term_udp_sport(void); -void classification_test_pmr_term_ipproto(void); -void classification_test_pmr_term_dmac(void); -void classification_test_pmr_term_packet_len(void); -void classification_test_pmr_term_vlan_id_0(void); -void classification_test_pmr_term_vlan_id_x(void); -void classification_test_pmr_term_eth_type_0(void); -void classification_test_pmr_term_eth_type_x(void); -void classification_test_pktin_classifier_flag(void); - -/* test arrays: */ -extern odp_testinfo_t classification_suite_basic[]; -extern odp_testinfo_t classification_suite[]; - -/* test array init/term functions: */ -int classification_suite_init(void); -int classification_suite_term(void); - -/* test registry: */ -extern odp_suiteinfo_t classification_suites[]; - -/* main test program: */ -int classification_main(int argc, char *argv[]); - #endif diff --git a/test/validation/api/classification/classification_main.c b/test/validation/api/classification/classification_main.c deleted file mode 100644 index 51909d00..00000000 --- a/test/validation/api/classification/classification_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "classification.h" - -int main(int argc, char *argv[]) -{ - return classification_main(argc, argv); -} diff --git a/test/validation/api/classification/odp_classification_basic.c b/test/validation/api/classification/odp_classification_basic.c index 20f07374..8b3738b7 100644 --- a/test/validation/api/classification/odp_classification_basic.c +++ b/test/validation/api/classification/odp_classification_basic.c @@ -12,7 +12,7 @@
#define PMR_SET_NUM 5
-void classification_test_create_cos(void) +static void classification_test_create_cos(void) { odp_cos_t cos; odp_cls_cos_param_t cls_param; @@ -37,7 +37,7 @@ void classification_test_create_cos(void) odp_queue_destroy(queue); }
-void classification_test_destroy_cos(void) +static void classification_test_destroy_cos(void) { odp_cos_t cos; char name[ODP_COS_NAME_LEN]; @@ -69,7 +69,7 @@ void classification_test_destroy_cos(void) odp_queue_destroy(queue); }
-void classification_test_create_pmr_match(void) +static void classification_test_create_pmr_match(void) { odp_pmr_t pmr; uint16_t val; @@ -139,7 +139,7 @@ void classification_test_create_pmr_match(void) odp_pktio_close(pktio); }
-void classification_test_cos_set_queue(void) +static void classification_test_cos_set_queue(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -182,7 +182,7 @@ void classification_test_cos_set_queue(void) odp_pool_destroy(pool); }
-void classification_test_cos_set_pool(void) +static void classification_test_cos_set_pool(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -221,7 +221,7 @@ void classification_test_cos_set_pool(void) odp_pool_destroy(cos_pool); }
-void classification_test_cos_set_drop(void) +static void classification_test_cos_set_drop(void) { int retval; char cosname[ODP_COS_NAME_LEN]; @@ -256,7 +256,7 @@ void classification_test_cos_set_drop(void) odp_queue_destroy(queue); }
-void classification_test_pmr_composite_create(void) +static void classification_test_pmr_composite_create(void) { odp_pmr_t pmr_composite; int retval; diff --git a/test/validation/api/classification/odp_classification_test_pmr.c b/test/validation/api/classification/odp_classification_test_pmr.c index 87d04b6b..f21b8add 100644 --- a/test/validation/api/classification/odp_classification_test_pmr.c +++ b/test/validation/api/classification/odp_classification_test_pmr.c @@ -88,7 +88,7 @@ int classification_suite_pmr_term(void) return retcode; }
-void classification_test_pktin_classifier_flag(void) +static void classification_test_pktin_classifier_flag(void) { odp_packet_t pkt; odph_tcphdr_t *tcp; @@ -184,7 +184,7 @@ void classification_test_pktin_classifier_flag(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_tcp_dport(void) +static void classification_test_pmr_term_tcp_dport(void) { odp_packet_t pkt; odph_tcphdr_t *tcp; @@ -298,7 +298,7 @@ void classification_test_pmr_term_tcp_dport(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_tcp_sport(void) +static void classification_test_pmr_term_tcp_sport(void) { odp_packet_t pkt; odph_tcphdr_t *tcp; @@ -410,7 +410,7 @@ void classification_test_pmr_term_tcp_sport(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_udp_dport(void) +static void classification_test_pmr_term_udp_dport(void) { odp_packet_t pkt; odph_udphdr_t *udp; @@ -526,7 +526,7 @@ void classification_test_pmr_term_udp_dport(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_udp_sport(void) +static void classification_test_pmr_term_udp_sport(void) { odp_packet_t pkt; odph_udphdr_t *udp; @@ -641,7 +641,7 @@ void classification_test_pmr_term_udp_sport(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_ipproto(void) +static void classification_test_pmr_term_ipproto(void) { odp_packet_t pkt; uint32_t seqno; @@ -750,7 +750,7 @@ void classification_test_pmr_term_ipproto(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_dmac(void) +static void classification_test_pmr_term_dmac(void) { odp_packet_t pkt; uint32_t seqno; @@ -856,7 +856,7 @@ void classification_test_pmr_term_dmac(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_packet_len(void) +static void classification_test_pmr_term_packet_len(void) { odp_packet_t pkt; uint32_t seqno; @@ -968,7 +968,7 @@ void classification_test_pmr_term_packet_len(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_vlan_id_0(void) +static void classification_test_pmr_term_vlan_id_0(void) { odp_packet_t pkt; uint32_t seqno; @@ -1081,7 +1081,7 @@ void classification_test_pmr_term_vlan_id_0(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_vlan_id_x(void) +static void classification_test_pmr_term_vlan_id_x(void) { odp_packet_t pkt; uint32_t seqno; @@ -1195,7 +1195,7 @@ void classification_test_pmr_term_vlan_id_x(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_eth_type_0(void) +static void classification_test_pmr_term_eth_type_0(void) { odp_packet_t pkt; uint32_t seqno; @@ -1304,7 +1304,7 @@ void classification_test_pmr_term_eth_type_0(void) odp_pktio_close(pktio); }
-void classification_test_pmr_term_eth_type_x(void) +static void classification_test_pmr_term_eth_type_x(void) { odp_packet_t pkt; uint32_t seqno; diff --git a/test/validation/api/classification/odp_classification_tests.c b/test/validation/api/classification/odp_classification_tests.c index c7f5d0d4..4cd727f9 100644 --- a/test/validation/api/classification/odp_classification_tests.c +++ b/test/validation/api/classification/odp_classification_tests.c @@ -399,7 +399,7 @@ void test_pktio_error_cos(void) odp_packet_free(pkt); }
-void classification_test_pktio_set_skip(void) +static void classification_test_pktio_set_skip(void) { int retval; size_t offset = 5; @@ -417,7 +417,7 @@ void classification_test_pktio_set_skip(void) CU_ASSERT(retval == 0); }
-void classification_test_pktio_set_headroom(void) +static void classification_test_pktio_set_headroom(void) { size_t headroom; int retval; @@ -681,7 +681,7 @@ void test_pktio_pmr_composite_cos(void) odp_packet_free(pkt); }
-void classification_test_pktio_configure(void) +static void classification_test_pktio_configure(void) { /* Configure the Different CoS for the pktio interface */ if (TEST_DEFAULT) @@ -698,7 +698,7 @@ void classification_test_pktio_configure(void) configure_pktio_pmr_composite(); }
-void classification_test_pktio_test(void) +static void classification_test_pktio_test(void) { /* Test Different CoS on the pktio interface */ if (TEST_DEFAULT)
commit fd22012f6f8e621fb22d5f4d6c15347f9535a902 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: crypto: simplify test infrastructure
Merge separate file with just main() function into main test file. Merge crypto.c file containing several small functions into test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/crypto/Makefile.am b/test/validation/api/crypto/Makefile.am index 238ce189..cc4d49d6 100644 --- a/test/validation/api/crypto/Makefile.am +++ b/test/validation/api/crypto/Makefile.am @@ -1,10 +1,7 @@ include ../Makefile.inc
test_PROGRAMS = crypto_main -crypto_main_SOURCES = crypto_main.c \ - crypto.c \ - crypto.h \ +crypto_main_SOURCES = \ odp_crypto_test_inp.c \ - odp_crypto_test_inp.h \ test_vectors.h \ test_vectors_len.h diff --git a/test/validation/api/crypto/crypto.c b/test/validation/api/crypto/crypto.c deleted file mode 100644 index 7298d544..00000000 --- a/test/validation/api/crypto/crypto.c +++ /dev/null @@ -1,135 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include <odp_api.h> -#include <odp_cunit_common.h> -#include "odp_crypto_test_inp.h" -#include "crypto.h" - -#define PKT_POOL_NUM 64 -#define PKT_POOL_LEN (1 * 1024) - -odp_suiteinfo_t crypto_suites[] = { - {ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, - crypto_suite_term, crypto_suite}, - {ODP_CRYPTO_ASYNC_INP, crypto_suite_async_init, - crypto_suite_term, crypto_suite}, - {ODP_CRYPTO_PACKET_SYNC_INP, crypto_suite_packet_sync_init, - crypto_suite_term, crypto_suite}, - {ODP_CRYPTO_PACKET_ASYNC_INP, crypto_suite_packet_async_init, - crypto_suite_term, crypto_suite}, - ODP_SUITE_INFO_NULL, -}; - -int crypto_init(odp_instance_t *inst) -{ - odp_pool_param_t params; - odp_pool_t pool; - odp_queue_t out_queue; - odp_pool_capability_t pool_capa; - - if (0 != odp_init_global(inst, NULL, NULL)) { - fprintf(stderr, "error: odp_init_global() failed.\n"); - return -1; - } - - if (0 != odp_init_local(*inst, ODP_THREAD_CONTROL)) { - fprintf(stderr, "error: odp_init_local() failed.\n"); - return -1; - } - - if (odp_pool_capability(&pool_capa) < 0) { - fprintf(stderr, "error: odp_pool_capability() failed.\n"); - return -1; - } - - odp_pool_param_init(¶ms); - params.pkt.seg_len = PKT_POOL_LEN; - params.pkt.len = PKT_POOL_LEN; - params.pkt.num = PKT_POOL_NUM; - params.type = ODP_POOL_PACKET; - - if (pool_capa.pkt.max_seg_len && - PKT_POOL_LEN > pool_capa.pkt.max_seg_len) { - fprintf(stderr, "Warning: small packet segment length\n"); - params.pkt.seg_len = pool_capa.pkt.max_seg_len; - } - - if (pool_capa.pkt.max_len && - PKT_POOL_LEN > pool_capa.pkt.max_len) { - fprintf(stderr, "Pool max packet length too small\n"); - return -1; - } - - pool = odp_pool_create("packet_pool", ¶ms); - - if (ODP_POOL_INVALID == pool) { - fprintf(stderr, "Packet pool creation failed.\n"); - return -1; - } - out_queue = odp_queue_create("crypto-out", NULL); - if (ODP_QUEUE_INVALID == out_queue) { - fprintf(stderr, "Crypto outq creation failed.\n"); - return -1; - } - - return 0; -} - -int crypto_term(odp_instance_t inst) -{ - odp_pool_t pool; - odp_queue_t out_queue; - - out_queue = odp_queue_lookup("crypto-out"); - if (ODP_QUEUE_INVALID != out_queue) { - if (odp_queue_destroy(out_queue)) - fprintf(stderr, "Crypto outq destroy failed.\n"); - } else { - fprintf(stderr, "Crypto outq not found.\n"); - } - - pool = odp_pool_lookup("packet_pool"); - if (ODP_POOL_INVALID != pool) { - if (odp_pool_destroy(pool)) - fprintf(stderr, "Packet pool destroy failed.\n"); - } else { - fprintf(stderr, "Packet pool not found.\n"); - } - - if (0 != odp_term_local()) { - fprintf(stderr, "error: odp_term_local() failed.\n"); - return -1; - } - - if (0 != odp_term_global(inst)) { - fprintf(stderr, "error: odp_term_global() failed.\n"); - return -1; - } - - return 0; -} - -int crypto_main(int argc, char *argv[]) -{ - int ret; - - /* parse common options: */ - if (odp_cunit_parse_options(argc, argv)) - return -1; - - odp_cunit_register_global_init(crypto_init); - odp_cunit_register_global_term(crypto_term); - - ret = odp_cunit_register(crypto_suites); - - if (ret == 0) - ret = odp_cunit_run(); - - return ret; -} diff --git a/test/validation/api/crypto/crypto.h b/test/validation/api/crypto/crypto.h deleted file mode 100644 index 078a1909..00000000 --- a/test/validation/api/crypto/crypto.h +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_CRYPTO_H_ -#define _ODP_TEST_CRYPTO_H_ - -#include "odp_cunit_common.h" - -/* test functions: */ -void crypto_test_enc_alg_null(void); -void crypto_test_dec_alg_null(void); -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_enc_alg_aes_cbc(void); -void crypto_test_enc_alg_aes_cbc_ovr_iv(void); -void crypto_test_dec_alg_aes_cbc(void); -void crypto_test_dec_alg_aes_cbc_ovr_iv(void); -void crypto_test_enc_alg_aes_ctr(void); -void crypto_test_enc_alg_aes_ctr_ovr_iv(void); -void crypto_test_dec_alg_aes_ctr(void); -void crypto_test_dec_alg_aes_ctr_ovr_iv(void); -void crypto_test_enc_alg_aes_gcm(void); -void crypto_test_enc_alg_aes_gcm_ovr_iv(void); -void crypto_test_dec_alg_aes_gcm(void); -void crypto_test_dec_alg_aes_gcm_ovr_iv(void); -void crypto_test_gen_alg_hmac_md5(void); -void crypto_test_check_alg_hmac_md5(void); -void crypto_test_gen_alg_hmac_sha1(void); -void crypto_test_check_alg_hmac_sha1(void); -void crypto_test_gen_alg_hmac_sha256(void); -void crypto_test_check_alg_hmac_sha256(void); -void crypto_test_gen_alg_hmac_sha512(void); -void crypto_test_check_alg_hmac_sha512(void); -void crypto_test_gen_alg_aes_gmac(void); -void crypto_test_check_alg_aes_gmac(void); - -/* test arrays: */ -extern odp_testinfo_t crypto_suite[]; - -/* test array init/term functions: */ -int crypto_suite_sync_init(void); -int crypto_suite_async_init(void); - -/* test registry: */ -extern odp_suiteinfo_t crypto_suites[]; - -/* executable init/term functions: */ -int crypto_init(odp_instance_t *inst); -int crypto_term(odp_instance_t inst); - -/* main test program: */ -int crypto_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/crypto/crypto_main.c b/test/validation/api/crypto/crypto_main.c deleted file mode 100644 index 2d5c6c7e..00000000 --- a/test/validation/api/crypto/crypto_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "crypto.h" - -int main(int argc, char *argv[]) -{ - return crypto_main(argc, argv); -} diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c index df1c7b6f..ec477535 100644 --- a/test/validation/api/crypto/odp_crypto_test_inp.c +++ b/test/validation/api/crypto/odp_crypto_test_inp.c @@ -10,11 +10,12 @@ #include <CUnit/Basic.h> #include <odp_cunit_common.h> #include "test_vectors.h" -#include "odp_crypto_test_inp.h" -#include "crypto.h"
#define MAX_ALG_CAPA 32
+#define PKT_POOL_NUM 64 +#define PKT_POOL_LEN (1 * 1024) + struct suite_context_s { odp_bool_t packet; odp_crypto_op_mode_t op_mode; @@ -686,7 +687,7 @@ static int check_alg_null(void) }
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) -void crypto_test_enc_alg_null(void) +static void crypto_test_enc_alg_null(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_NULL, @@ -696,7 +697,7 @@ void crypto_test_enc_alg_null(void) false); }
-void crypto_test_dec_alg_null(void) +static void crypto_test_dec_alg_null(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_NULL, @@ -715,7 +716,7 @@ static int check_alg_3des_cbc(void) * 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.*/ -void crypto_test_enc_alg_3des_cbc(void) +static void crypto_test_enc_alg_3des_cbc(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_3DES_CBC, @@ -728,7 +729,7 @@ 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. * */ -void crypto_test_enc_alg_3des_cbc_ovr_iv(void) +static void crypto_test_enc_alg_3des_cbc_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_3DES_CBC, @@ -743,7 +744,7 @@ 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. * */ -void crypto_test_dec_alg_3des_cbc(void) +static void crypto_test_dec_alg_3des_cbc(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_3DES_CBC, @@ -758,7 +759,7 @@ 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. * */ -void crypto_test_dec_alg_3des_cbc_ovr_iv(void) +static void crypto_test_dec_alg_3des_cbc_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_3DES_CBC, @@ -777,7 +778,7 @@ static int check_alg_aes_gcm(void) * operation for AES128_GCM 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.*/ -void crypto_test_enc_alg_aes_gcm(void) +static void crypto_test_enc_alg_aes_gcm(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_AES_GCM, @@ -791,7 +792,7 @@ void crypto_test_enc_alg_aes_gcm(void) * operation for AES128_GCM 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.*/ -void crypto_test_enc_alg_aes_gcm_ovr_iv(void) +static void crypto_test_enc_alg_aes_gcm_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_AES_GCM, @@ -806,7 +807,7 @@ void crypto_test_enc_alg_aes_gcm_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_gcm(void) +static void crypto_test_dec_alg_aes_gcm(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_AES_GCM, @@ -821,7 +822,7 @@ void crypto_test_dec_alg_aes_gcm(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_gcm_ovr_iv(void) +static void crypto_test_dec_alg_aes_gcm_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_AES_GCM, @@ -840,7 +841,7 @@ static int check_alg_aes_cbc(void) * operation for AES128_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.*/ -void crypto_test_enc_alg_aes_cbc(void) +static void crypto_test_enc_alg_aes_cbc(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_AES_CBC, @@ -853,7 +854,7 @@ void crypto_test_enc_alg_aes_cbc(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for AES128_CBC algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_aes_cbc_ovr_iv(void) +static void crypto_test_enc_alg_aes_cbc_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_AES_CBC, @@ -868,7 +869,7 @@ void crypto_test_enc_alg_aes_cbc_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_cbc(void) +static void crypto_test_dec_alg_aes_cbc(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_AES_CBC, @@ -883,7 +884,7 @@ void crypto_test_dec_alg_aes_cbc(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_cbc_ovr_iv(void) +static void crypto_test_dec_alg_aes_cbc_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_AES_CBC, @@ -902,7 +903,7 @@ static int check_alg_aes_ctr(void) * operation for AES128_CTR 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.*/ -void crypto_test_enc_alg_aes_ctr(void) +static void crypto_test_enc_alg_aes_ctr(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_AES_CTR, @@ -915,7 +916,7 @@ void crypto_test_enc_alg_aes_ctr(void) /* This test verifies the correctness of encode (plaintext -> ciphertext) * operation for AES128_CTR algorithm. IV for the operation is the operation IV. * */ -void crypto_test_enc_alg_aes_ctr_ovr_iv(void) +static void crypto_test_enc_alg_aes_ctr_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_AES_CTR, @@ -930,7 +931,7 @@ void crypto_test_enc_alg_aes_ctr_ovr_iv(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_ctr(void) +static void crypto_test_dec_alg_aes_ctr(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_AES_CTR, @@ -945,7 +946,7 @@ void crypto_test_dec_alg_aes_ctr(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_dec_alg_aes_ctr_ovr_iv(void) +static void crypto_test_dec_alg_aes_ctr_ovr_iv(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_AES_CTR, @@ -967,7 +968,7 @@ static int check_alg_hmac_md5(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_md5(void) +static void crypto_test_gen_alg_hmac_md5(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_NULL, @@ -977,7 +978,7 @@ void crypto_test_gen_alg_hmac_md5(void) false); }
-void crypto_test_check_alg_hmac_md5(void) +static void crypto_test_check_alg_hmac_md5(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_NULL, @@ -999,7 +1000,7 @@ static int check_alg_hmac_sha1(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha1(void) +static void crypto_test_gen_alg_hmac_sha1(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_NULL, @@ -1009,7 +1010,7 @@ void crypto_test_gen_alg_hmac_sha1(void) false); }
-void crypto_test_check_alg_hmac_sha1(void) +static void crypto_test_check_alg_hmac_sha1(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_NULL, @@ -1031,7 +1032,7 @@ static int check_alg_hmac_sha256(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha256(void) +static void crypto_test_gen_alg_hmac_sha256(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_NULL, @@ -1041,7 +1042,7 @@ void crypto_test_gen_alg_hmac_sha256(void) false); }
-void crypto_test_check_alg_hmac_sha256(void) +static void crypto_test_check_alg_hmac_sha256(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_NULL, @@ -1063,7 +1064,7 @@ static int check_alg_hmac_sha512(void) * In addition the test verifies if the implementation can use the * packet buffer as completion event buffer. * */ -void crypto_test_gen_alg_hmac_sha512(void) +static void crypto_test_gen_alg_hmac_sha512(void) { check_alg(ODP_CRYPTO_OP_ENCODE, ODP_CIPHER_ALG_NULL, @@ -1073,7 +1074,7 @@ void crypto_test_gen_alg_hmac_sha512(void) false); }
-void crypto_test_check_alg_hmac_sha512(void) +static void crypto_test_check_alg_hmac_sha512(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_NULL, @@ -1088,7 +1089,7 @@ static int check_alg_aes_gmac(void) return check_alg_support(ODP_CIPHER_ALG_NULL, ODP_AUTH_ALG_AES_GMAC); }
-void crypto_test_gen_alg_aes_gmac(void) +static void crypto_test_gen_alg_aes_gmac(void) { unsigned int test_vec_num = (sizeof(aes_gmac_reference) / sizeof(aes_gmac_reference[0])); @@ -1103,7 +1104,7 @@ void crypto_test_gen_alg_aes_gmac(void) false); }
-void crypto_test_check_alg_aes_gmac(void) +static void crypto_test_check_alg_aes_gmac(void) { check_alg(ODP_CRYPTO_OP_DECODE, ODP_CIPHER_ALG_NULL, @@ -1113,7 +1114,7 @@ void crypto_test_check_alg_aes_gmac(void) false); }
-int crypto_suite_sync_init(void) +static int crypto_suite_sync_init(void) { suite_context.pool = odp_pool_lookup("packet_pool"); if (suite_context.pool == ODP_POOL_INVALID) @@ -1124,7 +1125,7 @@ int crypto_suite_sync_init(void) return 0; }
-int crypto_suite_async_init(void) +static int crypto_suite_async_init(void) { suite_context.pool = odp_pool_lookup("packet_pool"); if (suite_context.pool == ODP_POOL_INVALID) @@ -1137,7 +1138,7 @@ int crypto_suite_async_init(void) return 0; }
-int crypto_suite_packet_sync_init(void) +static int crypto_suite_packet_sync_init(void) { suite_context.packet = true; suite_context.op_mode = ODP_CRYPTO_SYNC; @@ -1150,7 +1151,7 @@ int crypto_suite_packet_sync_init(void) return 0; }
-int crypto_suite_packet_async_init(void) +static int crypto_suite_packet_async_init(void) { suite_context.packet = true; suite_context.op_mode = ODP_CRYPTO_ASYNC; @@ -1225,7 +1226,7 @@ odp_testinfo_t crypto_suite[] = { ODP_TEST_INFO_NULL, };
-int crypto_suite_term(void) +static int crypto_suite_term(void) { int i; int first = 1; @@ -1242,3 +1243,129 @@ int crypto_suite_term(void) } return 0; } + +/* Suite names */ +#define ODP_CRYPTO_SYNC_INP "odp_crypto_sync_inp" +#define ODP_CRYPTO_ASYNC_INP "odp_crypto_async_inp" +#define ODP_CRYPTO_PACKET_SYNC_INP "odp_crypto_packet_sync_inp" +#define ODP_CRYPTO_PACKET_ASYNC_INP "odp_crypto_packet_async_inp" + +odp_suiteinfo_t crypto_suites[] = { + {ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, + crypto_suite_term, crypto_suite}, + {ODP_CRYPTO_ASYNC_INP, crypto_suite_async_init, + crypto_suite_term, crypto_suite}, + {ODP_CRYPTO_PACKET_SYNC_INP, crypto_suite_packet_sync_init, + crypto_suite_term, crypto_suite}, + {ODP_CRYPTO_PACKET_ASYNC_INP, crypto_suite_packet_async_init, + crypto_suite_term, crypto_suite}, + ODP_SUITE_INFO_NULL, +}; + +static int crypto_init(odp_instance_t *inst) +{ + odp_pool_param_t params; + odp_pool_t pool; + odp_queue_t out_queue; + odp_pool_capability_t pool_capa; + + if (0 != odp_init_global(inst, NULL, NULL)) { + fprintf(stderr, "error: odp_init_global() failed.\n"); + return -1; + } + + if (0 != odp_init_local(*inst, ODP_THREAD_CONTROL)) { + fprintf(stderr, "error: odp_init_local() failed.\n"); + return -1; + } + + if (odp_pool_capability(&pool_capa) < 0) { + fprintf(stderr, "error: odp_pool_capability() failed.\n"); + return -1; + } + + odp_pool_param_init(¶ms); + params.pkt.seg_len = PKT_POOL_LEN; + params.pkt.len = PKT_POOL_LEN; + params.pkt.num = PKT_POOL_NUM; + params.type = ODP_POOL_PACKET; + + if (pool_capa.pkt.max_seg_len && + PKT_POOL_LEN > pool_capa.pkt.max_seg_len) { + fprintf(stderr, "Warning: small packet segment length\n"); + params.pkt.seg_len = pool_capa.pkt.max_seg_len; + } + + if (pool_capa.pkt.max_len && + PKT_POOL_LEN > pool_capa.pkt.max_len) { + fprintf(stderr, "Pool max packet length too small\n"); + return -1; + } + + pool = odp_pool_create("packet_pool", ¶ms); + + if (ODP_POOL_INVALID == pool) { + fprintf(stderr, "Packet pool creation failed.\n"); + return -1; + } + out_queue = odp_queue_create("crypto-out", NULL); + if (ODP_QUEUE_INVALID == out_queue) { + fprintf(stderr, "Crypto outq creation failed.\n"); + return -1; + } + + return 0; +} + +static int crypto_term(odp_instance_t inst) +{ + odp_pool_t pool; + odp_queue_t out_queue; + + out_queue = odp_queue_lookup("crypto-out"); + if (ODP_QUEUE_INVALID != out_queue) { + if (odp_queue_destroy(out_queue)) + fprintf(stderr, "Crypto outq destroy failed.\n"); + } else { + fprintf(stderr, "Crypto outq not found.\n"); + } + + pool = odp_pool_lookup("packet_pool"); + if (ODP_POOL_INVALID != pool) { + if (odp_pool_destroy(pool)) + fprintf(stderr, "Packet pool destroy failed.\n"); + } else { + fprintf(stderr, "Packet pool not found.\n"); + } + + if (0 != odp_term_local()) { + fprintf(stderr, "error: odp_term_local() failed.\n"); + return -1; + } + + if (0 != odp_term_global(inst)) { + fprintf(stderr, "error: odp_term_global() failed.\n"); + return -1; + } + + return 0; +} + +int main(int argc, char *argv[]) +{ + int ret; + + /* parse common options: */ + if (odp_cunit_parse_options(argc, argv)) + return -1; + + odp_cunit_register_global_init(crypto_init); + odp_cunit_register_global_term(crypto_term); + + ret = odp_cunit_register(crypto_suites); + + if (ret == 0) + ret = odp_cunit_run(); + + return ret; +} diff --git a/test/validation/api/crypto/odp_crypto_test_inp.h b/test/validation/api/crypto/odp_crypto_test_inp.h deleted file mode 100644 index c50b8493..00000000 --- a/test/validation/api/crypto/odp_crypto_test_inp.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef ODP_CRYPTO_TEST_ASYNC_INP_ -#define ODP_CRYPTO_TEST_ASYNC_INP_ - -#include <odp_cunit_common.h> - -/* Suite names */ -#define ODP_CRYPTO_SYNC_INP "odp_crypto_sync_inp" -#define ODP_CRYPTO_ASYNC_INP "odp_crypto_async_inp" -#define ODP_CRYPTO_PACKET_SYNC_INP "odp_crypto_packet_sync_inp" -#define ODP_CRYPTO_PACKET_ASYNC_INP "odp_crypto_packet_async_inp" - -/* Suite test array */ -extern odp_testinfo_t crypto_suite[]; - -int crypto_suite_sync_init(void); -int crypto_suite_async_init(void); -int crypto_suite_packet_sync_init(void); -int crypto_suite_packet_async_init(void); -int crypto_suite_term(void); - -#endif
commit c2837dee41364443bc95aa97611e3d721ef16813 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: traffic_mngr: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/traffic_mngr/Makefile.am b/test/validation/api/traffic_mngr/Makefile.am index 82996afe..1f49d4cb 100644 --- a/test/validation/api/traffic_mngr/Makefile.am +++ b/test/validation/api/traffic_mngr/Makefile.am @@ -8,7 +8,7 @@ TEST_EXTENSIONS = .sh TESTS = $(TESTSCRIPTS)
test_PROGRAMS = traffic_mngr_main -traffic_mngr_main_SOURCES = traffic_mngr_main.c traffic_mngr.c traffic_mngr.h +traffic_mngr_main_SOURCES = traffic_mngr.c LDADD += -lm
dist_check_SCRIPTS = $(TESTSCRIPTS) diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index fb7bb461..7bcd8e5f 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -19,7 +19,6 @@ #include <odp/helper/odph_api.h> #include <test_debug.h> #include "odp_cunit_common.h" -#include "traffic_mngr.h"
#define TM_DEBUG 0
@@ -2044,7 +2043,7 @@ static int destroy_tm_systems(void) return 0; }
-int traffic_mngr_suite_init(void) +static int traffic_mngr_suite_init(void) { uint32_t payload_len, copy_len;
@@ -2088,7 +2087,7 @@ int traffic_mngr_suite_init(void) return 0; }
-int traffic_mngr_suite_term(void) +static int traffic_mngr_suite_term(void) { uint32_t iface;
@@ -2133,7 +2132,7 @@ static void check_shaper_profile(char *shaper_name, uint32_t shaper_idx) CU_ASSERT(shaper_params.dual_rate == 0); }
-void traffic_mngr_test_shaper_profile(void) +static void traffic_mngr_test_shaper_profile(void) { odp_tm_shaper_params_t shaper_params; odp_tm_shaper_t profile; @@ -2197,7 +2196,7 @@ static void check_sched_profile(char *sched_name, uint32_t sched_idx) } }
-void traffic_mngr_test_sched_profile(void) +static void traffic_mngr_test_sched_profile(void) { odp_tm_sched_params_t sched_params; odp_tm_sched_t profile; @@ -2261,7 +2260,7 @@ static void check_threshold_profile(char *threshold_name, CU_ASSERT(threshold_params.enable_max_bytes == 1); }
-void traffic_mngr_test_threshold_profile(void) +static void traffic_mngr_test_threshold_profile(void) { odp_tm_threshold_params_t threshold_params; odp_tm_threshold_t profile; @@ -2325,7 +2324,7 @@ static void check_wred_profile(char *wred_name, CU_ASSERT(wred_params.use_byte_fullness == 0); }
-void traffic_mngr_test_wred_profile(void) +static void traffic_mngr_test_wred_profile(void) { odp_tm_wred_params_t wred_params; odp_tm_wred_t profile; @@ -2416,7 +2415,7 @@ static int set_shaper(const char *node_name, return odp_tm_node_shaper_config(tm_node, shaper_profile); }
-int traffic_mngr_check_shaper(void) +static int traffic_mngr_check_shaper(void) { odp_cpumask_t cpumask; int cpucount = odp_cpumask_all_available(&cpumask); @@ -2431,7 +2430,7 @@ int traffic_mngr_check_shaper(void) return ODP_TEST_ACTIVE; }
-int traffic_mngr_check_scheduler(void) +static int traffic_mngr_check_scheduler(void) { odp_cpumask_t cpumask; int cpucount = odp_cpumask_all_available(&cpumask); @@ -3808,19 +3807,19 @@ static int test_fanin_info(const char *node_name) return walk_tree_backwards(node_desc->node); }
-void traffic_mngr_test_capabilities(void) +static void traffic_mngr_test_capabilities(void) { CU_ASSERT(test_overall_capabilities() == 0); }
-void traffic_mngr_test_tm_create(void) +static void traffic_mngr_test_tm_create(void) { /* Create the first/primary TM system. */ CU_ASSERT_FATAL(create_tm_system() == 0); dump_tm_tree(0); }
-void traffic_mngr_test_shaper(void) +static void traffic_mngr_test_shaper(void) { CU_ASSERT(test_shaper_bw("bw1", "node_1_1_1", 0, 1 * MBPS) == 0); CU_ASSERT(test_shaper_bw("bw4", "node_1_1_1", 1, 4 * MBPS) == 0); @@ -3829,7 +3828,7 @@ void traffic_mngr_test_shaper(void) CU_ASSERT(test_shaper_bw("bw100", "node_1_1_2", 0, 100 * MBPS) == 0); }
-void traffic_mngr_test_scheduler(void) +static void traffic_mngr_test_scheduler(void) { CU_ASSERT(test_sched_queue_priority("que_prio", "node_1_1_3", 10) == 0); return; @@ -3848,7 +3847,7 @@ void traffic_mngr_test_scheduler(void) INCREASING_WEIGHTS) == 0); }
-void traffic_mngr_test_thresholds(void) +static void traffic_mngr_test_thresholds(void) { CU_ASSERT(test_threshold("thresh_A", "shaper_A", "node_1_2_1", 0, 16, 0) == 0); @@ -3856,7 +3855,7 @@ void traffic_mngr_test_thresholds(void) 0, 6400) == 0); }
-void traffic_mngr_test_byte_wred(void) +static void traffic_mngr_test_byte_wred(void) { if (!tm_capabilities.tm_queue_wred_supported) { LOG_DBG("\nwas not run because tm_capabilities indicates" @@ -3879,7 +3878,7 @@ void traffic_mngr_test_byte_wred(void) ODP_PACKET_GREEN, TM_PERCENT(30), false) == 0); }
-void traffic_mngr_test_pkt_wred(void) +static void traffic_mngr_test_pkt_wred(void) { int rc;
@@ -3912,13 +3911,13 @@ void traffic_mngr_test_pkt_wred(void) ODP_PACKET_RED, TM_PERCENT(70), true) == 0); }
-void traffic_mngr_test_query(void) +static void traffic_mngr_test_query(void) { CU_ASSERT(test_query_functions("query_shaper", "node_1_3_3", 3, 10) == 0); }
-void traffic_mngr_test_marking(void) +static void traffic_mngr_test_marking(void) { odp_packet_color_t color; odp_bool_t test_ecn, test_drop_prec; @@ -3967,14 +3966,14 @@ void traffic_mngr_test_marking(void) } }
-void traffic_mngr_test_fanin_info(void) +static void traffic_mngr_test_fanin_info(void) { CU_ASSERT(test_fanin_info("node_1") == 0); CU_ASSERT(test_fanin_info("node_1_2") == 0); CU_ASSERT(test_fanin_info("node_1_3_7") == 0); }
-void traffic_mngr_test_destroy(void) +static void traffic_mngr_test_destroy(void) { CU_ASSERT(destroy_tm_systems() == 0); } @@ -4006,7 +4005,7 @@ odp_suiteinfo_t traffic_mngr_suites[] = { ODP_SUITE_INFO_NULL };
-int traffic_mngr_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* parse common options: */ if (odp_cunit_parse_options(argc, argv)) diff --git a/test/validation/api/traffic_mngr/traffic_mngr.h b/test/validation/api/traffic_mngr/traffic_mngr.h deleted file mode 100644 index af115fef..00000000 --- a/test/validation/api/traffic_mngr/traffic_mngr.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_TRAFFIC_MNGR_H_ -#define _ODP_TEST_TRAFFIC_MNGR_H_ - -#include <odp_cunit_common.h> - -int traffic_mngr_check_shaper(void); -int traffic_mngr_check_scheduler(void); - -/* test functions: */ -void traffic_mngr_test_capabilities(void); -void traffic_mngr_test_tm_create(void); -void traffic_mngr_test_shaper_profile(void); -void traffic_mngr_test_sched_profile(void); -void traffic_mngr_test_threshold_profile(void); -void traffic_mngr_test_wred_profile(void); -void traffic_mngr_test_shaper(void); -void traffic_mngr_test_scheduler(void); -void traffic_mngr_test_thresholds(void); -void traffic_mngr_test_byte_wred(void); -void traffic_mngr_test_pkt_wred(void); -void traffic_mngr_test_query(void); -void traffic_mngr_test_marking(void); -void traffic_mngr_test_fanin_info(void); -void traffic_mngr_test_destroy(void); - -/* test arrays: */ -extern odp_testinfo_t traffic_mngr_suite[]; - -/* test suite init/term functions: */ -int traffic_mngr_suite_init(void); -int traffic_mngr_suite_term(void); - -/* test registry: */ -extern odp_suiteinfo_t traffic_mngr_suites[]; - -/* main test program: */ -int traffic_mngr_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/traffic_mngr/traffic_mngr_main.c b/test/validation/api/traffic_mngr/traffic_mngr_main.c deleted file mode 100644 index ec4555e6..00000000 --- a/test/validation/api/traffic_mngr/traffic_mngr_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "traffic_mngr.h" - -int main(int argc, char *argv[]) -{ - return traffic_mngr_main(argc, argv); -}
commit eba4477a5cd5300d608ddfc53ff00cd3e51805a6 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: timer: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/timer/Makefile.am b/test/validation/api/timer/Makefile.am index 57617440..bc33e731 100644 --- a/test/validation/api/timer/Makefile.am +++ b/test/validation/api/timer/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = timer_main -timer_main_SOURCES = timer_main.c timer.c timer.h +timer_main_SOURCES = timer.c diff --git a/test/validation/api/timer/timer.c b/test/validation/api/timer/timer.c index 7ea508aa..26a5b608 100644 --- a/test/validation/api/timer/timer.c +++ b/test/validation/api/timer/timer.c @@ -20,7 +20,6 @@ #include <odp/helper/odph_api.h> #include "odp_cunit_common.h" #include "test_debug.h" -#include "timer.h"
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
@@ -56,7 +55,7 @@ struct test_timer {
#define TICK_INVALID (~(uint64_t)0)
-void timer_test_timeout_pool_alloc(void) +static void timer_test_timeout_pool_alloc(void) { odp_pool_t pool; const int num = 3; @@ -110,7 +109,7 @@ void timer_test_timeout_pool_alloc(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void timer_test_timeout_pool_free(void) +static void timer_test_timeout_pool_free(void) { odp_pool_t pool; odp_timeout_t tmo; @@ -141,7 +140,7 @@ void timer_test_timeout_pool_free(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void timer_test_odp_timer_cancel(void) +static void timer_test_odp_timer_cancel(void) { odp_pool_t pool; odp_pool_param_t params; @@ -504,7 +503,7 @@ static int worker_entrypoint(void *arg TEST_UNUSED) }
/* @private Timer test case entrypoint */ -void timer_test_odp_timer_all(void) +static void timer_test_odp_timer_all(void) { int rc; odp_pool_param_t params; @@ -630,7 +629,7 @@ odp_suiteinfo_t timer_suites[] = { ODP_SUITE_INFO_NULL, };
-int timer_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { /* parse common options: */ if (odp_cunit_parse_options(argc, argv)) diff --git a/test/validation/api/timer/timer.h b/test/validation/api/timer/timer.h deleted file mode 100644 index bd304fff..00000000 --- a/test/validation/api/timer/timer.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_TIMER_H_ -#define _ODP_TEST_TIMER_H_ - -#include <odp_cunit_common.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 odp_testinfo_t timer_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t timer_suites[]; - -/* main test program: */ -int timer_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/timer/timer_main.c b/test/validation/api/timer/timer_main.c deleted file mode 100644 index f65c1e3a..00000000 --- a/test/validation/api/timer/timer_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "timer.h" - -int main(int argc, char *argv[]) -{ - return timer_main(argc, argv); -}
commit 3e90ecc0bfa4487a29fbdff7ccc1cf5a2a1e8bc0 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: time: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/time/Makefile.am b/test/validation/api/time/Makefile.am index bedbfa37..9b0392eb 100644 --- a/test/validation/api/time/Makefile.am +++ b/test/validation/api/time/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = time_main -time_main_SOURCES = time_main.c time.c time_test.h +time_main_SOURCES = time.c diff --git a/test/validation/api/time/time.c b/test/validation/api/time/time.c index d7d5b790..2be9914b 100644 --- a/test/validation/api/time/time.c +++ b/test/validation/api/time/time.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include "odp_cunit_common.h" -#include "time_test.h" #include <time.h>
#define BUSY_LOOP_CNT 30000000 /* used for t > min resolution */ @@ -25,7 +24,7 @@ typedef odp_time_t time_cb(void); typedef uint64_t time_res_cb(void); typedef odp_time_t time_from_ns_cb(uint64_t ns);
-void time_test_constants(void) +static void time_test_constants(void) { uint64_t ns;
@@ -48,12 +47,12 @@ static void time_test_res(time_res_cb time_res, uint64_t *res) (*res)++; }
-void time_test_local_res(void) +static void time_test_local_res(void) { time_test_res(odp_time_local_res, &local_res); }
-void time_test_global_res(void) +static void time_test_global_res(void) { time_test_res(odp_time_global_res, &global_res); } @@ -92,17 +91,17 @@ static void time_test_conversion(time_from_ns_cb time_from_ns, uint64_t res) CU_ASSERT(ns1 == 0); }
-void time_test_local_conversion(void) +static void time_test_local_conversion(void) { time_test_conversion(odp_time_local_from_ns, local_res); }
-void time_test_global_conversion(void) +static void time_test_global_conversion(void) { time_test_conversion(odp_time_global_from_ns, global_res); }
-void time_test_monotony(void) +static void time_test_monotony(void) { volatile uint64_t count = 0; odp_time_t l_t1, l_t2, l_t3; @@ -183,12 +182,12 @@ static void time_test_cmp(time_cb time_cur, time_from_ns_cb time_from_ns) CU_ASSERT(odp_time_cmp(t1, ODP_TIME_NULL) == 0); }
-void time_test_local_cmp(void) +static void time_test_local_cmp(void) { time_test_cmp(odp_time_local, odp_time_local_from_ns); }
-void time_test_global_cmp(void) +static void time_test_global_cmp(void) { time_test_cmp(odp_time_global, odp_time_global_from_ns); } @@ -278,12 +277,12 @@ static void time_test_diff(time_cb time_cur, CU_ASSERT(diff_ns == 0); }
-void time_test_local_diff(void) +static void time_test_local_diff(void) { time_test_diff(odp_time_local, odp_time_local_from_ns, local_res); }
-void time_test_global_diff(void) +static void time_test_global_diff(void) { time_test_diff(odp_time_global, odp_time_global_from_ns, global_res); } @@ -330,12 +329,12 @@ static void time_test_sum(time_cb time_cur, CU_ASSERT(odp_time_cmp(t2, sum) == 0); }
-void time_test_local_sum(void) +static void time_test_local_sum(void) { time_test_sum(odp_time_local, odp_time_local_from_ns, local_res); }
-void time_test_global_sum(void) +static void time_test_global_sum(void) { time_test_sum(odp_time_global, odp_time_global_from_ns, global_res); } @@ -376,17 +375,17 @@ static void time_test_wait_until(time_cb time_cur, time_from_ns_cb time_from_ns) } }
-void time_test_local_wait_until(void) +static void time_test_local_wait_until(void) { time_test_wait_until(odp_time_local, odp_time_local_from_ns); }
-void time_test_global_wait_until(void) +static void time_test_global_wait_until(void) { time_test_wait_until(odp_time_global, odp_time_global_from_ns); }
-void time_test_wait_ns(void) +static void time_test_wait_ns(void) { int i; odp_time_t lower_limit, upper_limit; @@ -494,7 +493,7 @@ odp_suiteinfo_t time_suites[] = { ODP_SUITE_INFO_NULL };
-int time_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/time/time_main.c b/test/validation/api/time/time_main.c deleted file mode 100644 index c39a0ea1..00000000 --- a/test/validation/api/time/time_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "time_test.h" - -int main(int argc, char *argv[]) -{ - return time_main(argc, argv); -} diff --git a/test/validation/api/time/time_test.h b/test/validation/api/time/time_test.h deleted file mode 100644 index 10956294..00000000 --- a/test/validation/api/time/time_test.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_TIME_H_ -#define _ODP_TEST_TIME_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void time_test_constants(void); -void time_test_local_res(void); -void time_test_global_res(void); -void time_test_local_conversion(void); -void time_test_global_conversion(void); -void time_test_local_cmp(void); -void time_test_global_cmp(void); -void time_test_local_diff(void); -void time_test_global_diff(void); -void time_test_local_sum(void); -void time_test_global_sum(void); -void time_test_local_wait_until(void); -void time_test_global_wait_until(void); -void time_test_wait_ns(void); -void time_test_monotony(void); - -/* test arrays: */ -extern odp_testinfo_t time_suite_time[]; - -/* test registry: */ -extern odp_suiteinfo_t time_suites[]; - -/* main test program: */ -int time_main(int argc, char *argv[]); - -#endif
commit dfa1ee94dae761166126445739be0dd6843f6792 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: thread: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/thread/Makefile.am b/test/validation/api/thread/Makefile.am index 2282169b..cbd8b2a7 100644 --- a/test/validation/api/thread/Makefile.am +++ b/test/validation/api/thread/Makefile.am @@ -2,5 +2,5 @@ include ../Makefile.inc
test_PROGRAMS = thread_main thread_main_CPPFLAGS = $(AM_CPPFLAGS) -DTEST_THRMASK -thread_main_SOURCES = thread_main.c thread.c thread.h +thread_main_SOURCES = thread.c LDADD += $(LIBTHRMASK_COMMON) diff --git a/test/validation/api/thread/thread.c b/test/validation/api/thread/thread.c index ada4affc..fe504e88 100644 --- a/test/validation/api/thread/thread.c +++ b/test/validation/api/thread/thread.c @@ -10,25 +10,24 @@ #include <odp_cunit_common.h> #include <mask_common.h> #include <test_debug.h> -#include "thread.h"
/* Test thread entry and exit synchronization barriers */ odp_barrier_t bar_entry; odp_barrier_t bar_exit;
-void thread_test_odp_cpu_id(void) +static void thread_test_odp_cpu_id(void) { (void)odp_cpu_id(); CU_PASS(); }
-void thread_test_odp_thread_id(void) +static void thread_test_odp_thread_id(void) { (void)odp_thread_id(); CU_PASS(); }
-void thread_test_odp_thread_count(void) +static void thread_test_odp_thread_count(void) { (void)odp_thread_count(); CU_PASS(); @@ -47,7 +46,7 @@ static int thread_func(void *arg TEST_UNUSED) return CU_get_number_of_failures(); }
-void thread_test_odp_thrmask_worker(void) +static void thread_test_odp_thrmask_worker(void) { odp_thrmask_t mask; int ret; @@ -84,7 +83,7 @@ void thread_test_odp_thrmask_worker(void) odp_cunit_thread_exit(&args); }
-void thread_test_odp_thrmask_control(void) +static void thread_test_odp_thrmask_control(void) { odp_thrmask_t mask; int ret; @@ -125,7 +124,7 @@ odp_suiteinfo_t thread_suites[] = { ODP_SUITE_INFO_NULL, };
-int thread_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/thread/thread.h b/test/validation/api/thread/thread.h deleted file mode 100644 index d511c925..00000000 --- a/test/validation/api/thread/thread.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_THREAD_H_ -#define _ODP_TEST_THREAD_H_ - -#include <odp_api.h> -#include <odp_cunit_common.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 odp_testinfo_t thread_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t thread_suites[]; - -/* main test program: */ -int thread_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/thread/thread_main.c b/test/validation/api/thread/thread_main.c deleted file mode 100644 index 2e832836..00000000 --- a/test/validation/api/thread/thread_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "thread.h" - -int main(int argc, char *argv[]) -{ - return thread_main(argc, argv); -}
commit 01014bb374153d7bc879b3e1d26e79a6dfe5c329 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: system: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/system/Makefile.am b/test/validation/api/system/Makefile.am index e6fbb0ea..8090b0b5 100644 --- a/test/validation/api/system/Makefile.am +++ b/test/validation/api/system/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = system_main -system_main_SOURCES = system_main.c system.c system.h +system_main_SOURCES = system.c diff --git a/test/validation/api/system/system.c b/test/validation/api/system/system.c index a2749003..71d48480 100644 --- a/test/validation/api/system/system.c +++ b/test/validation/api/system/system.c @@ -11,13 +11,15 @@ #include <odp/api/cpumask.h> #include "odp_cunit_common.h" #include "test_debug.h" -#include "system.h"
#define DIFF_TRY_NUM 160 #define RES_TRY_NUM 10 #define PAGESZ_NUM 10
-void system_test_odp_version_numbers(void) +#define GIGA_HZ 1000000000ULL +#define KILO_HZ 1000ULL + +static void system_test_odp_version_numbers(void) { int char_ok = 0; char version_string[128]; @@ -39,7 +41,7 @@ void system_test_odp_version_numbers(void) CU_ASSERT(char_ok); }
-void system_test_odp_cpu_count(void) +static void system_test_odp_cpu_count(void) { int cpus;
@@ -47,7 +49,7 @@ void system_test_odp_cpu_count(void) CU_ASSERT(0 < cpus); }
-void system_test_odp_cpu_cycles(void) +static void system_test_odp_cpu_cycles(void) { uint64_t c2, c1;
@@ -58,7 +60,7 @@ void system_test_odp_cpu_cycles(void) CU_ASSERT(c2 != c1); }
-void system_test_odp_cpu_cycles_max(void) +static void system_test_odp_cpu_cycles_max(void) { uint64_t c2, c1; uint64_t max1, max2; @@ -77,7 +79,7 @@ void system_test_odp_cpu_cycles_max(void) CU_ASSERT(c1 <= max1 && c2 <= max1); }
-void system_test_odp_cpu_cycles_resolution(void) +static void system_test_odp_cpu_cycles_resolution(void) { int i; uint64_t res; @@ -99,7 +101,7 @@ void system_test_odp_cpu_cycles_resolution(void) } }
-void system_test_odp_cpu_cycles_diff(void) +static void system_test_odp_cpu_cycles_diff(void) { int i; uint64_t c2, c1, c3, max; @@ -165,7 +167,7 @@ void system_test_odp_cpu_cycles_diff(void) printf("wrap was not detected..."); }
-void system_test_odp_sys_cache_line_size(void) +static void system_test_odp_sys_cache_line_size(void) { uint64_t cache_size;
@@ -174,7 +176,7 @@ void system_test_odp_sys_cache_line_size(void) CU_ASSERT(ODP_CACHE_LINE_SIZE == cache_size); }
-void system_test_odp_cpu_model_str(void) +static void system_test_odp_cpu_model_str(void) { char model[128];
@@ -183,7 +185,7 @@ void system_test_odp_cpu_model_str(void) CU_ASSERT(strlen(model) < 127); }
-void system_test_odp_cpu_model_str_id(void) +static void system_test_odp_cpu_model_str_id(void) { char model[128]; odp_cpumask_t mask; @@ -200,7 +202,7 @@ void system_test_odp_cpu_model_str_id(void) } }
-void system_test_odp_sys_page_size(void) +static void system_test_odp_sys_page_size(void) { uint64_t page;
@@ -209,7 +211,7 @@ void system_test_odp_sys_page_size(void) CU_ASSERT(ODP_PAGE_SIZE == page); }
-void system_test_odp_sys_huge_page_size(void) +static void system_test_odp_sys_huge_page_size(void) { uint64_t page;
@@ -217,7 +219,7 @@ void system_test_odp_sys_huge_page_size(void) CU_ASSERT(0 < page); }
-void system_test_odp_sys_huge_page_size_all(void) +static void system_test_odp_sys_huge_page_size_all(void) { uint64_t pagesz_tbs[PAGESZ_NUM]; uint64_t prev_pagesz = 0; @@ -236,7 +238,7 @@ void system_test_odp_sys_huge_page_size_all(void) } }
-int system_check_odp_cpu_hz(void) +static int system_check_odp_cpu_hz(void) { if (odp_cpu_hz() == 0) { fprintf(stderr, "odp_cpu_hz is not supported, skipping\n"); @@ -246,7 +248,7 @@ int system_check_odp_cpu_hz(void) return ODP_TEST_ACTIVE; }
-void system_test_odp_cpu_hz(void) +static void system_test_odp_cpu_hz(void) { uint64_t hz = odp_cpu_hz();
@@ -257,7 +259,7 @@ void system_test_odp_cpu_hz(void) CU_ASSERT(hz > 1 * KILO_HZ); }
-int system_check_odp_cpu_hz_id(void) +static int system_check_odp_cpu_hz_id(void) { uint64_t hz; odp_cpumask_t mask; @@ -280,7 +282,7 @@ int system_check_odp_cpu_hz_id(void) return ODP_TEST_ACTIVE; }
-void system_test_odp_cpu_hz_id(void) +static void system_test_odp_cpu_hz_id(void) { uint64_t hz; odp_cpumask_t mask; @@ -299,7 +301,7 @@ void system_test_odp_cpu_hz_id(void) } }
-void system_test_odp_cpu_hz_max(void) +static void system_test_odp_cpu_hz_max(void) { uint64_t hz;
@@ -307,7 +309,7 @@ void system_test_odp_cpu_hz_max(void) CU_ASSERT(0 < hz); }
-void system_test_odp_cpu_hz_max_id(void) +static void system_test_odp_cpu_hz_max_id(void) { uint64_t hz; odp_cpumask_t mask; @@ -323,7 +325,7 @@ void system_test_odp_cpu_hz_max_id(void) } }
-void system_test_info_print(void) +static void system_test_info_print(void) { printf("\n\nCalling system info print...\n"); odp_sys_info_print(); @@ -358,7 +360,7 @@ odp_suiteinfo_t system_suites[] = { ODP_SUITE_INFO_NULL, };
-int system_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/system/system.h b/test/validation/api/system/system.h deleted file mode 100644 index 0ea72dcd..00000000 --- a/test/validation/api/system/system.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_SYSTEM_H_ -#define _ODP_TEST_SYSTEM_H_ - -#include <odp_cunit_common.h> - -#define GIGA_HZ 1000000000ULL -#define KILO_HZ 1000ULL - -/* 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_cpu_model_str(void); -void system_test_odp_cpu_model_str_id(void); -void system_test_odp_sys_page_size(void); -void system_test_odp_sys_huge_page_size(void); -void system_test_odp_sys_huge_page_size_all(void); -int system_check_odp_cpu_hz(void); -void system_test_odp_cpu_hz(void); -int system_check_odp_cpu_hz_id(void); -void system_test_odp_cpu_hz_id(void); -void system_test_odp_cpu_hz_max(void); -void system_test_odp_cpu_hz_max_id(void); -void system_test_odp_cpu_cycles_max(void); -void system_test_odp_cpu_cycles(void); -void system_test_odp_cpu_cycles_diff(void); -void system_test_odp_cpu_cycles_resolution(void); -void system_test_info_print(void); - -/* test arrays: */ -extern odp_testinfo_t system_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t system_suites[]; - -/* main test program: */ -int system_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/system/system_main.c b/test/validation/api/system/system_main.c deleted file mode 100644 index 01720c6a..00000000 --- a/test/validation/api/system/system_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "system.h" - -int main(int argc, char *argv[]) -{ - return system_main(argc, argv); -}
commit d7f9a326839de8d731d95ba3a1c45114198887d1 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: std_clib: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/std_clib/Makefile.am b/test/validation/api/std_clib/Makefile.am index 34b888bb..9d3b32d3 100644 --- a/test/validation/api/std_clib/Makefile.am +++ b/test/validation/api/std_clib/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = std_clib_main -std_clib_main_SOURCES = std_clib_main.c std_clib.c std_clib.h +std_clib_main_SOURCES = std_clib.c diff --git a/test/validation/api/std_clib/std_clib.c b/test/validation/api/std_clib/std_clib.c index 33128eef..3ef5aab7 100644 --- a/test/validation/api/std_clib/std_clib.c +++ b/test/validation/api/std_clib/std_clib.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include <odp_cunit_common.h> -#include "std_clib.h"
#include <string.h>
@@ -95,7 +94,7 @@ odp_suiteinfo_t std_clib_suites[] = { ODP_SUITE_INFO_NULL };
-int std_clib_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/std_clib/std_clib.h b/test/validation/api/std_clib/std_clib.h deleted file mode 100644 index 2804f27e..00000000 --- a/test/validation/api/std_clib/std_clib.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_STD_CLIB_H_ -#define _ODP_TEST_STD_CLIB_H_ - -#include <odp_cunit_common.h> - -/* test arrays: */ -extern odp_testinfo_t std_clib_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t std_clib_suites[]; - -/* main test program: */ -int std_clib_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/std_clib/std_clib_main.c b/test/validation/api/std_clib/std_clib_main.c deleted file mode 100644 index dc63bb5b..00000000 --- a/test/validation/api/std_clib/std_clib_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "std_clib.h" - -int main(int argc, char *argv[]) -{ - return std_clib_main(argc, argv); -}
commit b07985be674cef618fabeb7111ffa4dbb3e74fef Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: shmem: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/shmem/Makefile.am b/test/validation/api/shmem/Makefile.am index 9a10668f..52e33fdc 100644 --- a/test/validation/api/shmem/Makefile.am +++ b/test/validation/api/shmem/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = shmem_main -shmem_main_SOURCES = shmem_main.c shmem.c shmem.h +shmem_main_SOURCES = shmem.c diff --git a/test/validation/api/shmem/shmem.c b/test/validation/api/shmem/shmem.c index 4e0e327c..fb1898eb 100644 --- a/test/validation/api/shmem/shmem.c +++ b/test/validation/api/shmem/shmem.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include <odp_cunit_common.h> -#include "shmem.h" #include <stdlib.h>
#define ALIGN_SIZE (128) @@ -131,7 +130,7 @@ static int run_test_basic_thread(void *arg ODP_UNUSED) /* * test basic things: shmem creation, info, share, and free */ -void shmem_test_basic(void) +static void shmem_test_basic(void) { pthrd_arg thrdarg; odp_shm_t shm; @@ -342,7 +341,7 @@ static int run_test_reserve_after_fork(void *arg ODP_UNUSED) /* * test sharing memory reserved after odp_thread creation (e.g. fork()): */ -void shmem_test_reserve_after_fork(void) +static void shmem_test_reserve_after_fork(void) { pthrd_arg thrdarg; odp_shm_t shm; @@ -531,7 +530,7 @@ static int run_test_singleva_after_fork(void *arg ODP_UNUSED) * test sharing memory reserved after odp_thread creation (e.g. fork()): * with single VA flag. */ -void shmem_test_singleva_after_fork(void) +static void shmem_test_singleva_after_fork(void) { pthrd_arg thrdarg; odp_shm_t shm; @@ -771,7 +770,7 @@ static int run_test_stress(void *arg ODP_UNUSED) /* * stress tests */ -void shmem_test_stress(void) +static void shmem_test_stress(void) { pthrd_arg thrdarg; odp_shm_t shm; @@ -834,7 +833,7 @@ odp_suiteinfo_t shmem_suites[] = { ODP_SUITE_INFO_NULL, };
-int shmem_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/shmem/shmem.h b/test/validation/api/shmem/shmem.h deleted file mode 100644 index 092aa800..00000000 --- a/test/validation/api/shmem/shmem.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_SHMEM_H_ -#define _ODP_TEST_SHMEM_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void shmem_test_basic(void); -void shmem_test_reserve_after_fork(void); -void shmem_test_singleva_after_fork(void); -void shmem_test_stress(void); - -/* test arrays: */ -extern odp_testinfo_t shmem_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t shmem_suites[]; - -/* main test program: */ -int shmem_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/shmem/shmem_main.c b/test/validation/api/shmem/shmem_main.c deleted file mode 100644 index d51d4d83..00000000 --- a/test/validation/api/shmem/shmem_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2014, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "shmem.h" - -int main(int argc, char *argv[]) -{ - return shmem_main(argc, argv); -}
commit 74948cab5525f59e016dc984d95cb51f2ce2f963 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: scheduler: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/scheduler/Makefile.am b/test/validation/api/scheduler/Makefile.am index 3673ad7c..050f2230 100644 --- a/test/validation/api/scheduler/Makefile.am +++ b/test/validation/api/scheduler/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = scheduler_main -scheduler_main_SOURCES = scheduler_main.c scheduler.c scheduler.h +scheduler_main_SOURCES = scheduler.c diff --git a/test/validation/api/scheduler/scheduler.c b/test/validation/api/scheduler/scheduler.c index 0be6ce3f..9d1e08ca 100644 --- a/test/validation/api/scheduler/scheduler.c +++ b/test/validation/api/scheduler/scheduler.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include "odp_cunit_common.h" -#include "scheduler.h"
#define MAX_WORKERS_THREADS 32 #define MAX_ORDERED_LOCKS 2 @@ -139,7 +138,7 @@ static void release_context(odp_schedule_sync_t sync) odp_schedule_release_ordered(); }
-void scheduler_test_wait_time(void) +static void scheduler_test_wait_time(void) { int i; odp_queue_t queue; @@ -193,7 +192,7 @@ void scheduler_test_wait_time(void) CU_ASSERT_FATAL(odp_queue_destroy(queue) == 0); }
-void scheduler_test_num_prio(void) +static void scheduler_test_num_prio(void) { int prio;
@@ -203,7 +202,7 @@ void scheduler_test_num_prio(void) CU_ASSERT(prio == odp_schedule_num_prio()); }
-void scheduler_test_queue_destroy(void) +static void scheduler_test_queue_destroy(void) { odp_pool_t p; odp_pool_param_t params; @@ -268,7 +267,7 @@ void scheduler_test_queue_destroy(void) CU_ASSERT_FATAL(odp_pool_destroy(p) == 0); }
-void scheduler_test_groups(void) +static void scheduler_test_groups(void) { odp_pool_t p; odp_pool_param_t params; @@ -662,22 +661,22 @@ static void chaos_run(unsigned int qtype) CU_ASSERT(rc == 0); }
-void scheduler_test_parallel(void) +static void scheduler_test_parallel(void) { chaos_run(0); }
-void scheduler_test_atomic(void) +static void scheduler_test_atomic(void) { chaos_run(1); }
-void scheduler_test_ordered(void) +static void scheduler_test_ordered(void) { chaos_run(2); }
-void scheduler_test_chaos(void) +static void scheduler_test_chaos(void) { chaos_run(3); } @@ -1083,25 +1082,25 @@ static void parallel_execute(odp_schedule_sync_t sync, int num_queues, }
/* 1 queue 1 thread ODP_SCHED_SYNC_PARALLEL */ -void scheduler_test_1q_1t_n(void) +static void scheduler_test_1q_1t_n(void) { schedule_common(ODP_SCHED_SYNC_PARALLEL, ONE_Q, ONE_PRIO, SCHD_ONE); }
/* 1 queue 1 thread ODP_SCHED_SYNC_ATOMIC */ -void scheduler_test_1q_1t_a(void) +static 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 */ -void scheduler_test_1q_1t_o(void) +static 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_PARALLEL */ -void scheduler_test_mq_1t_n(void) +static 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 */ @@ -1109,19 +1108,19 @@ void scheduler_test_mq_1t_n(void) }
/* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC */ -void scheduler_test_mq_1t_a(void) +static 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 */ -void scheduler_test_mq_1t_o(void) +static 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_PARALLEL */ -void scheduler_test_mq_1t_prio_n(void) +static void scheduler_test_mq_1t_prio_n(void) { int prio = odp_schedule_num_prio();
@@ -1129,7 +1128,7 @@ void scheduler_test_mq_1t_prio_n(void) }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC */ -void scheduler_test_mq_1t_prio_a(void) +static void scheduler_test_mq_1t_prio_a(void) { int prio = odp_schedule_num_prio();
@@ -1137,7 +1136,7 @@ void scheduler_test_mq_1t_prio_a(void) }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED */ -void scheduler_test_mq_1t_prio_o(void) +static void scheduler_test_mq_1t_prio_o(void) { int prio = odp_schedule_num_prio();
@@ -1145,7 +1144,7 @@ void scheduler_test_mq_1t_prio_o(void) }
/* Many queues many threads check priority ODP_SCHED_SYNC_PARALLEL */ -void scheduler_test_mq_mt_prio_n(void) +static void scheduler_test_mq_mt_prio_n(void) { int prio = odp_schedule_num_prio();
@@ -1154,7 +1153,7 @@ void scheduler_test_mq_mt_prio_n(void) }
/* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC */ -void scheduler_test_mq_mt_prio_a(void) +static void scheduler_test_mq_mt_prio_a(void) { int prio = odp_schedule_num_prio();
@@ -1163,7 +1162,7 @@ void scheduler_test_mq_mt_prio_a(void) }
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED */ -void scheduler_test_mq_mt_prio_o(void) +static void scheduler_test_mq_mt_prio_o(void) { int prio = odp_schedule_num_prio();
@@ -1172,32 +1171,32 @@ void scheduler_test_mq_mt_prio_o(void) }
/* 1 queue many threads check exclusive access on ATOMIC queues */ -void scheduler_test_1q_mt_a_excl(void) +static 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_PARALLEL multi */ -void scheduler_test_multi_1q_1t_n(void) +static void scheduler_test_multi_1q_1t_n(void) { schedule_common(ODP_SCHED_SYNC_PARALLEL, ONE_Q, ONE_PRIO, SCHD_MULTI); }
/* 1 queue 1 thread ODP_SCHED_SYNC_ATOMIC multi */ -void scheduler_test_multi_1q_1t_a(void) +static 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 */ -void scheduler_test_multi_1q_1t_o(void) +static 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_PARALLEL multi */ -void scheduler_test_multi_mq_1t_n(void) +static 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 */ @@ -1205,19 +1204,19 @@ void scheduler_test_multi_mq_1t_n(void) }
/* Many queues 1 thread ODP_SCHED_SYNC_ATOMIC multi */ -void scheduler_test_multi_mq_1t_a(void) +static 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 */ -void scheduler_test_multi_mq_1t_o(void) +static 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_PARALLEL multi */ -void scheduler_test_multi_mq_1t_prio_n(void) +static void scheduler_test_multi_mq_1t_prio_n(void) { int prio = odp_schedule_num_prio();
@@ -1225,7 +1224,7 @@ void scheduler_test_multi_mq_1t_prio_n(void) }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ATOMIC multi */ -void scheduler_test_multi_mq_1t_prio_a(void) +static void scheduler_test_multi_mq_1t_prio_a(void) { int prio = odp_schedule_num_prio();
@@ -1233,7 +1232,7 @@ void scheduler_test_multi_mq_1t_prio_a(void) }
/* Many queues 1 thread check priority ODP_SCHED_SYNC_ORDERED multi */ -void scheduler_test_multi_mq_1t_prio_o(void) +static void scheduler_test_multi_mq_1t_prio_o(void) { int prio = odp_schedule_num_prio();
@@ -1241,7 +1240,7 @@ void scheduler_test_multi_mq_1t_prio_o(void) }
/* Many queues many threads check priority ODP_SCHED_SYNC_PARALLEL multi */ -void scheduler_test_multi_mq_mt_prio_n(void) +static void scheduler_test_multi_mq_mt_prio_n(void) { int prio = odp_schedule_num_prio();
@@ -1249,7 +1248,7 @@ void scheduler_test_multi_mq_mt_prio_n(void) }
/* Many queues many threads check priority ODP_SCHED_SYNC_ATOMIC multi */ -void scheduler_test_multi_mq_mt_prio_a(void) +static void scheduler_test_multi_mq_mt_prio_a(void) { int prio = odp_schedule_num_prio();
@@ -1257,7 +1256,7 @@ void scheduler_test_multi_mq_mt_prio_a(void) }
/* Many queues many threads check priority ODP_SCHED_SYNC_ORDERED multi */ -void scheduler_test_multi_mq_mt_prio_o(void) +static void scheduler_test_multi_mq_mt_prio_o(void) { int prio = odp_schedule_num_prio();
@@ -1265,13 +1264,13 @@ void scheduler_test_multi_mq_mt_prio_o(void) }
/* 1 queue many threads check exclusive access on ATOMIC queues multi */ -void scheduler_test_multi_1q_mt_a_excl(void) +static void scheduler_test_multi_1q_mt_a_excl(void) { parallel_execute(ODP_SCHED_SYNC_ATOMIC, ONE_Q, ONE_PRIO, SCHD_MULTI, ENABLE_EXCL_ATOMIC); }
-void scheduler_test_pause_resume(void) +static void scheduler_test_pause_resume(void) { odp_queue_t queue; odp_buffer_t buf; @@ -1545,7 +1544,7 @@ static int create_queues(void) return 0; }
-int scheduler_suite_init(void) +static int scheduler_suite_init(void) { odp_cpumask_t mask; odp_shm_t shm; @@ -1657,7 +1656,7 @@ static int destroy_queues(void) return 0; }
-int scheduler_suite_term(void) +static int scheduler_suite_term(void) { odp_pool_t pool; odp_shm_t shm; @@ -1729,7 +1728,7 @@ odp_suiteinfo_t scheduler_suites[] = { ODP_SUITE_INFO_NULL, };
-int scheduler_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/scheduler/scheduler.h b/test/validation/api/scheduler/scheduler.h deleted file mode 100644 index a619d89b..00000000 --- a/test/validation/api/scheduler/scheduler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_SCHEDULER_H_ -#define _ODP_TEST_SCHEDULER_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void scheduler_test_wait_time(void); -void scheduler_test_num_prio(void); -void scheduler_test_queue_destroy(void); -void scheduler_test_groups(void); -void scheduler_test_chaos(void); -void scheduler_test_parallel(void); -void scheduler_test_atomic(void); -void scheduler_test_ordered(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 odp_testinfo_t scheduler_suite[]; - -/* test array init/term functions: */ -int scheduler_suite_init(void); -int scheduler_suite_term(void); - -/* test registry: */ -extern odp_suiteinfo_t scheduler_suites[]; - -/* main test program: */ -int scheduler_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/scheduler/scheduler_main.c b/test/validation/api/scheduler/scheduler_main.c deleted file mode 100644 index 73f3cedd..00000000 --- a/test/validation/api/scheduler/scheduler_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "scheduler.h" - -int main(int argc, char *argv[]) -{ - return scheduler_main(argc, argv); -}
commit 4ffba79dfc573070f61da8894877783601e3aff4 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: random: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/random/Makefile.am b/test/validation/api/random/Makefile.am index 8f1ba9fe..e24ce0af 100644 --- a/test/validation/api/random/Makefile.am +++ b/test/validation/api/random/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = random_main -random_main_SOURCES = random_main.c random.c random.h +random_main_SOURCES = random.c diff --git a/test/validation/api/random/random.c b/test/validation/api/random/random.c index 071c265f..9a583e34 100644 --- a/test/validation/api/random/random.c +++ b/test/validation/api/random/random.c @@ -8,9 +8,8 @@
#include <odp_api.h> #include <odp_cunit_common.h> -#include "random.h"
-void random_test_get_size(void) +static void random_test_get_size(void) { int32_t ret; uint8_t buf[32]; @@ -19,7 +18,7 @@ void random_test_get_size(void) CU_ASSERT(ret == sizeof(buf)); }
-void random_test_kind(void) +static void random_test_kind(void) { int32_t rc; uint8_t buf[4096]; @@ -45,7 +44,7 @@ void random_test_kind(void) } }
-void random_test_repeat(void) +static void random_test_repeat(void) { uint8_t buf1[1024]; uint8_t buf2[1024]; @@ -75,7 +74,7 @@ odp_suiteinfo_t random_suites[] = { ODP_SUITE_INFO_NULL, };
-int random_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/random/random.h b/test/validation/api/random/random.h deleted file mode 100644 index c4bca782..00000000 --- a/test/validation/api/random/random.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_RANDOM_H_ -#define _ODP_TEST_RANDOM_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void random_test_get_size(void); -void random_test_kind(void); -void random_test_repeat(void); - -/* test arrays: */ -extern odp_testinfo_t random_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t random_suites[]; - -/* main test program: */ -int random_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/random/random_main.c b/test/validation/api/random/random_main.c deleted file mode 100644 index ca9f5262..00000000 --- a/test/validation/api/random/random_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "random.h" - -int main(int argc, char *argv[]) -{ - return random_main(argc, argv); -}
commit 4fc0e934df0bbd0779c6051595add213f752272a Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: queue: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/queue/Makefile.am b/test/validation/api/queue/Makefile.am index 5ed4638b..94a6b28a 100644 --- a/test/validation/api/queue/Makefile.am +++ b/test/validation/api/queue/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = queue_main -queue_main_SOURCES = queue_main.c queue.c queue.h +queue_main_SOURCES = queue.c diff --git a/test/validation/api/queue/queue.c b/test/validation/api/queue/queue.c index 3c6db33a..8746f506 100644 --- a/test/validation/api/queue/queue.c +++ b/test/validation/api/queue/queue.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include <odp_cunit_common.h> -#include "queue.h"
#define MAX_BUFFER_QUEUE (8) #define MSG_POOL_SIZE (4 * 1024 * 1024) @@ -29,7 +28,7 @@ static void generate_name(char *name, uint32_t index) name[5] = 'A' + (index % 26); }
-int queue_suite_init(void) +static int queue_suite_init(void) { odp_pool_param_t params;
@@ -47,12 +46,12 @@ int queue_suite_init(void) return 0; }
-int queue_suite_term(void) +static int queue_suite_term(void) { return odp_pool_destroy(pool); }
-void queue_test_capa(void) +static void queue_test_capa(void) { odp_queue_capability_t capa; odp_queue_param_t qparams; @@ -115,7 +114,7 @@ void queue_test_capa(void) } }
-void queue_test_mode(void) +static void queue_test_mode(void) { odp_queue_param_t qparams; odp_queue_t queue; @@ -155,7 +154,7 @@ void queue_test_mode(void) } }
-void queue_test_param(void) +static void queue_test_param(void) { odp_queue_t queue, null_queue; odp_event_t enev[MAX_BUFFER_QUEUE]; @@ -260,7 +259,7 @@ void queue_test_param(void) CU_ASSERT(odp_queue_destroy(queue) == 0); }
-void queue_test_info(void) +static void queue_test_info(void) { odp_queue_t q_plain, q_order; const char *const nq_plain = "test_q_plain"; @@ -338,7 +337,7 @@ odp_suiteinfo_t queue_suites[] = { ODP_SUITE_INFO_NULL, };
-int queue_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/queue/queue.h b/test/validation/api/queue/queue.h deleted file mode 100644 index 6b787b1d..00000000 --- a/test/validation/api/queue/queue.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_QUEUE_H_ -#define _ODP_TEST_QUEUE_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void queue_test_capa(void); -void queue_test_mode(void); -void queue_test_param(void); -void queue_test_info(void); - -/* test arrays: */ -extern odp_testinfo_t queue_suite[]; - -/* test array init/term functions: */ -int queue_suite_init(void); -int queue_suite_term(void); - -/* test registry: */ -extern odp_suiteinfo_t queue_suites[]; - -/* main test program: */ -int queue_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/queue/queue_main.c b/test/validation/api/queue/queue_main.c deleted file mode 100644 index 7ed05411..00000000 --- a/test/validation/api/queue/queue_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "queue.h" - -int main(int argc, char *argv[]) -{ - return queue_main(argc, argv); -}
commit 69367466a8c3e30509b1f86c4751285aab37efb8 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: pool: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/pool/Makefile.am b/test/validation/api/pool/Makefile.am index 7951d048..1b0d5934 100644 --- a/test/validation/api/pool/Makefile.am +++ b/test/validation/api/pool/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = pool_main -pool_main_SOURCES = pool_main.c pool.c pool.h +pool_main_SOURCES = pool.c diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 3a2c7412..34f97357 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include "odp_cunit_common.h" -#include "pool.h"
#define PKT_LEN 400 #define PKT_NUM 500 @@ -27,7 +26,7 @@ static void pool_create_destroy(odp_pool_param_t *param) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void pool_test_create_destroy_buffer(void) +static void pool_test_create_destroy_buffer(void) { odp_pool_param_t param;
@@ -41,7 +40,7 @@ void pool_test_create_destroy_buffer(void) pool_create_destroy(¶m); }
-void pool_test_create_destroy_packet(void) +static void pool_test_create_destroy_packet(void) { odp_pool_param_t param;
@@ -54,7 +53,7 @@ void pool_test_create_destroy_packet(void) pool_create_destroy(¶m); }
-void pool_test_create_destroy_timeout(void) +static void pool_test_create_destroy_timeout(void) { odp_pool_param_t param;
@@ -66,7 +65,7 @@ void pool_test_create_destroy_timeout(void) pool_create_destroy(¶m); }
-void pool_test_lookup_info_print(void) +static void pool_test_lookup_info_print(void) { odp_pool_t pool; const char pool_name[] = "pool_for_lookup_test"; @@ -98,7 +97,7 @@ void pool_test_lookup_info_print(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void pool_test_alloc_packet(void) +static void pool_test_alloc_packet(void) { odp_pool_t pool; odp_pool_param_t param; @@ -131,7 +130,7 @@ void pool_test_alloc_packet(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void pool_test_alloc_packet_subparam(void) +static void pool_test_alloc_packet_subparam(void) { odp_pool_t pool; odp_pool_capability_t capa; @@ -191,7 +190,7 @@ void pool_test_alloc_packet_subparam(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void pool_test_info_packet(void) +static void pool_test_info_packet(void) { odp_pool_t pool; odp_pool_info_t info; @@ -236,7 +235,7 @@ odp_suiteinfo_t pool_suites[] = { ODP_SUITE_INFO_NULL, };
-int pool_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/pool/pool.h b/test/validation/api/pool/pool.h deleted file mode 100644 index b284524e..00000000 --- a/test/validation/api/pool/pool.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_POOL_H_ -#define _ODP_TEST_POOL_H_ - -#include <odp_cunit_common.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_lookup_info_print(void); -void pool_test_alloc_packet(void); -void pool_test_alloc_packet_subparam(void); -void pool_test_info_packet(void); - -/* test arrays: */ -extern odp_testinfo_t pool_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t pool_suites[]; - -/* main test program: */ -int pool_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/pool/pool_main.c b/test/validation/api/pool/pool_main.c deleted file mode 100644 index c1eb7b7c..00000000 --- a/test/validation/api/pool/pool_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "pool.h" - -int main(int argc, char *argv[]) -{ - return pool_main(argc, argv); -}
commit d1da7104eb4875287c816aec7e145a7504239156 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: packet: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/packet/Makefile.am b/test/validation/api/packet/Makefile.am index d33cdadb..ad5775d7 100644 --- a/test/validation/api/packet/Makefile.am +++ b/test/validation/api/packet/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = packet_main -packet_main_SOURCES = packet_main.c packet.c packet.h +packet_main_SOURCES = packet.c diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 054a0d4e..bda8d7c7 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -11,7 +11,6 @@ #include <odp_api.h> #include <odp_cunit_common.h> #include <test_packet_parser.h> -#include "packet.h"
/* Reserve some tailroom for tests */ #define PACKET_TAILROOM_RESERVE 4 @@ -143,7 +142,7 @@ static int fill_data_backward(odp_packet_t pkt, uint32_t offset, uint32_t len, return odp_packet_copy_from_mem(pkt, offset, len, buf); }
-int packet_suite_init(void) +static int packet_suite_init(void) { odp_pool_param_t params; odp_pool_capability_t capa; @@ -276,7 +275,7 @@ int packet_suite_init(void) return 0; }
-int packet_suite_term(void) +static int packet_suite_term(void) { odp_packet_free(test_packet); odp_packet_free(segmented_test_packet); @@ -289,7 +288,7 @@ int packet_suite_term(void) return 0; }
-void packet_test_alloc_free(void) +static void packet_test_alloc_free(void) { odp_pool_t pool; odp_packet_t packet; @@ -356,7 +355,7 @@ static int packet_alloc_multi(odp_pool_t pool, uint32_t pkt_len, return total; }
-void packet_test_alloc_free_multi(void) +static void packet_test_alloc_free_multi(void) { const int num_pkt = 2; odp_pool_t pool[2]; @@ -429,7 +428,7 @@ void packet_test_alloc_free_multi(void) CU_ASSERT(odp_pool_destroy(pool[1]) == 0); }
-void packet_test_free_sp(void) +static void packet_test_free_sp(void) { const int num_pkt = 10; odp_pool_t pool; @@ -473,7 +472,7 @@ void packet_test_free_sp(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_alloc_segmented(void) +static void packet_test_alloc_segmented(void) { const int num = 5; odp_packet_t pkts[num]; @@ -556,7 +555,7 @@ void packet_test_alloc_segmented(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_event_conversion(void) +static void packet_test_event_conversion(void) { odp_packet_t pkt0 = test_packet; odp_packet_t pkt1 = segmented_test_packet; @@ -595,7 +594,7 @@ void packet_test_event_conversion(void) packet_compare_data(pkt[1], pkt1); }
-void packet_test_basic_metadata(void) +static void packet_test_basic_metadata(void) { odp_packet_t pkt = test_packet; odp_time_t ts; @@ -628,7 +627,7 @@ void packet_test_basic_metadata(void) CU_ASSERT(!odp_packet_has_ts(pkt)); }
-void packet_test_length(void) +static void packet_test_length(void) { odp_packet_t pkt = test_packet; uint32_t buf_len, headroom, tailroom; @@ -647,13 +646,13 @@ void packet_test_length(void) CU_ASSERT(buf_len >= packet_len + headroom + tailroom); }
-void packet_test_prefetch(void) +static void packet_test_prefetch(void) { odp_packet_prefetch(test_packet, 0, odp_packet_len(test_packet)); CU_PASS(); }
-void packet_test_debug(void) +static void packet_test_debug(void) { CU_ASSERT(odp_packet_is_valid(test_packet) == 1); printf("\n\n"); @@ -662,7 +661,7 @@ void packet_test_debug(void) odp_packet_print_data(test_packet, 14, 20); }
-void packet_test_context(void) +static void packet_test_context(void) { odp_packet_t pkt = test_packet; char ptr_test_value = 2; @@ -684,7 +683,7 @@ void packet_test_context(void) odp_packet_reset(pkt, packet_len); }
-void packet_test_layer_offsets(void) +static void packet_test_layer_offsets(void) { odp_packet_t pkt = test_packet; uint8_t *l2_addr, *l3_addr, *l4_addr; @@ -787,7 +786,7 @@ static void _verify_headroom_shift(odp_packet_t *pkt, CU_ASSERT(odp_packet_data(*pkt) == data); }
-void packet_test_headroom(void) +static void packet_test_headroom(void) { odp_packet_t pkt = odp_packet_copy(test_packet, odp_packet_pool(test_packet)); @@ -907,7 +906,7 @@ static void _verify_tailroom_shift(odp_packet_t *pkt, } }
-void packet_test_tailroom(void) +static void packet_test_tailroom(void) { odp_packet_t pkt = odp_packet_copy(test_packet, odp_packet_pool(test_packet)); @@ -948,7 +947,7 @@ void packet_test_tailroom(void) odp_packet_free(pkt); }
-void packet_test_segments(void) +static void packet_test_segments(void) { int num_segs, seg_index; uint32_t data_len; @@ -1033,7 +1032,7 @@ void packet_test_segments(void) CU_ASSERT(seg == ODP_PACKET_SEG_INVALID); }
-void packet_test_segment_last(void) +static void packet_test_segment_last(void) { odp_packet_t pkt = test_packet; odp_packet_seg_t seg; @@ -1053,7 +1052,7 @@ do { \ CU_ASSERT(odp_packet_has_##flag(packet) != 0); \ } while (0)
-void packet_test_in_flags(void) +static void packet_test_in_flags(void) { odp_packet_t pkt = test_packet;
@@ -1080,7 +1079,7 @@ void packet_test_in_flags(void) TEST_INFLAG(pkt, icmp); }
-void packet_test_error_flags(void) +static void packet_test_error_flags(void) { odp_packet_t pkt = test_packet; int err; @@ -1110,7 +1109,7 @@ struct packet_metadata { uint64_t usr_u64; };
-void packet_test_add_rem_data(void) +static void packet_test_add_rem_data(void) { odp_packet_t pkt, new_pkt; uint32_t pkt_len, offset, add_len; @@ -1275,7 +1274,7 @@ static void _packet_compare_offset(odp_packet_t pkt1, uint32_t off1, } }
-void packet_test_copy(void) +static void packet_test_copy(void) { odp_packet_t pkt; odp_packet_t pkt_copy, pkt_part; @@ -1377,7 +1376,7 @@ void packet_test_copy(void) odp_packet_free(pkt); }
-void packet_test_copydata(void) +static void packet_test_copydata(void) { odp_packet_t pkt = test_packet; uint32_t pkt_len = odp_packet_len(pkt); @@ -1436,7 +1435,7 @@ void packet_test_copydata(void) odp_packet_free(pkt); }
-void packet_test_concatsplit(void) +static void packet_test_concatsplit(void) { odp_packet_t pkt, pkt2; uint32_t pkt_len; @@ -1509,7 +1508,7 @@ void packet_test_concatsplit(void) odp_packet_free(pkt); }
-void packet_test_concat_small(void) +static void packet_test_concat_small(void) { odp_pool_capability_t capa; odp_pool_t pool; @@ -1572,7 +1571,7 @@ void packet_test_concat_small(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_concat_extend_trunc(void) +static void packet_test_concat_extend_trunc(void) { odp_pool_capability_t capa; odp_pool_t pool; @@ -1660,7 +1659,7 @@ void packet_test_concat_extend_trunc(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_extend_small(void) +static void packet_test_extend_small(void) { odp_pool_capability_t capa; odp_pool_t pool; @@ -1752,7 +1751,7 @@ void packet_test_extend_small(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_extend_large(void) +static void packet_test_extend_large(void) { odp_pool_capability_t capa; odp_pool_t pool; @@ -1872,7 +1871,7 @@ void packet_test_extend_large(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_extend_mix(void) +static void packet_test_extend_mix(void) { odp_pool_capability_t capa; odp_pool_t pool; @@ -1986,7 +1985,7 @@ void packet_test_extend_mix(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void packet_test_extend_ref(void) +static void packet_test_extend_ref(void) { odp_packet_t max_pkt, ref; uint32_t hr, tr, max_len; @@ -2060,7 +2059,7 @@ void packet_test_extend_ref(void) odp_packet_free(max_pkt); }
-void packet_test_align(void) +static void packet_test_align(void) { odp_packet_t pkt; uint32_t pkt_len, seg_len, offset, aligned_seglen; @@ -2118,7 +2117,7 @@ void packet_test_align(void) odp_packet_free(pkt); }
-void packet_test_offset(void) +static void packet_test_offset(void) { odp_packet_t pkt = test_packet; uint32_t seg_len, full_seg_len; @@ -2164,7 +2163,7 @@ void packet_test_offset(void) CU_ASSERT_PTR_NOT_NULL(ptr); }
-void packet_test_ref(void) +static void packet_test_ref(void) { odp_packet_t base_pkt, segmented_base_pkt, hdr_pkt[4], ref_pkt[4], refhdr_pkt[4], hdr_cpy; @@ -3331,7 +3330,7 @@ odp_suiteinfo_t packet_suites[] = { ODP_SUITE_INFO_NULL, };
-int packet_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/packet/packet.h b/test/validation/api/packet/packet.h deleted file mode 100644 index 798b272b..00000000 --- a/test/validation/api/packet/packet.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_PACKET_H_ -#define _ODP_TEST_PACKET_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void packet_test_alloc_free(void); -void packet_test_alloc_free_multi(void); -void packet_test_free_sp(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_prefetch(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_concatsplit(void); -void packet_test_concat_small(void); -void packet_test_concat_extend_trunc(void); -void packet_test_extend_small(void); -void packet_test_extend_large(void); -void packet_test_extend_mix(void); -void packet_test_extend_ref(void); -void packet_test_align(void); -void packet_test_offset(void); -void packet_test_ref(void); - -/* test arrays: */ -extern odp_testinfo_t packet_suite[]; - -/* test array init/term functions: */ -int packet_suite_init(void); -int packet_suite_term(void); - -/* test registry: */ -extern odp_suiteinfo_t packet_suites[]; - -/* main test program: */ -int packet_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/packet/packet_main.c b/test/validation/api/packet/packet_main.c deleted file mode 100644 index a80e29a2..00000000 --- a/test/validation/api/packet/packet_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "packet.h" - -int main(int argc, char *argv[]) -{ - return packet_main(argc, argv); -}
commit 409d87e542b9f018467c2c62bb07a8e4f2a15993 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: lock: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/lock/Makefile.am b/test/validation/api/lock/Makefile.am index c5518b3a..ad75e185 100644 --- a/test/validation/api/lock/Makefile.am +++ b/test/validation/api/lock/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = lock_main -lock_main_SOURCES = lock_main.c lock.c lock.h +lock_main_SOURCES = lock.c diff --git a/test/validation/api/lock/lock.c b/test/validation/api/lock/lock.c index 48a659e8..4ed1f8d8 100644 --- a/test/validation/api/lock/lock.c +++ b/test/validation/api/lock/lock.c @@ -11,7 +11,6 @@ #include <CUnit/Basic.h> #include <odp_cunit_common.h> #include <unistd.h> -#include "lock.h"
#define VERBOSE 0
@@ -1004,7 +1003,7 @@ static int rwlock_recursive_functional_test(void *arg UNUSED) }
/* Thread-unsafe tests */ -void lock_test_no_lock_functional(void) +static void lock_test_no_lock_functional(void) { pthrd_arg arg;
@@ -1019,7 +1018,7 @@ odp_testinfo_t lock_suite_no_locking[] = { };
/* Spin lock tests */ -void lock_test_spinlock_api(void) +static void lock_test_spinlock_api(void) { pthrd_arg arg;
@@ -1028,7 +1027,7 @@ void lock_test_spinlock_api(void) odp_cunit_thread_exit(&arg); }
-void lock_test_spinlock_functional(void) +static void lock_test_spinlock_functional(void) { pthrd_arg arg;
@@ -1038,7 +1037,7 @@ void lock_test_spinlock_functional(void) odp_cunit_thread_exit(&arg); }
-void lock_test_spinlock_recursive_api(void) +static void lock_test_spinlock_recursive_api(void) { pthrd_arg arg;
@@ -1047,7 +1046,7 @@ void lock_test_spinlock_recursive_api(void) odp_cunit_thread_exit(&arg); }
-void lock_test_spinlock_recursive_functional(void) +static void lock_test_spinlock_recursive_functional(void) { pthrd_arg arg;
@@ -1070,7 +1069,7 @@ odp_testinfo_t lock_suite_spinlock_recursive[] = { };
/* Ticket lock tests */ -void lock_test_ticketlock_api(void) +static void lock_test_ticketlock_api(void) { pthrd_arg arg;
@@ -1079,7 +1078,7 @@ void lock_test_ticketlock_api(void) odp_cunit_thread_exit(&arg); }
-void lock_test_ticketlock_functional(void) +static void lock_test_ticketlock_functional(void) { pthrd_arg arg;
@@ -1097,7 +1096,7 @@ odp_testinfo_t lock_suite_ticketlock[] = { };
/* RW lock tests */ -void lock_test_rwlock_api(void) +static void lock_test_rwlock_api(void) { pthrd_arg arg;
@@ -1106,7 +1105,7 @@ void lock_test_rwlock_api(void) odp_cunit_thread_exit(&arg); }
-void lock_test_rwlock_functional(void) +static void lock_test_rwlock_functional(void) { pthrd_arg arg;
@@ -1122,7 +1121,7 @@ odp_testinfo_t lock_suite_rwlock[] = { ODP_TEST_INFO_NULL };
-void lock_test_rwlock_recursive_api(void) +static void lock_test_rwlock_recursive_api(void) { pthrd_arg arg;
@@ -1131,7 +1130,7 @@ void lock_test_rwlock_recursive_api(void) odp_cunit_thread_exit(&arg); }
-void lock_test_rwlock_recursive_functional(void) +static void lock_test_rwlock_recursive_functional(void) { pthrd_arg arg;
@@ -1147,7 +1146,7 @@ odp_testinfo_t lock_suite_rwlock_recursive[] = { ODP_TEST_INFO_NULL };
-int lock_suite_init(void) +static int lock_suite_init(void) { uint32_t num_threads, idx;
@@ -1159,7 +1158,7 @@ int lock_suite_init(void) return 0; }
-int lock_init(odp_instance_t *inst) +static int lock_init(odp_instance_t *inst) { uint32_t workers_count, max_threads; int ret = 0; @@ -1208,7 +1207,7 @@ int lock_init(odp_instance_t *inst) return ret; }
-int lock_term(odp_instance_t inst) +static int lock_term(odp_instance_t inst) { odp_shm_t shm;
@@ -1247,7 +1246,7 @@ odp_suiteinfo_t lock_suites[] = { ODP_SUITE_INFO_NULL };
-int lock_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/lock/lock.h b/test/validation/api/lock/lock.h deleted file mode 100644 index e0f49728..00000000 --- a/test/validation/api/lock/lock.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_LOCK_H_ -#define _ODP_TEST_LOCK_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void lock_test_no_lock_functional(void); -void lock_test_spinlock_api(void); -void lock_test_spinlock_functional(void); -void lock_test_spinlock_recursive_api(void); -void lock_test_spinlock_recursive_functional(void); -void lock_test_ticketlock_api(void); -void lock_test_ticketlock_functional(void); -void lock_test_rwlock_api(void); -void lock_test_rwlock_functional(void); -void lock_test_rwlock_recursive_api(void); -void lock_test_rwlock_recursive_functional(void); - -/* test arrays: */ -extern odp_testinfo_t lock_suite_no_locking[]; -extern odp_testinfo_t lock_suite_spinlock[]; -extern odp_testinfo_t lock_suite_spinlock_recursive[]; -extern odp_testinfo_t lock_suite_ticketlock[]; -extern odp_testinfo_t lock_suite_rwlock[]; -extern odp_testinfo_t lock_suite_rwlock_recursive[]; - -/* test array init/term functions: */ -int lock_suite_init(void); - -/* test registry: */ -extern odp_suiteinfo_t lock_suites[]; - -/* executable init/term functions: */ -int lock_init(odp_instance_t *inst); -int lock_term(odp_instance_t inst); - -/* main test program: */ -int lock_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/lock/lock_main.c b/test/validation/api/lock/lock_main.c deleted file mode 100644 index e182f77a..00000000 --- a/test/validation/api/lock/lock_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "lock.h" - -int main(int argc, char *argv[]) -{ - return lock_main(argc, argv); -}
commit f4d395f2a80646c0609b62fbe37cd14465df74ac Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: hash: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/hash/Makefile.am b/test/validation/api/hash/Makefile.am index 8f005778..0d843ea7 100644 --- a/test/validation/api/hash/Makefile.am +++ b/test/validation/api/hash/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = hash_main -hash_main_SOURCES = hash_main.c hash.c hash.h +hash_main_SOURCES = hash.c diff --git a/test/validation/api/hash/hash.c b/test/validation/api/hash/hash.c index 886df502..2216dff8 100644 --- a/test/validation/api/hash/hash.c +++ b/test/validation/api/hash/hash.c @@ -8,9 +8,8 @@
#include <odp_api.h> #include <odp_cunit_common.h> -#include "hash.h"
-void hash_test_crc32c(void) +static void hash_test_crc32c(void) { uint32_t test_value = 0x12345678; uint32_t ret = odp_hash_crc32c(&test_value, 4, 0); @@ -39,7 +38,7 @@ odp_suiteinfo_t hash_suites[] = { ODP_SUITE_INFO_NULL };
-int hash_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/hash/hash.h b/test/validation/api/hash/hash.h deleted file mode 100644 index 936571e6..00000000 --- a/test/validation/api/hash/hash.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_HASH_H_ -#define _ODP_TEST_HASH_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void hash_test_crc32c(void); - -/* test arrays: */ -extern odp_testinfo_t hash_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t hash_suites[]; - -/* main test program: */ -int hash_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/hash/hash_main.c b/test/validation/api/hash/hash_main.c deleted file mode 100644 index 089b1f95..00000000 --- a/test/validation/api/hash/hash_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "hash.h" - -int main(int argc, char *argv[]) -{ - return hash_main(argc, argv); -}
commit dab09417bf432da56aeddb2feaef9e6a11b739d7 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: event: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/event/Makefile.am b/test/validation/api/event/Makefile.am index 762f9356..0d26035e 100644 --- a/test/validation/api/event/Makefile.am +++ b/test/validation/api/event/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = event_main -event_main_SOURCES = event_main.c event.c event.h +event_main_SOURCES = event.c diff --git a/test/validation/api/event/event.c b/test/validation/api/event/event.c index 5add99c3..ec0fec2d 100644 --- a/test/validation/api/event/event.c +++ b/test/validation/api/event/event.c @@ -7,7 +7,6 @@ #include "config.h" #include <odp_api.h> #include <odp_cunit_common.h> -#include "event.h"
#define NUM_EVENTS 100 #define EVENT_SIZE 100 @@ -400,7 +399,7 @@ odp_suiteinfo_t event_suites[] = { ODP_SUITE_INFO_NULL, };
-int event_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/event/event.h b/test/validation/api/event/event.h deleted file mode 100644 index 1d2b6e69..00000000 --- a/test/validation/api/event/event.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_EVENT_H_ -#define _ODP_TEST_EVENT_H_ - -int event_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/event/event_main.c b/test/validation/api/event/event_main.c deleted file mode 100644 index 3fbefdb8..00000000 --- a/test/validation/api/event/event_main.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" -#include "event.h" - -int main(int argc, char *argv[]) -{ - return event_main(argc, argv); -}
commit f7938ef11ede6ed6843bb7608a98ab3d15cf8e1c Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: errno: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/errno/Makefile.am b/test/validation/api/errno/Makefile.am index ad5c7ded..de13afbf 100644 --- a/test/validation/api/errno/Makefile.am +++ b/test/validation/api/errno/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = errno_main -errno_main_SOURCES = errno_main.c errno.c errno.h +errno_main_SOURCES = errno.c diff --git a/test/validation/api/errno/errno.c b/test/validation/api/errno/errno.c index 929e0f40..95468a3f 100644 --- a/test/validation/api/errno/errno.c +++ b/test/validation/api/errno/errno.c @@ -8,9 +8,8 @@
#include <odp_api.h> #include "odp_cunit_common.h" -#include "errno.h"
-void errno_test_odp_errno_sunny_day(void) +static void errno_test_odp_errno_sunny_day(void) { int my_errno;
@@ -31,7 +30,7 @@ odp_suiteinfo_t errno_suites[] = { ODP_SUITE_INFO_NULL, };
-int errno_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/errno/errno.h b/test/validation/api/errno/errno.h deleted file mode 100644 index 72038519..00000000 --- a/test/validation/api/errno/errno.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_ERRNO_H_ -#define _ODP_TEST_ERRNO_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void errno_test_odp_errno_sunny_day(void); - -/* test arrays: */ -extern odp_testinfo_t errno_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t errno_suites[]; - -/* main test program: */ -int errno_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/errno/errno_main.c b/test/validation/api/errno/errno_main.c deleted file mode 100644 index 2f2e3155..00000000 --- a/test/validation/api/errno/errno_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "errno.h" - -int main(int argc, char *argv[]) -{ - return errno_main(argc, argv); -}
commit 9e40c760b95077a4ca4e652e4d39a4304e5828f6 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: cpumask: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/cpumask/Makefile.am b/test/validation/api/cpumask/Makefile.am index e5c78d92..3872c1bd 100644 --- a/test/validation/api/cpumask/Makefile.am +++ b/test/validation/api/cpumask/Makefile.am @@ -1,5 +1,5 @@ include ../Makefile.inc
test_PROGRAMS = cpumask_main -cpumask_main_SOURCES = cpumask_main.c cpumask.c cpumask.h +cpumask_main_SOURCES = cpumask.c LDADD += $(LIBCPUMASK_COMMON) diff --git a/test/validation/api/cpumask/cpumask.c b/test/validation/api/cpumask/cpumask.c index e6ac8394..9da68a76 100644 --- a/test/validation/api/cpumask/cpumask.c +++ b/test/validation/api/cpumask/cpumask.c @@ -9,13 +9,12 @@ #include <odp_api.h>
#include "odp_cunit_common.h" -#include "cpumask.h" #include "mask_common.h"
/* default worker parameter to get all that may be available */ #define ALL_AVAILABLE 0
-void cpumask_test_odp_cpumask_def_control(void) +static void cpumask_test_odp_cpumask_def_control(void) { unsigned num; unsigned mask_count; @@ -30,7 +29,7 @@ void cpumask_test_odp_cpumask_def_control(void) CU_ASSERT(num <= max_cpus); }
-void cpumask_test_odp_cpumask_def_worker(void) +static void cpumask_test_odp_cpumask_def_worker(void) { unsigned num; unsigned mask_count; @@ -45,7 +44,7 @@ void cpumask_test_odp_cpumask_def_worker(void) CU_ASSERT(num <= max_cpus); }
-void cpumask_test_odp_cpumask_def(void) +static void cpumask_test_odp_cpumask_def(void) { unsigned mask_count; unsigned num_worker; @@ -101,7 +100,7 @@ odp_suiteinfo_t cpumask_suites[] = { ODP_SUITE_INFO_NULL, };
-int cpumask_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/cpumask/cpumask.h b/test/validation/api/cpumask/cpumask.h deleted file mode 100644 index 87a4512b..00000000 --- a/test/validation/api/cpumask/cpumask.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_CPUMASK_H_ -#define _ODP_TEST_CPUMASK_H_ - -#include <odp_api.h> -#include <odp_cunit_common.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 odp_testinfo_t cpumask_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t cpumask_suites[]; - -/* main test program: */ -int cpumask_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/cpumask/cpumask_main.c b/test/validation/api/cpumask/cpumask_main.c deleted file mode 100644 index 77fdd228..00000000 --- a/test/validation/api/cpumask/cpumask_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "cpumask.h" - -int main(int argc, char *argv[]) -{ - return cpumask_main(argc, argv); -}
commit 7c733ea2be5898660a3d02cdd2cf1f0a64a50e0c Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: chksum: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/chksum/Makefile.am b/test/validation/api/chksum/Makefile.am index 9bd44385..349fdd64 100644 --- a/test/validation/api/chksum/Makefile.am +++ b/test/validation/api/chksum/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = chksum_main -chksum_main_SOURCES = chksum_main.c chksum.c chksum.h +chksum_main_SOURCES = chksum.c diff --git a/test/validation/api/chksum/chksum.c b/test/validation/api/chksum/chksum.c index f8687955..42bda779 100644 --- a/test/validation/api/chksum/chksum.c +++ b/test/validation/api/chksum/chksum.c @@ -6,7 +6,6 @@
#include <odp_api.h> #include <odp_cunit_common.h> -#include "chksum.h"
#define NUM_IP_HDR 5 #define IP_HDR_LEN 20 @@ -244,7 +243,7 @@ static uint8_t ODP_ALIGNED(4) udp_test_vect_long[] = { };
/* Test ones complement sum with IPv4 headers */ -void chksum_ones_complement_ip(void) +static void chksum_ones_complement_ip(void) { int i; uint16_t sum, res; @@ -258,7 +257,7 @@ void chksum_ones_complement_ip(void) }
/* Test ones complement sum with various length pseudo UDP packets */ -void chksum_ones_complement_udp(void) +static void chksum_ones_complement_udp(void) { int i; uint16_t sum, res; @@ -273,7 +272,7 @@ void chksum_ones_complement_udp(void) }
/* Test ones complement sum with a long pseudo UDP packet */ -void chksum_ones_complement_udp_long(void) +static void chksum_ones_complement_udp_long(void) { int i; uint16_t sum, res; @@ -326,7 +325,7 @@ odp_suiteinfo_t chksum_suites[] = { ODP_SUITE_INFO_NULL };
-int chksum_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/chksum/chksum.h b/test/validation/api/chksum/chksum.h deleted file mode 100644 index 50ed66ee..00000000 --- a/test/validation/api/chksum/chksum.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_CHKSUM_H_ -#define _ODP_TEST_CHKSUM_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void chksum_ones_complement_ip(void); -void chksum_ones_complement_udp(void); -void chksum_ones_complement_udp_long(void); - -/* test arrays: */ -extern odp_testinfo_t chksum_suite[]; - -/* test registry: */ -extern odp_suiteinfo_t chksum_suites[]; - -/* main test program: */ -int chksum_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/chksum/chksum_main.c b/test/validation/api/chksum/chksum_main.c deleted file mode 100644 index bec10ddd..00000000 --- a/test/validation/api/chksum/chksum_main.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (c) 2017, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "chksum.h" - -int main(int argc, char *argv[]) -{ - return chksum_main(argc, argv); -}
commit e8d209cc33a34c7ee92053e3f240c542068816dd Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: buffer: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/buffer/Makefile.am b/test/validation/api/buffer/Makefile.am index 901fdadc..f459010c 100644 --- a/test/validation/api/buffer/Makefile.am +++ b/test/validation/api/buffer/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = buffer_main -buffer_main_SOURCES = buffer_main.c buffer.c buffer.h +buffer_main_SOURCES = buffer.c diff --git a/test/validation/api/buffer/buffer.c b/test/validation/api/buffer/buffer.c index 91353a7c..7d13bc18 100644 --- a/test/validation/api/buffer/buffer.c +++ b/test/validation/api/buffer/buffer.c @@ -8,7 +8,6 @@
#include <odp_api.h> #include "odp_cunit_common.h" -#include "buffer.h"
#define BUF_ALIGN ODP_CACHE_LINE_SIZE #define BUF_SIZE 1500 @@ -16,7 +15,7 @@ static odp_pool_t raw_pool; static odp_buffer_t raw_buffer = ODP_BUFFER_INVALID;
-int buffer_suite_init(void) +static int buffer_suite_init(void) { odp_pool_param_t params;
@@ -35,7 +34,7 @@ int buffer_suite_init(void) return 0; }
-int buffer_suite_term(void) +static int buffer_suite_term(void) { odp_buffer_free(raw_buffer); if (odp_pool_destroy(raw_pool) != 0) @@ -43,7 +42,7 @@ int buffer_suite_term(void) return 0; }
-void buffer_test_pool_alloc(void) +static void buffer_test_pool_alloc(void) { odp_pool_t pool; const int num = 3; @@ -127,7 +126,7 @@ static int buffer_alloc_multi(odp_pool_t pool, odp_buffer_t buffer[], int num) return total; }
-void buffer_test_pool_alloc_multi(void) +static void buffer_test_pool_alloc_multi(void) { odp_pool_t pool; const int num = 3; @@ -192,7 +191,7 @@ void buffer_test_pool_alloc_multi(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void buffer_test_pool_free(void) +static void buffer_test_pool_free(void) { odp_pool_t pool; odp_buffer_t buffer; @@ -223,7 +222,7 @@ void buffer_test_pool_free(void) CU_ASSERT(odp_pool_destroy(pool) == 0); }
-void buffer_test_pool_free_multi(void) +static void buffer_test_pool_free_multi(void) { odp_pool_t pool[2]; odp_buffer_t buffer[4]; @@ -261,7 +260,7 @@ void buffer_test_pool_free_multi(void) CU_ASSERT(odp_pool_destroy(pool[1]) == 0); }
-void buffer_test_management_basic(void) +static void buffer_test_management_basic(void) { odp_event_t ev = odp_buffer_to_event(raw_buffer); odp_event_subtype_t subtype; @@ -294,7 +293,7 @@ odp_suiteinfo_t buffer_suites[] = { ODP_SUITE_INFO_NULL, };
-int buffer_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/buffer/buffer.h b/test/validation/api/buffer/buffer.h deleted file mode 100644 index 48331e3f..00000000 --- a/test/validation/api/buffer/buffer.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_BUFFER_H_ -#define _ODP_TEST_BUFFER_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void buffer_test_pool_alloc(void); -void buffer_test_pool_free(void); -void buffer_test_pool_alloc_multi(void); -void buffer_test_pool_free_multi(void); -void buffer_test_management_basic(void); - -/* test arrays: */ -extern odp_testinfo_t buffer_suite[]; - -/* test array init/term functions: */ -int buffer_suite_init(void); -int buffer_suite_term(void); - -/* test registry: */ -extern odp_suiteinfo_t buffer_suites[]; - -/* main test program: */ -int buffer_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/buffer/buffer_main.c b/test/validation/api/buffer/buffer_main.c deleted file mode 100644 index 8642560d..00000000 --- a/test/validation/api/buffer/buffer_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "buffer.h" - -int main(int argc, char *argv[]) -{ - return buffer_main(argc, argv); -}
commit 157737a4629a569f453762f92be2e3d174dfe1e5 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: barrier: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/barrier/Makefile.am b/test/validation/api/barrier/Makefile.am index aad5ddd6..f5f751b8 100644 --- a/test/validation/api/barrier/Makefile.am +++ b/test/validation/api/barrier/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = barrier_main -barrier_main_SOURCES = barrier_main.c barrier.c barrier.h +barrier_main_SOURCES = barrier.c diff --git a/test/validation/api/barrier/barrier.c b/test/validation/api/barrier/barrier.c index b75d6204..7201cca3 100644 --- a/test/validation/api/barrier/barrier.c +++ b/test/validation/api/barrier/barrier.c @@ -11,7 +11,6 @@ #include <CUnit/Basic.h> #include <odp_cunit_common.h> #include <unistd.h> -#include "barrier.h"
#define VERBOSE 0 #define MAX_ITERATIONS 1000 @@ -278,7 +277,7 @@ static void barrier_test_init(void) }
/* Barrier tests */ -void barrier_test_memory_barrier(void) +static void barrier_test_memory_barrier(void) { volatile int a = 0; volatile int b = 0; @@ -298,7 +297,7 @@ void barrier_test_memory_barrier(void) temp_result = a + b + c + d; }
-void barrier_test_no_barrier_functional(void) +static void barrier_test_no_barrier_functional(void) { pthrd_arg arg;
@@ -308,7 +307,7 @@ void barrier_test_no_barrier_functional(void) odp_cunit_thread_exit(&arg); }
-void barrier_test_barrier_functional(void) +static void barrier_test_barrier_functional(void) { pthrd_arg arg;
@@ -325,7 +324,7 @@ odp_testinfo_t barrier_suite_barrier[] = { ODP_TEST_INFO_NULL };
-int barrier_init(odp_instance_t *inst) +static int barrier_init(odp_instance_t *inst) { uint32_t workers_count, max_threads; int ret = 0; @@ -374,7 +373,7 @@ int barrier_init(odp_instance_t *inst) return ret; }
-int barrier_term(odp_instance_t inst) +static int barrier_term(odp_instance_t inst) { odp_shm_t shm;
@@ -403,7 +402,7 @@ odp_suiteinfo_t barrier_suites[] = { ODP_SUITE_INFO_NULL };
-int barrier_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/barrier/barrier.h b/test/validation/api/barrier/barrier.h deleted file mode 100644 index 188bcb8f..00000000 --- a/test/validation/api/barrier/barrier.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_BARRIER_H_ -#define _ODP_TEST_BARRIER_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void barrier_test_memory_barrier(void); -void barrier_test_no_barrier_functional(void); -void barrier_test_barrier_functional(void); - -/* test arrays: */ -extern odp_testinfo_t barrier_suite_barrier[]; - -/* test registry: */ -extern odp_suiteinfo_t barrier_suites[]; - -/* executable init/term functions: */ -int barrier_init(odp_instance_t *inst); -int barrier_term(odp_instance_t inst); - -/* main test program: */ -int barrier_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/barrier/barrier_main.c b/test/validation/api/barrier/barrier_main.c deleted file mode 100644 index 28df6afa..00000000 --- a/test/validation/api/barrier/barrier_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "barrier.h" - -int main(int argc, char *argv[]) -{ - return barrier_main(argc, argv); -}
commit e4fec7da3e89c20cfe3c4d96c5fbe02ebbea57b3 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Thu Feb 15 03:04:03 2018 +0300
validation: atomic: simplify test infrastructure
Merge separate file with just main() function into main test file.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Reviewed-by: Petri Savolainen petri.savolainen@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/validation/api/atomic/Makefile.am b/test/validation/api/atomic/Makefile.am index 4de45970..41ad2e6b 100644 --- a/test/validation/api/atomic/Makefile.am +++ b/test/validation/api/atomic/Makefile.am @@ -1,4 +1,4 @@ include ../Makefile.inc
test_PROGRAMS = atomic_main -atomic_main_SOURCES = atomic_main.c atomic.c atomic.h +atomic_main_SOURCES = atomic.c diff --git a/test/validation/api/atomic/atomic.c b/test/validation/api/atomic/atomic.c index 5bf2fe87..17d5743d 100644 --- a/test/validation/api/atomic/atomic.c +++ b/test/validation/api/atomic/atomic.c @@ -11,7 +11,6 @@ #include <CUnit/Basic.h> #include <odp_cunit_common.h> #include <unistd.h> -#include "atomic.h"
#define VERBOSE 0 #define MAX_ITERATIONS 1000 @@ -536,7 +535,7 @@ static void test_atomic_validate(int check) } }
-int atomic_init(odp_instance_t *inst) +static int atomic_init(odp_instance_t *inst) { uint32_t workers_count, max_threads; int ret = 0; @@ -585,7 +584,7 @@ int atomic_init(odp_instance_t *inst) return ret; }
-int atomic_term(odp_instance_t inst) +static int atomic_term(odp_instance_t inst) { odp_shm_t shm;
@@ -725,48 +724,48 @@ static void test_atomic_functional(int func_ptr(void *), int check) test_atomic_validate(check); }
-void atomic_test_atomic_inc_dec(void) +static void atomic_test_atomic_inc_dec(void) { test_atomic_functional(test_atomic_inc_dec_thread, 0); }
-void atomic_test_atomic_add_sub(void) +static void atomic_test_atomic_add_sub(void) { test_atomic_functional(test_atomic_add_sub_thread, 0); }
-void atomic_test_atomic_fetch_inc_dec(void) +static void atomic_test_atomic_fetch_inc_dec(void) { test_atomic_functional(test_atomic_fetch_inc_dec_thread, 0); }
-void atomic_test_atomic_fetch_add_sub(void) +static void atomic_test_atomic_fetch_add_sub(void) { test_atomic_functional(test_atomic_fetch_add_sub_thread, 0); }
-void atomic_test_atomic_max_min(void) +static void atomic_test_atomic_max_min(void) { test_atomic_functional(test_atomic_max_min_thread, CHECK_MAX_MIN); }
-void atomic_test_atomic_cas_inc_dec(void) +static void atomic_test_atomic_cas_inc_dec(void) { test_atomic_functional(test_atomic_cas_inc_dec_thread, 0); }
-void atomic_test_atomic_xchg(void) +static void atomic_test_atomic_xchg(void) { test_atomic_functional(test_atomic_xchg_thread, CHECK_XCHG); }
-void atomic_test_atomic_non_relaxed(void) +static void atomic_test_atomic_non_relaxed(void) { test_atomic_functional(test_atomic_non_relaxed_thread, CHECK_MAX_MIN | CHECK_XCHG); }
-void atomic_test_atomic_op_lock_free(void) +static void atomic_test_atomic_op_lock_free(void) { odp_atomic_op_t atomic_op; int ret_null, ret; @@ -891,7 +890,7 @@ odp_suiteinfo_t atomic_suites[] = { ODP_SUITE_INFO_NULL };
-int atomic_main(int argc, char *argv[]) +int main(int argc, char *argv[]) { int ret;
diff --git a/test/validation/api/atomic/atomic.h b/test/validation/api/atomic/atomic.h deleted file mode 100644 index 66796c8e..00000000 --- a/test/validation/api/atomic/atomic.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef _ODP_TEST_ATOMIC_H_ -#define _ODP_TEST_ATOMIC_H_ - -#include <odp_cunit_common.h> - -/* test functions: */ -void atomic_test_atomic_inc_dec(void); -void atomic_test_atomic_add_sub(void); -void atomic_test_atomic_fetch_inc_dec(void); -void atomic_test_atomic_fetch_add_sub(void); -void atomic_test_atomic_max_min(void); -void atomic_test_atomic_cas_inc_dec(void); -void atomic_test_atomic_xchg(void); -void atomic_test_atomic_non_relaxed(void); -void atomic_test_atomic_op_lock_free(void); - -/* test arrays: */ -extern odp_testinfo_t atomic_suite_atomic[]; - -/* test array init/term functions: */ -int atomic_suite_init(void); - -/* test registry: */ -extern odp_suiteinfo_t atomic_suites[]; - -/* executable init/term functions: */ -int atomic_init(odp_instance_t *inst); -int atomic_term(odp_instance_t inst); - -/* main test program: */ -int atomic_main(int argc, char *argv[]); - -#endif diff --git a/test/validation/api/atomic/atomic_main.c b/test/validation/api/atomic/atomic_main.c deleted file mode 100644 index b6028393..00000000 --- a/test/validation/api/atomic/atomic_main.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (c) 2015, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#include "config.h" - -#include "atomic.h" - -int main(int argc, char *argv[]) -{ - return atomic_main(argc, argv); -}
-----------------------------------------------------------------------
Summary of changes: .../test/validation/api/pktio/pktio_run_pcap.sh | 1 + test/validation/api/atomic/Makefile.am | 2 +- test/validation/api/atomic/atomic.c | 25 ++- test/validation/api/atomic/atomic.h | 39 ---- test/validation/api/atomic/atomic_main.c | 14 -- test/validation/api/barrier/Makefile.am | 2 +- test/validation/api/barrier/barrier.c | 13 +- test/validation/api/barrier/barrier.h | 30 ---- test/validation/api/barrier/barrier_main.c | 14 -- test/validation/api/buffer/Makefile.am | 2 +- test/validation/api/buffer/buffer.c | 17 +- test/validation/api/buffer/buffer.h | 32 ---- test/validation/api/buffer/buffer_main.c | 14 -- test/validation/api/chksum/Makefile.am | 2 +- test/validation/api/chksum/chksum.c | 9 +- test/validation/api/chksum/chksum.h | 26 --- test/validation/api/chksum/chksum_main.c | 12 -- test/validation/api/classification/Makefile.am | 2 +- .../validation/api/classification/classification.c | 2 +- .../validation/api/classification/classification.h | 42 ----- .../api/classification/classification_main.c | 14 -- .../api/classification/odp_classification_basic.c | 14 +- .../classification/odp_classification_test_pmr.c | 24 +-- .../api/classification/odp_classification_tests.c | 8 +- test/validation/api/cpumask/Makefile.am | 2 +- test/validation/api/cpumask/cpumask.c | 9 +- test/validation/api/cpumask/cpumask.h | 28 --- test/validation/api/cpumask/cpumask_main.c | 14 -- test/validation/api/crypto/Makefile.am | 5 +- test/validation/api/crypto/crypto.c | 135 -------------- test/validation/api/crypto/crypto.h | 59 ------ test/validation/api/crypto/crypto_main.c | 14 -- test/validation/api/crypto/odp_crypto_test_inp.c | 197 +++++++++++++++++---- test/validation/api/crypto/odp_crypto_test_inp.h | 26 --- test/validation/api/errno/Makefile.am | 2 +- test/validation/api/errno/errno.c | 5 +- test/validation/api/errno/errno.h | 24 --- test/validation/api/errno/errno_main.c | 14 -- test/validation/api/event/Makefile.am | 2 +- test/validation/api/event/event.c | 3 +- test/validation/api/event/event.h | 12 -- test/validation/api/event/event_main.c | 13 -- test/validation/api/hash/Makefile.am | 2 +- test/validation/api/hash/hash.c | 5 +- test/validation/api/hash/hash.h | 24 --- test/validation/api/hash/hash_main.c | 14 -- test/validation/api/lock/Makefile.am | 2 +- test/validation/api/lock/lock.c | 31 ++-- test/validation/api/lock/lock.h | 46 ----- test/validation/api/lock/lock_main.c | 14 -- test/validation/api/packet/Makefile.am | 2 +- test/validation/api/packet/packet.c | 67 ++++--- test/validation/api/packet/packet.h | 57 ------ test/validation/api/packet/packet_main.c | 14 -- test/validation/api/pktio/Makefile.am | 2 +- test/validation/api/pktio/parser.c | 36 ++-- test/validation/api/pktio/parser.h | 12 -- test/validation/api/pktio/pktio.c | 79 ++++----- test/validation/api/pktio/pktio.h | 67 ------- test/validation/api/pktio/pktio_main.c | 14 -- test/validation/api/pool/Makefile.am | 2 +- test/validation/api/pool/pool.c | 17 +- test/validation/api/pool/pool.h | 30 ---- test/validation/api/pool/pool_main.c | 14 -- test/validation/api/queue/Makefile.am | 2 +- test/validation/api/queue/queue.c | 15 +- test/validation/api/queue/queue.h | 31 ---- test/validation/api/queue/queue_main.c | 14 -- test/validation/api/random/Makefile.am | 2 +- test/validation/api/random/random.c | 9 +- test/validation/api/random/random.h | 26 --- test/validation/api/random/random_main.c | 14 -- test/validation/api/scheduler/Makefile.am | 2 +- test/validation/api/scheduler/scheduler.c | 77 ++++---- test/validation/api/scheduler/scheduler.h | 62 ------- test/validation/api/scheduler/scheduler_main.c | 14 -- test/validation/api/shmem/Makefile.am | 2 +- test/validation/api/shmem/shmem.c | 11 +- test/validation/api/shmem/shmem.h | 27 --- test/validation/api/shmem/shmem_main.c | 14 -- test/validation/api/std_clib/Makefile.am | 2 +- test/validation/api/std_clib/std_clib.c | 3 +- test/validation/api/std_clib/std_clib.h | 21 --- test/validation/api/std_clib/std_clib_main.c | 14 -- test/validation/api/system/Makefile.am | 2 +- test/validation/api/system/system.c | 44 ++--- test/validation/api/system/system.h | 45 ----- test/validation/api/system/system_main.c | 14 -- test/validation/api/thread/Makefile.am | 2 +- test/validation/api/thread/thread.c | 13 +- test/validation/api/thread/thread.h | 33 ---- test/validation/api/thread/thread_main.c | 14 -- test/validation/api/time/Makefile.am | 2 +- test/validation/api/time/time.c | 33 ++-- test/validation/api/time/time_main.c | 14 -- test/validation/api/time/time_test.h | 38 ---- test/validation/api/timer/Makefile.am | 2 +- test/validation/api/timer/timer.c | 11 +- test/validation/api/timer/timer.h | 27 --- test/validation/api/timer/timer_main.c | 14 -- test/validation/api/traffic_mngr/Makefile.am | 9 +- test/validation/api/traffic_mngr/traffic_mngr.c | 41 +++-- test/validation/api/traffic_mngr/traffic_mngr.h | 45 ----- .../api/traffic_mngr/traffic_mngr_main.c | 14 -- 104 files changed, 496 insertions(+), 1758 deletions(-) delete mode 100644 test/validation/api/atomic/atomic.h delete mode 100644 test/validation/api/atomic/atomic_main.c delete mode 100644 test/validation/api/barrier/barrier.h delete mode 100644 test/validation/api/barrier/barrier_main.c delete mode 100644 test/validation/api/buffer/buffer.h delete mode 100644 test/validation/api/buffer/buffer_main.c delete mode 100644 test/validation/api/chksum/chksum.h delete mode 100644 test/validation/api/chksum/chksum_main.c delete mode 100644 test/validation/api/classification/classification_main.c delete mode 100644 test/validation/api/cpumask/cpumask.h delete mode 100644 test/validation/api/cpumask/cpumask_main.c delete mode 100644 test/validation/api/crypto/crypto.c delete mode 100644 test/validation/api/crypto/crypto.h delete mode 100644 test/validation/api/crypto/crypto_main.c delete mode 100644 test/validation/api/crypto/odp_crypto_test_inp.h delete mode 100644 test/validation/api/errno/errno.h delete mode 100644 test/validation/api/errno/errno_main.c delete mode 100644 test/validation/api/event/event.h delete mode 100644 test/validation/api/event/event_main.c delete mode 100644 test/validation/api/hash/hash.h delete mode 100644 test/validation/api/hash/hash_main.c delete mode 100644 test/validation/api/lock/lock.h delete mode 100644 test/validation/api/lock/lock_main.c delete mode 100644 test/validation/api/packet/packet.h delete mode 100644 test/validation/api/packet/packet_main.c delete mode 100644 test/validation/api/pktio/pktio.h delete mode 100644 test/validation/api/pktio/pktio_main.c delete mode 100644 test/validation/api/pool/pool.h delete mode 100644 test/validation/api/pool/pool_main.c delete mode 100644 test/validation/api/queue/queue.h delete mode 100644 test/validation/api/queue/queue_main.c delete mode 100644 test/validation/api/random/random.h delete mode 100644 test/validation/api/random/random_main.c delete mode 100644 test/validation/api/scheduler/scheduler.h delete mode 100644 test/validation/api/scheduler/scheduler_main.c delete mode 100644 test/validation/api/shmem/shmem.h delete mode 100644 test/validation/api/shmem/shmem_main.c delete mode 100644 test/validation/api/std_clib/std_clib.h delete mode 100644 test/validation/api/std_clib/std_clib_main.c delete mode 100644 test/validation/api/system/system.h delete mode 100644 test/validation/api/system/system_main.c delete mode 100644 test/validation/api/thread/thread.h delete mode 100644 test/validation/api/thread/thread_main.c delete mode 100644 test/validation/api/time/time_main.c delete mode 100644 test/validation/api/time/time_test.h delete mode 100644 test/validation/api/timer/timer.h delete mode 100644 test/validation/api/timer/timer_main.c delete mode 100644 test/validation/api/traffic_mngr/traffic_mngr.h delete mode 100644 test/validation/api/traffic_mngr/traffic_mngr_main.c
hooks/post-receive