Skip to content

Commit 0278bdc

Browse files
committed
tests/cmake: add tests for syscall generation scripts
This commit adds tests for whitespace in syscall declaration function signatures and signatures without parameters. Signed-off-by: Loek Le Blansch <loek.le-blansch.pv@renesas.com>
1 parent d143587 commit 0278bdc

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

tests/cmake/syscalls/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
cmake_minimum_required(VERSION 3.28)
4+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
5+
project(app C)
6+
target_sources(app PRIVATE main.c)

tests/cmake/syscalls/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include "main.h"
7+
8+
int main(void) { return 0; }

tests/cmake/syscalls/main.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
/*
4+
* Copyright (c) 2025 Renesas Electronics Corporation
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <zephyr/syscall.h>
9+
10+
/* Newline between return type and function name */
11+
/* clang-format off */
12+
__syscall void
13+
test_wrapped(int foo);
14+
/* clang-format on */
15+
16+
/* Empty parameters (macro used to silence checkpatch.pl) */
17+
#define EMPTY
18+
__syscall void test_empty(EMPTY);
19+
20+
#include <zephyr/syscalls/main.h>

tests/cmake/syscalls/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
CONFIG_APPLICATION_DEFINED_SYSCALL=y

tests/cmake/syscalls/testcase.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2025 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
tests:
4+
buildsystem.syscalls:
5+
build_only: true
6+
platform_allow: native_sim

0 commit comments

Comments
 (0)