2019-06-25 11:12:58 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2010-2014 Intel Corporation
|
2017-04-21 10:43:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2018-05-15 09:49:22 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-04-21 10:43:26 +00:00
|
|
|
#include <rte_common.h>
|
2018-05-15 09:49:22 +00:00
|
|
|
#include <rte_version.h>
|
2017-04-21 10:43:26 +00:00
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
#include "test.h"
|
2017-04-21 10:43:26 +00:00
|
|
|
|
2018-05-15 09:49:22 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
test_version(void)
|
2017-04-21 10:43:26 +00:00
|
|
|
{
|
2018-05-15 09:49:22 +00:00
|
|
|
const char *version = rte_version();
|
|
|
|
if (version == NULL)
|
|
|
|
return -1;
|
|
|
|
printf("Version string: '%s'\n", version);
|
|
|
|
if (*version == '\0' ||
|
|
|
|
strncmp(version, RTE_VER_PREFIX, sizeof(RTE_VER_PREFIX)-1) != 0)
|
2017-04-21 10:43:26 +00:00
|
|
|
return -1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2025-01-10 11:50:43 +00:00
|
|
|
REGISTER_FAST_TEST(version_autotest, true, true, test_version);
|