Skip to content

Commit eace9ed

Browse files
Ramakrishna PallalaAnas Nashif
Ramakrishna Pallala
authored and
Anas Nashif
committed
tests: boards: add SysID test app for altera_max10 board
Add test application to demonstrate the usage of Nios-II System ID soft IP. Signed-off-by: Ramakrishna Pallala <[email protected]>
1 parent 27aced1 commit eace9ed

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
2+
project(NONE)
3+
4+
FILE(GLOB app_sources src/*.c)
5+
target_sources(app PRIVATE ${app_sources})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Build test for:
2+
Altera Nios-II System ID soft IP core.
+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_ALTERA_AVALON_SYSID=y
2+
CONFIG_ZTEST=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2017 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr.h>
8+
#include <ztest.h>
9+
10+
#include "altera_avalon_sysid.h"
11+
12+
void testing_sysid(void)
13+
{
14+
s32_t sysid, status = TC_FAIL;
15+
16+
sysid = alt_avalon_sysid_test();
17+
if (!sysid) {
18+
status = TC_PASS;
19+
TC_PRINT("[SysID] hardware and software appear to be in sync\n");
20+
} else if (sysid > 0) {
21+
TC_PRINT("[SysID] software appears to be older than hardware\n");
22+
} else {
23+
TC_PRINT("[SysID] hardware appears to be older than software\n");
24+
}
25+
26+
zassert_equal(status, TC_PASS, "SysID test failed");
27+
}
28+
29+
void test_main(void)
30+
{
31+
ztest_test_suite(nios2_sysid_test_suite,
32+
ztest_unit_test(testing_sysid));
33+
ztest_run_test_suite(nios2_sysid_test_suite);
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tests:
2+
test:
3+
platform_whitelist: altera_max10
4+
tags: sysid

0 commit comments

Comments
 (0)