nuttx-apps/testing/ostest/Makefile
Marco Casaroli d3b7722b3d testing/ostest: drop the pre-split fork() fallbacks
The previous commit had task_fork_test() also accept CONFIG_ARCH_HAVE_FORK,
because the nuttx symbols naming the three primitives did not exist yet.  nuttx
now has them, so each test gates on the one primitive it tests and nothing
stands in for anything.

The OSTEST_HAVE_* indirection goes with the fallbacks, as does the
task_fork()->fork() shim in nand_sim_main.c.  The whole-file #ifdef in
task_fork.c goes too:  the build files already decide whether the file is
compiled, which is why fork.c and vfork.c do not carry one either.

task_fork_test() keys on CONFIG_TASK_FORK rather than the capability symbol.
ARCH_HAVE_TASK_FORK says the architecture can clone a task; TASK_FORK says this
build asked for it, and task_fork() is declared only under the latter, so
gating on the capability alone would fail to compile a TASK_FORK=n build.
TESTING_NAND_SIM depends on the same symbol for the same reason.  vfork_test()
and fork_test() have no such split and key on ARCH_HAVE_VFORK and
ARCH_HAVE_FORK directly.

This must not be merged before the nuttx side.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 14:55:21 +02:00

187 lines
3.9 KiB
Makefile

############################################################################
# apps/testing/ostest/Makefile
#
# 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.
#
############################################################################
include $(APPDIR)/Make.defs
# ostest built-in application info
PROGNAME = ostest
PRIORITY = SCHED_PRIORITY_DEFAULT
STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE)
MODULE = $(CONFIG_TESTING_OSTEST)
# NuttX OS Test
CSRCS = getopt.c libc_memmem.c restart.c sighelper.c
ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y)
CSRCS += sighand.c signest.c
endif
ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
CSRCS += sigprocmask.c
endif
MAINSRC = ostest_main.c
ifeq ($(CONFIG_DEV_NULL),y)
CSRCS += dev_null.c
endif
ifeq ($(CONFIG_SIG_SIGSTOP_ACTION),y)
ifeq ($(CONFIG_SIG_SIGKILL_ACTION),y)
CSRCS += suspend.c
endif
endif
ifeq ($(CONFIG_ARCH_FPU),y)
ifneq ($(CONFIG_TESTING_OSTEST_FPUTESTDISABLE),y)
CSRCS += fpu.c
endif
endif
ifneq ($(CONFIG_STDIO_DISABLE_BUFFERING),y)
CSRCS += setvbuf.c
endif
ifneq ($(CONFIG_TLS_NELEM),0)
CSRCS += tls.c
endif
ifeq ($(CONFIG_SCHED_THREAD_LOCAL),y)
CSRCS += sched_thread_local.c
endif
ifeq ($(CONFIG_TESTING_OSTEST_AIO),y)
CSRCS += aio.c
endif
ifeq ($(CONFIG_TESTING_OSTEST_MULTIUSER),y)
CSRCS += multiuser.c
endif
ifeq ($(CONFIG_SCHED_WAITPID),y)
CSRCS += waitpid.c
endif
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
CSRCS += cancel.c cond.c mutex.c timedmutex.c sem.c semtimed.c barrier.c
CSRCS += timedwait.c pthread_rwlock.c pthread_rwlock_cancel.c schedlock.c
ifeq ($(CONFIG_SCHED_WAITPID),y)
CSRCS += pthread_exit.c
endif
ifneq ($(CONFIG_TLS_NELEM),0)
CSRCS += specific.c
endif
ifneq ($(CONFIG_TLS_NCLEANUP),0)
CSRCS += pthread_cleanup.c
endif
ifneq ($(CONFIG_PTHREAD_MUTEX_UNSAFE),y)
CSRCS += robust.c
endif
ifeq ($(CONFIG_PTHREAD_MUTEX_TYPES),y)
CSRCS += rmutex.c
endif
ifeq ($(CONFIG_FS_NAMED_SEMAPHORES),y)
CSRCS += nsem.c
endif
ifneq ($(CONFIG_RR_INTERVAL),0)
CSRCS += roundrobin.c
endif
ifeq ($(CONFIG_SCHED_SPORADIC),y)
CSRCS += sporadic.c sporadic2.c
endif
ifeq ($(CONFIG_SCHED_WORKQUEUE),y)
CSRCS += wqueue.c
endif
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += prioinherit.c
endif
endif # CONFIG_DISABLE_PTHREAD
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
ifneq ($(CONFIG_DISABLE_PTHREAD),y)
CSRCS += timedmqueue.c
ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
CSRCS += mqueue.c
endif
endif # CONFIG_DISABLE_PTHREAD
endif # CONFIG_DISABLE_MQUEUE
ifneq ($(CONFIG_DISABLE_POSIX_TIMERS),y)
CSRCS += posixtimer.c
ifeq ($(CONFIG_SIG_EVTHREAD),y)
CSRCS += sigev_thread.c
endif
endif
# Each test is built where the primitive it tests exists.
ifeq ($(CONFIG_TASK_FORK),y)
CSRCS += task_fork.c
endif
ifeq ($(CONFIG_ARCH_HAVE_VFORK),y)
CSRCS += vfork.c
endif
ifeq ($(CONFIG_ARCH_HAVE_FORK),y)
CSRCS += fork.c
endif
ifeq ($(CONFIG_ARCH_SETJMP_H),y)
CSRCS += setjmp.c
endif
ifeq ($(CONFIG_SMP),y)
CSRCS += smp_call.c
endif
ifeq ($(CONFIG_SCHED_EVENTS),y)
ifeq ($(CONFIG_BUILD_FLAT),y)
CSRCS += nxevent.c
endif
endif
ifeq ($(CONFIG_ARCH_HAVE_PERF_EVENTS),y)
CSRCS += perf_gettime.c
endif
ifeq ($(CONFIG_BUILD_FLAT),y)
CSRCS += wdog.c spinlock.c
ifeq ($(CONFIG_HRTIMER),y)
CSRCS += hrtimer.c
endif
endif
include $(APPDIR)/Application.mk