2 * libwebsockets - small server side websockets and web server implementation
4 * Copyright (C) 2010-2019 Andy Green <andy@warmcat.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation:
9 * version 2.1 of the License.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 * included from libwebsockets.h
23 * lws_test_sequencer manages running an array of unit tests.
26 typedef void (*lws_test_sequence_cb)(const void *cb_user);
28 typedef struct lws_test_sequencer_args {
29 lws_abs_t *abs; /* abstract protocol + unit test txport */
30 lws_unit_test_t *tests; /* array of lws_unit_test_t */
31 int *results; /* takes result dispositions */
32 int results_max; /* max space usable in results */
33 int *count_tests; /* count of done tests */
34 int *count_passes; /* count of passed tests */
35 lws_test_sequence_cb cb; /* completion callback */
36 void *cb_user; /* opaque user ptr given to cb */
37 } lws_test_sequencer_args_t;
40 * lws_abs_unit_test_sequencer() - helper to sequence multiple unit tests
42 * \param args: lws_test_sequencer_args_t prepared with arguments for the tests
44 * This helper sequences one or more unit tests to run and collects the results.
46 * The incoming abs should be set up for the abstract protocol you want to test
47 * and the lws unit-test transport.
53 * LPE_FAILED_UNEXPECTED_TIMEOUT
54 * LPE_FAILED_UNEXPECTED_PASS
55 * LPE_FAILED_UNEXPECTED_CLOSE
57 * The callback args->cb is called when the tests have been done.
59 LWS_VISIBLE LWS_EXTERN int
60 lws_abs_unit_test_sequencer(const lws_test_sequencer_args_t *args);