This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 7a597a96ef4e30dd56a04c32a4c4c73ea8c239c6
Author: Parthiban Nallathambi <[email protected]>
AuthorDate: Sat Nov 21 20:45:34 2026 +0530

    boards/qemu-rh850-u2c: Add citest for NTFC.
    
    CI builds qemu-rh850-u2c but never boots it. Add a citest configuration
    that runs the NTFC tests on QEMU like qemu-armv8a and rv-virt. It adds
    ostest, setlogmask, a tmpfs for /tmp and the high priority work queue
    to nsh.
    
    run.sh fails when test_os did not pass. A run where every test is
    skipped also exits with 0, and it must not count as a pass.
    
    Signed-off-by: Parthiban Nallathambi <[email protected]>
---
 .../u2c/qemu-rh850-u2c/configs/citest/config.yaml  | 14 ++++
 .../u2c/qemu-rh850-u2c/configs/citest/defconfig    | 39 ++++++++++++
 .../rh850/u2c/qemu-rh850-u2c/configs/citest/run.sh | 74 ++++++++++++++++++++++
 .../u2c/qemu-rh850-u2c/configs/citest/session.json | 10 +++
 4 files changed, 137 insertions(+)

diff --git a/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/config.yaml 
b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/config.yaml
new file mode 100644
index 00000000000..733cdf43017
--- /dev/null
+++ b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/config.yaml
@@ -0,0 +1,14 @@
+config:
+  cwd: './'
+
+product:
+  name: "qemu-rh850-u2c"
+  cores:
+    core0:
+      name: 'main'
+      device: 'qemu'
+      line_buffered: true
+      exec_path: 'qemu-system-rh850'
+      exec_args: '-M rh850-u2c,test-exit=on -icount shift=4,sleep=on 
-nographic'
+      conf_path: './build/.config'
+      elf_path: './build/nuttx'
diff --git a/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/defconfig 
b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/defconfig
new file mode 100644
index 00000000000..6648ac80e43
--- /dev/null
+++ b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/defconfig
@@ -0,0 +1,39 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed 
.config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that 
includes your
+# modifications.
+#
+CONFIG_ARCH="rh850"
+CONFIG_ARCH_BOARD="qemu-rh850-u2c"
+CONFIG_ARCH_BOARD_QEMU_RH850_U2C=y
+CONFIG_ARCH_CHIP="u2c"
+CONFIG_ARCH_CHIP_R7F702600=y
+CONFIG_ARCH_CHIP_U2C=y
+CONFIG_ARCH_INTERRUPTSTACK=2048
+CONFIG_ARCH_RH850=y
+CONFIG_BOARDCTL_RESET=y
+CONFIG_BOARD_LOOPSPERMSEC=8906
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_FS_PROCFS=y
+CONFIG_FS_TMPFS=y
+CONFIG_IDLETHREAD_STACKSIZE=2048
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_INIT_STACKSIZE=3072
+CONFIG_LIBC_MEMFD_ERROR=y
+CONFIG_LIBM=y
+CONFIG_LINE_MAX=256
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_READLINE=y
+CONFIG_RAM_SIZE=131072
+CONFIG_RAM_START=0xfdc00000
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_STACK_COLORATION=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_SYSTEM_SETLOGMASK=y
+CONFIG_TESTING_OSTEST=y
+CONFIG_UART0_SERIAL_CONSOLE=y
diff --git a/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/run.sh 
b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/run.sh
new file mode 100755
index 00000000000..d80251ba616
--- /dev/null
+++ b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/run.sh
@@ -0,0 +1,74 @@
+#!/usr/bin/env bash
+############################################################################
+# boards/rh850/u2c/qemu-rh850-u2c/configs/citest/run.sh
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+set -o xtrace
+
+# start from nuttx dir
+olddir=$(pwd)
+nuttdir=${CURRENTCONFDIR}/../../../../../../
+cd ${nuttdir}
+
+# run NTFC
+confpath=${CURRENTCONFDIR}/config.yaml
+jsonconf=${CURRENTCONFDIR}/session.json
+testpath=${NTFCDIR}/external/nuttx-testing
+ntfc test --testpath=${testpath} --confpath=${confpath} --jsonconf=${jsonconf}
+
+ret="$?"
+echo $ret
+
+# a run where every test is skipped also exits 0, so require test_os in
+# the report of this session, the newest one under result/
+
+if [ "$ret" -eq 0 ] && ! python3 - <<'EOF'
+import glob
+import os
+import sys
+import xml.etree.ElementTree as ET
+
+sessions = sorted(glob.glob("result/*/"), key=os.path.getmtime)
+if not sessions:
+    sys.exit(1)
+
+last = sessions[-1]
+for f in glob.glob(last + "report.xml") + glob.glob(last + "report/*.xml"):
+    for case in ET.parse(f).getroot().iter("testcase"):
+        bad = [c for c in case if c.tag in ("skipped", "failure", "error")]
+        if case.get("name", "").startswith("test_os") and not bad:
+            sys.exit(0)
+sys.exit(1)
+EOF
+then
+  echo "test_os did not pass"
+  ret=1
+fi
+
+# export test results
+artifacts=${ARTIFACTCONFDIR}/ntfc
+mkdir -p ${artifacts}
+mv result ${artifacts}
+
+# restore old dir
+cd ${olddir}
+
+exit $ret
diff --git a/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/session.json 
b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/session.json
new file mode 100644
index 00000000000..3e71e22cf49
--- /dev/null
+++ b/boards/rh850/u2c/qemu-rh850-u2c/configs/citest/session.json
@@ -0,0 +1,10 @@
+{
+    "module": {
+        "include_module": [],
+        "exclude_module": [],
+        "order": []
+    },
+    "args": {
+        "kv": []
+    }
+}

Reply via email to