Commit 6b3750f7 authored by Marvin Ouma's avatar Marvin Ouma Committed by Benjamin Cabé
Browse files

tests: posix: common: separate xsi realtime passing to standalone test



posix.common contains testsuites that can be separated into smaller
groups of tests. This change moves mqueue into a singular
testsuite at tests/posix/message_passing app directory.

Signed-off-by: default avatarMarvin Ouma <pancakesdeath@protonmail.com>
parent 52b8e3d3
Loading
Loading
Loading
Loading
+0 −69
Original line number Diff line number Diff line
@@ -141,45 +141,6 @@ static int test_file_close(void)
	return res;
}

static int test_file_fsync(void)
{
	int res = 0;

	if (file < 0) {
		return res;
	}

	res = fsync(file);
	if (res < 0) {
		TC_ERROR("Failed to sync file: %d, errno = %d\n", res, errno);
		res = TC_FAIL;
	}

	close(file);
	file = -1;
	return res;
}

#ifdef CONFIG_POSIX_SYNCHRONIZED_IO
static int test_file_fdatasync(void)
{
	int res = 0;

	if (file < 0) {
		return res;
	}

	res = fdatasync(file);
	if (res < 0) {
		TC_ERROR("Failed to sync file: %d, errno = %d\n", res, errno);
		res = TC_FAIL;
	}

	close(file);
	file = -1;
	return res;
}
#endif /* CONFIG_POSIX_SYNCHRONIZED_IO */

static int test_file_truncate(void)
{
@@ -261,36 +222,6 @@ ZTEST(posix_fs_file_test, test_fs_read)
	zassert_true(test_file_read() == TC_PASS);
}

/**
 * @brief Test for POSIX fsync API
 *
 * @details Test sync the file through POSIX fsync API.
 */
ZTEST(posix_fs_file_test, test_fs_sync)
{
	/* FIXME: restructure tests as per #46897 */
	zassert_true(test_file_open() == TC_PASS);
	zassert_true(test_file_write() == TC_PASS);
	zassert_true(test_file_fsync() == TC_PASS);
}

/**
 * @brief Test for POSIX fdatasync API
 *
 * @details Test sync the file through POSIX fdatasync API.
 */
ZTEST(posix_fs_file_test, test_fs_datasync)
{
#ifdef CONFIG_POSIX_SYNCHRONIZED_IO
	/* FIXME: restructure tests as per #46897 */
	zassert_true(test_file_open() == TC_PASS);
	zassert_true(test_file_write() == TC_PASS);
	zassert_true(test_file_fdatasync() == TC_PASS);
#else
	ztest_test_skip();
#endif
}

/**
 * @brief Test for POSIX ftruncate API
 *

tests/posix/shm/prj.conf

deleted100644 → 0
+0 −4
Original line number Diff line number Diff line
CONFIG_ZTEST=y

CONFIG_POSIX_API=y
CONFIG_POSIX_SHARED_MEMORY_OBJECTS=y
+4 −1
Original line number Diff line number Diff line
@@ -2,7 +2,10 @@

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(shm)
project(posix_xsi_realtime)

FILE(GLOB app_sources src/*.c)

target_sources(app PRIVATE ${app_sources})

target_compile_options(app PRIVATE -U_POSIX_C_SOURCE -D_POSIX_C_SOURCE=200809L)
+14 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2023 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/ {
	ramdisk0 {
		compatible = "zephyr,ram-disk";
		disk-name = "RAM";
		sector-size = <512>;
		sector-count = <160>;
	};
};
+15 −0
Original line number Diff line number Diff line
CONFIG_POSIX_API=y
CONFIG_ZTEST=y

CONFIG_POSIX_AEP_CHOICE_BASE=y
CONFIG_XSI_REALTIME=y
CONFIG_FILE_SYSTEM=y
CONFIG_POSIX_FILE_SYSTEM=y

CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_ZTEST_STACK_SIZE=2048

CONFIG_DYNAMIC_THREAD=y
CONFIG_THREAD_STACK_INFO=y
CONFIG_DYNAMIC_THREAD_POOL_SIZE=6
Loading