open5gs/tests/simple/abts-main.c

75 lines
1.8 KiB
C
Raw Normal View History

2019-04-27 14:54:30 +00:00
/*
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "test-app.h"
2019-04-27 14:54:30 +00:00
abts_suite *test_s1setup(abts_suite *suite);
abts_suite *test_attach(abts_suite *suite);
abts_suite *test_volte(abts_suite *suite);
abts_suite *test_handover(abts_suite *suite);
abts_suite *test_crash(abts_suite *suite);
2019-04-27 14:54:30 +00:00
const struct testlist {
abts_suite *(*func)(abts_suite *suite);
} alltests[] = {
{test_s1setup},
{test_attach},
{test_volte},
{test_handover},
{test_crash},
2019-04-27 14:54:30 +00:00
{NULL},
};
static void terminate(void)
2019-04-27 14:54:30 +00:00
{
2019-06-15 07:16:32 +00:00
ogs_msleep(50);
test_child_terminate();
app_terminate();
2019-04-27 14:54:30 +00:00
2019-09-13 12:07:47 +00:00
test_app_final();
ogs_app_terminate();
2019-04-27 14:54:30 +00:00
}
static void initialize(const char *const argv[])
2019-04-27 14:54:30 +00:00
{
int rv;
2019-09-13 12:07:47 +00:00
rv = ogs_app_initialize(NULL, argv);
ogs_assert(rv == OGS_OK);
test_app_init();
2019-04-27 14:54:30 +00:00
rv = app_initialize(argv);
ogs_assert(rv == OGS_OK);
2019-04-27 14:54:30 +00:00
}
int main(int argc, const char *const argv[])
2019-04-27 14:54:30 +00:00
{
int i;
abts_suite *suite = NULL;
atexit(terminate);
test_app_run(argc, argv, "simple.yaml", initialize);
2019-04-27 14:54:30 +00:00
for (i = 0; alltests[i].func; i++)
suite = alltests[i].func(suite);
return abts_report(suite);
}