Commit eace9ede authored by Ramakrishna Pallala's avatar Ramakrishna Pallala Committed by Anas Nashif
Browse files

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: default avatarRamakrishna Pallala <ramakrishna.pallala@intel.com>
parent 27aced16
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(NONE)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
+2 −0
Original line number Diff line number Diff line
Build test for:
  Altera Nios-II System ID soft IP core.
+2 −0
Original line number Diff line number Diff line
CONFIG_ALTERA_AVALON_SYSID=y
CONFIG_ZTEST=y
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <zephyr.h>
#include <ztest.h>

#include "altera_avalon_sysid.h"

void testing_sysid(void)
{
	s32_t sysid, status = TC_FAIL;

	sysid = alt_avalon_sysid_test();
	if (!sysid) {
		status = TC_PASS;
		TC_PRINT("[SysID] hardware and software appear to be in sync\n");
	} else if (sysid > 0) {
		TC_PRINT("[SysID] software appears to be older than hardware\n");
	} else {
		TC_PRINT("[SysID] hardware appears to be older than software\n");
	}

	zassert_equal(status, TC_PASS, "SysID test failed");
}

void test_main(void)
{
	ztest_test_suite(nios2_sysid_test_suite,
			ztest_unit_test(testing_sysid));
	ztest_run_test_suite(nios2_sysid_test_suite);
}
+4 −0
Original line number Diff line number Diff line
tests:
  test:
    platform_whitelist: altera_max10
    tags: sysid