open5gs/tests/minimal/abts-main.c

67 lines
1.6 KiB
C
Raw Normal View History

2019-04-27 14:54:30 +00:00
/*
2020-05-25 16:15:22 +00:00
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
2019-04-27 14:54:30 +00:00
*
* 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/>.
*/
2020-05-25 16:15:22 +00:00
#include "test-5gc.h"
2019-04-27 14:54:30 +00:00
2020-05-25 16:15:22 +00:00
abts_suite *test_minimal(abts_suite *suite);
2019-04-27 14:54:30 +00:00
const struct testlist {
abts_suite *(*func)(abts_suite *suite);
} alltests[] = {
2020-05-25 16:15:22 +00:00
{test_minimal},
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
2020-05-25 16:15:22 +00:00
test_5gc_final();
2019-09-13 12:07:47 +00:00
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);
2020-05-25 16:15:22 +00:00
test_5gc_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);
2020-05-25 16:15:22 +00:00
test_5gc_run(argc, argv, "minimal.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);
}