Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ports/win32/vs_2019/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Portions of this file were generated with AI assistance.

target_sources(${PROJECT_NAME} PRIVATE
# {{BEGIN_TARGET_SOURCES}}

# {{END_TARGET_SOURCES}}
)

target_include_directories(${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/inc
)
197 changes: 180 additions & 17 deletions ports/win32/vs_2019/inc/fx_port.h

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion scripts/build_fx.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Portions of this file were generated with AI assistance.

[CmdletBinding()]
param(
[ValidateSet('win64', 'win32')]
Expand Down Expand Up @@ -28,7 +30,7 @@ if (-not $BuildDir) {
}

if (-not $ThreadXDir) {
$ThreadXDir = Join-Path (Split-Path -Parent $repoRoot) 'threadx-fd-codex'
$ThreadXDir = Join-Path (Split-Path -Parent $repoRoot) 'threadx-fd'
}

$selectedConfigurations = Resolve-RegressionConfigurations -RequestedConfigurations $Configuration
Expand Down
10 changes: 9 additions & 1 deletion test/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Portions of this file were generated with AI assistance.

cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0057 NEW)
Expand Down Expand Up @@ -51,7 +53,13 @@ set(standalone_no_cache_fault_tolerant_build ${no_cache_build} ${FX_FAULT_TOLERA

if(MSVC)
add_compile_options(/W3 /Zi)
add_link_options(/DEBUG /INCREMENTAL:NO)
# /LARGEADDRESSAWARE lets the 32-bit (win32) test executables use the full
# 4 GB user address space available to a 32-bit process on 64-bit Windows,
# instead of the default 2 GB. The large-media regression tests allocate
# ~1.7 GB of RAM-disk + data buffers (e.g. filex_file_allocate_test), which
# overflows the 2 GB limit and makes calloc return NULL -> crash. This flag
# is the default for x64, so it is a no-op for the win64 build.
add_link_options(/DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE)
# Both cl.exe and gcc accept -DFOO; use it to keep the per-configuration
# definitions consistent with the Linux path.
add_compile_options(-DFX_REGRESSION_TEST ${${CMAKE_BUILD_TYPE}})
Expand Down
18 changes: 15 additions & 3 deletions test/cmake/regression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,21 @@ endif()

foreach(test_case ${regression_test_cases})
get_filename_component(test_name ${test_case} NAME_WE)
add_executable(${test_name} ${test_case})
target_link_libraries(${test_name} PRIVATE test_utility)
add_test(${CMAKE_BUILD_TYPE}::${test_name} ${test_name})
if(MSVC)
# CMake repeats the target name in its object directory. Several descriptive
# FileX test names otherwise exceed the legacy path limit used by cl.exe in a
# normally nested Windows worktree.
string(MD5 test_target_hash ${test_name})
string(SUBSTRING ${test_target_hash} 0 12 test_target_hash)
set(test_target fx_test_${test_target_hash})
else()
set(test_target ${test_name})
endif()

add_executable(${test_target} ${test_case})
target_link_libraries(${test_target} PRIVATE test_utility)
set_target_properties(${test_target} PROPERTIES OUTPUT_NAME ${test_name})
add_test(NAME ${CMAKE_BUILD_TYPE}::${test_name} COMMAND ${test_target})
endforeach()

# These two tests write or corrupt large amounts of data on a 900 MB RAM disk and are
Expand Down
5 changes: 4 additions & 1 deletion test/regression_test/filex_directory_create_delete_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* SPDX-License-Identifier: MIT */
/***************************************************************************/

// Portions of this file were generated with AI assistance.

/* This FileX test concentrates on the basic directory create/delete operations. */

#ifndef FX_STANDALONE_ENABLE
Expand Down Expand Up @@ -111,8 +113,10 @@ static UCHAR *cache_buffer;
static UCHAR *fault_tolerant_buffer;
#else
static UCHAR cache_buffer[CACHE_SIZE];
#ifdef FX_ENABLE_FAULT_TOLERANT
static UCHAR fault_tolerant_buffer[FAULT_TOLERANT_SIZE];
#endif
#endif


extern ULONG _fx_ram_driver_copy_default_format;
Expand Down Expand Up @@ -3064,4 +3068,3 @@ FX_DIR_ENTRY search_directory;
test_control_return(0);
}
}

4 changes: 4 additions & 0 deletions test/regression_test/filex_directory_duplicate_entries_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* SPDX-License-Identifier: MIT */
/***************************************************************************/

// Portions of this file were generated with AI assistance.

/* This FileX test concentrates on recovery operation when there are duplicate entries. */

#ifndef FX_STANDALONE_ENABLE
Expand Down Expand Up @@ -49,8 +51,10 @@ static UCHAR *cache_buffer;
static UCHAR *fault_tolerant_buffer;
#else
static UCHAR cache_buffer[CACHE_SIZE];
#ifdef FX_ENABLE_FAULT_TOLERANT
static UCHAR fault_tolerant_buffer[FAULT_TOLERANT_SIZE];
#endif
#endif

extern ULONG _fx_ram_driver_copy_default_format;

Expand Down
4 changes: 4 additions & 0 deletions test/regression_test/filex_directory_rename_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* SPDX-License-Identifier: MIT */
/***************************************************************************/

// Portions of this file were generated with AI assistance.

/* This FileX test concentrates on the directory rename operations. */

#ifndef FX_STANDALONE_ENABLE
Expand Down Expand Up @@ -47,8 +49,10 @@ static UCHAR *cache_buffer;
static UCHAR *fault_tolerant_buffer;
#else
static UCHAR cache_buffer[CACHE_SIZE];
#ifdef FX_ENABLE_FAULT_TOLERANT
static UCHAR fault_tolerant_buffer[FAULT_TOLERANT_SIZE];
#endif
#endif


/* Define thread prototypes. */
Expand Down
4 changes: 4 additions & 0 deletions test/regression_test/filex_file_create_delete_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* SPDX-License-Identifier: MIT */
/***************************************************************************/

// Portions of this file were generated with AI assistance.

/* This FileX test concentrates on the file create/delete operations. */

#ifndef FX_STANDALONE_ENABLE
Expand Down Expand Up @@ -54,8 +56,10 @@ static UCHAR *cache_buffer;
static UCHAR *fault_tolerant_buffer;
#else
static UCHAR cache_buffer[CACHE_SIZE];
#ifdef FX_ENABLE_FAULT_TOLERANT
static UCHAR fault_tolerant_buffer[FAULT_TOLERANT_SIZE];
#endif
#endif
static UCHAR fat_buffer[128];
static UCHAR name_buffer[FX_MAX_LONG_NAME_LEN+1];

Expand Down
4 changes: 4 additions & 0 deletions test/regression_test/filex_file_rename_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* SPDX-License-Identifier: MIT */
/***************************************************************************/

// Portions of this file were generated with AI assistance.

/* This FileX test concentrates on the file rename operations. */

#ifndef FX_STANDALONE_ENABLE
Expand Down Expand Up @@ -46,8 +48,10 @@ static UCHAR *cache_buffer;
static UCHAR *fault_tolerant_buffer;
#else
static UCHAR cache_buffer[CACHE_SIZE];
#ifdef FX_ENABLE_FAULT_TOLERANT
static UCHAR fault_tolerant_buffer[FAULT_TOLERANT_SIZE];
#endif
#endif


/* Define thread prototypes. */
Expand Down
15 changes: 15 additions & 0 deletions test/regression_test/fx_ram_driver_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
/* SPDX-License-Identifier: MIT */
/***************************************************************************/

// Portions of this file were generated with AI assistance.

#ifndef _FX_RAM_DRIVER_TEST_H_
#define _FX_RAM_DRIVER_TEST_H_

Expand All @@ -24,15 +26,28 @@


/* Define the memory buffer to format the media if enable fault tolerant feature.*/
/* On MSVC these are heap-allocated (see fx_ram_driver_test.c) to avoid committing
huge BSS arrays and exceeding the 2 GB PE image limit, so declare them as
pointers there; other compilers keep them as BSS arrays. */
#ifdef _MSC_VER
extern UCHAR *ram_disk_memory_large;
extern UCHAR *large_data_buffer;
#else
extern UCHAR ram_disk_memory_large[900000000];
extern UCHAR large_data_buffer[900000000];
#endif
#define large_data_buffer_size 900000000

/* Define memory for tests to be run in standalone mode (without Azure RTOS: ThreadX) */
#ifdef FX_STANDALONE_ENABLE
#ifdef _MSC_VER
extern UCHAR *ram_disk_memory;
extern UCHAR *ram_disk_memory1;
#else
extern UCHAR ram_disk_memory[300000000];
extern UCHAR ram_disk_memory1[30000000];
#endif
#endif

/* Define a macro for test. */
/* We do not need error code anymore but still define return_value_if_fail for compatibility backward. */
Expand Down