Add cross-platform tests for libmetal

To-be-expanded suite of tests for libmetal using
system-agnostic API instead of system specific tests.

Signed-off-by: Lefteris Ntafotis <lntaf@ics.forth.gr>
This commit is contained in:
Lefteris Ntafotis
2025-05-19 13:25:07 +03:00
committed by Arnaud Pouliquen
parent a0797a23a8
commit 1c3410be76
18 changed files with 662 additions and 0 deletions

33
test/config.c Normal file
View File

@@ -0,0 +1,33 @@
/*
* Copyright (c) 2025, CARV ICS FORTH.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/*
* @file config.c
* @brief Cross-platform tests for config interface
*/
#include <metal/sys.h>
#include <metal/log.h>
#include <metal/config.h>
int test_config(void)
{
struct metal_init_params metal_param = METAL_INIT_DEFAULTS;
metal_init(&metal_param);
metal_set_log_handler(metal_default_log_handler);
metal_set_log_level(METAL_LOG_INFO);
metal_info("Metal version: %d.%d.%d\n", METAL_VER_MAJOR, METAL_VER_MINOR, METAL_VER_PATCH);
metal_info("In string form: %s\n", METAL_VER);
metal_info("Metal system identifies as: %s\n", METAL_SYSTEM);
metal_info("Metal processor identifies as: %s\n", METAL_PROCESSOR);
metal_info("Metal machine identifies as: %s\n", METAL_MACHINE);
metal_finish();
return 0;
}