release-1.0.0 #39

Merged
ismail merged 78 commits from release-1.0.0 into main 2025-09-13 10:55:49 +02:00
26 changed files with 51 additions and 164 deletions
Showing only changes of commit 0b75df35d1 - Show all commits

View File

@@ -11,12 +11,12 @@ fi
# ==== 2. Valid Modes and Defaults ==== # ==== 2. Valid Modes and Defaults ====
valid_test_tags=("core" "tilt" "listener" "all" "relay_chn" "nvs" "run_limit" "batch") valid_test_tags=("core" "tilt" "listener" "all" "relay_chn" "nvs" "run_limit" "batch")
valid_test_profiles=("run_limit" "tilt" "nvs" "nvs_custom" "multi" "full_single" "full_multi")
arg_tag="all" # Default to 'all' if no tag specified arg_tag="all" # Default to 'all' if no tag specified
arg_profile="full_multi" # Default to 'full_multi' if no profile specified
arg_clean=false arg_clean=false
arg_log=false arg_log=false
arg_dry_run=false arg_dry_run=false
arg_sdkconfig_file=""
flag_file=false
print_help() { print_help() {
echo "Usage: $0 -t <tags> [OPTIONS]" echo "Usage: $0 -t <tags> [OPTIONS]"
@@ -28,6 +28,10 @@ print_help() {
echo "" echo ""
echo " If no tag is specified, it defaults to 'all'." echo " If no tag is specified, it defaults to 'all'."
echo "" echo ""
echo " -p, --profile [run_limit|tilt|nvs|nvs_custom|multi|full_single|full_multi] Specify which test tag to run."
echo ""
echo " If no profile is specified, it defaults to 'full_multi'."
echo ""
echo "Options:" echo "Options:"
echo " -f, --file <path> Specify a custom sdkconfig file to use for the build." echo " -f, --file <path> Specify a custom sdkconfig file to use for the build."
echo " Defaults to 'sdkconfig.defaults' if not provided." echo " Defaults to 'sdkconfig.defaults' if not provided."
@@ -54,9 +58,8 @@ while [[ $# -gt 0 ]]; do
arg_tag="$2" arg_tag="$2"
shift 2 shift 2
;; ;;
--file|-f) --profile|-p)
arg_sdkconfig_file="$2" arg_profile="$2"
flag_file=true
shift 2 shift 2
;; ;;
--clean|-c) --clean|-c)
@@ -86,6 +89,11 @@ if [[ ! " ${valid_test_tags[*]} " =~ " $arg_tag " ]]; then
usage usage
fi fi
if [[ ! " ${valid_test_profiles[*]} " =~ " $arg_profile " ]]; then
echo "❌ Invalid profile: '$arg_profile'"
usage
fi
# ==== 5. Resolve Paths and Switch to Working Directory ==== # ==== 5. Resolve Paths and Switch to Working Directory ====
script_dir=$(dirname "$(readlink -f "$0")") script_dir=$(dirname "$(readlink -f "$0")")
project_root=$(dirname "$script_dir") project_root=$(dirname "$script_dir")
@@ -98,21 +106,9 @@ if [[ -z "$test_apps_dir" || ! -d "$test_apps_dir" ]]; then
echo " Please ensure the script is in a 'scripts' directory and 'test_apps' is a sibling." echo " Please ensure the script is in a 'scripts' directory and 'test_apps' is a sibling."
exit 1 exit 1
fi fi
echo "✅ Found 'test_apps' at: $test_apps_dir" echo "✅ Found 'test_apps' at: $test_apps_dir"
echo "🧪 Test mode: $arg_tag | Profile: $arg_profile"
if $flag_file; then
if [[ -z "$arg_sdkconfig_file" || ! -f "$arg_sdkconfig_file" ]]; then
echo "❌ Invalid or missing file: '$arg_sdkconfig_file'"
usage
fi
# Resolve to an absolute path to work correctly after changing directory
arg_sdkconfig_file=$(readlink -f "$arg_sdkconfig_file")
else
echo "⚠️ No SDK configuration file provided. Using default sdkconfig."
arg_sdkconfig_file="$test_apps_dir/sdkconfig.defaults"
fi
echo "🧪 Test mode: $arg_tag"
echo "🧹 Clean: $arg_clean | 📄 Log: $arg_log" echo "🧹 Clean: $arg_clean | 📄 Log: $arg_log"
echo "📂 Changing to working directory: $test_apps_dir" echo "📂 Changing to working directory: $test_apps_dir"
@@ -129,15 +125,14 @@ fi
# In some locales, we can get errors like: "Error: unknown opcode or format name 'wsr.IBREAKA1'" # In some locales, we can get errors like: "Error: unknown opcode or format name 'wsr.IBREAKA1'"
# The 'LC_ALL=C' env variable is set to ensure consistent locale settings. # The 'LC_ALL=C' env variable is set to ensure consistent locale settings.
LC_ALL=C \ LC_ALL=C \
SDKCONFIG_DEFAULTS="$arg_sdkconfig_file" \
RELAY_CHN_UNITY_TEST_GROUP_TAG="$arg_tag" \ RELAY_CHN_UNITY_TEST_GROUP_TAG="$arg_tag" \
idf.py reconfigure build idf.py @profiles/"${arg_profile}" reconfigure build
echo "🚀 Running test with QEMU..." echo "🚀 Running test with QEMU..."
if $arg_log; then if $arg_log; then
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
LOGFILE="test_log_${arg_tag}_$TIMESTAMP.txt" LOGFILE="test_log_${arg_profile}_${arg_tag}_$TIMESTAMP.txt"
if $arg_dry_run; then if $arg_dry_run; then
echo "🔍 Dry run mode: Logging to $LOGFILE but not executing." | tee "$LOGFILE" echo "🔍 Dry run mode: Logging to $LOGFILE but not executing." | tee "$LOGFILE"
echo "Command: idf.py qemu" | tee "$LOGFILE" echo "Command: idf.py qemu" | tee "$LOGFILE"

View File

@@ -18,13 +18,16 @@ echo "🔍 Searching for 'test_apps' directory in '$project_root'..."
test_apps_dir=$(find "$project_root" -type d -name "test_apps" | head -n 1) test_apps_dir=$(find "$project_root" -type d -name "test_apps" | head -n 1)
echo "test_apps dir: ${test_apps_dir}" echo "test_apps dir: ${test_apps_dir}"
# Execute tests for all configs # Execute tests for all profiles
mapfile -t sdkcfg_files < <(find "$test_apps_dir" -maxdepth 1 -type f -name "sdkconfig.defaults*") mapfile -t profiles < <(find "${test_apps_dir}/profiles" -maxdepth 1 -type f)
for sdkcfg_file in "${sdkcfg_files[@]}"; do for profile in "${profiles[@]}"; do
echo "🔧 Running tests with config: $sdkcfg_file" # Get only the name of the profile file
"${script_dir}"/run_tests.sh -c -f "$sdkcfg_file" -t "$arg_tag" || { profile=$(basename "${profile}")
echo "❌ Tests failed with config: $sdkcfg_file"
echo "🔧 Running tests with profile: $profile"
"${script_dir}"/run_tests.sh -c -p "$profile" -t "$arg_tag" || {
echo "❌ Tests failed with profile: $profile"
exit 1 exit 1
} }
done done

View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.multi;sdkconfig.defaults.run_limit;sdkconfig.defaults.tilt;sdkconfig.defaults.nvs;sdkconfig.defaults.nvs_custom"

View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.run_limit;sdkconfig.defaults.tilt;sdkconfig.defaults.nvs;sdkconfig.defaults.nvs_custom"

1
test_apps/profiles/multi Normal file
View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.multi"

1
test_apps/profiles/nvs Normal file
View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.nvs"

View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.nvs;sdkconfig.defaults.nvs_custom"

View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.run_limit"

1
test_apps/profiles/tilt Normal file
View File

@@ -0,0 +1 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.tilt"

View File

@@ -395,13 +395,13 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
# #
# Partition Table # Partition Table
# #
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set CONFIG_PARTITION_TABLE_SINGLE_APP=y
# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set
# CONFIG_PARTITION_TABLE_TWO_OTA is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set
# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set
CONFIG_PARTITION_TABLE_CUSTOM=y # CONFIG_PARTITION_TABLE_CUSTOM is not set
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv" CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions/part_nvs.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table # end of Partition Table
@@ -1261,26 +1261,10 @@ CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
# #
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200 CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8 CONFIG_RELAY_CHN_COUNT=8
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y # CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT is not set
CONFIG_RELAY_CHN_ENABLE_TILTING=y # CONFIG_RELAY_CHN_ENABLE_TILTING is not set
CONFIG_RELAY_CHN_ENABLE_NVS=y # CONFIG_RELAY_CHN_ENABLE_NVS is not set
# end of Relay Channel Driver Configuration # end of Relay Channel Driver Configuration
#
# Relay Channel NVS Storage Configuration
#
CONFIG_RELAY_CHN_NVS_NAMESPACE="relay_chn"
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION=y
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION_NAME="app_data"
# end of Relay Channel NVS Storage Configuration
#
# Relay Channel Run Limit Configuration
#
CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC=1
CONFIG_RELAY_CHN_RUN_LIMIT_MAX_SEC=600
CONFIG_RELAY_CHN_RUN_LIMIT_DEFAULT_SEC=60
# end of Relay Channel Run Limit Configuration
# end of Component config # end of Component config
# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set # CONFIG_IDF_EXPERIMENTAL_FEATURES is not set

View File

@@ -1,7 +1 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8 CONFIG_RELAY_CHN_COUNT=8

View File

@@ -1,14 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Partition configuration
CONFIG_PARTITION_TABLE_SINGLE_APP=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv"
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8
CONFIG_RELAY_CHN_ENABLE_NVS=y
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION=y

View File

@@ -1,17 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Partition configuration
CONFIG_PARTITION_TABLE_SINGLE_APP=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv"
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y
CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC=1
CONFIG_RELAY_CHN_ENABLE_TILTING=y
CONFIG_RELAY_CHN_ENABLE_NVS=y
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION=y

View File

@@ -1,8 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8
CONFIG_RELAY_CHN_ENABLE_NVS=y

View File

@@ -1,9 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y
CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC=1

View File

@@ -1,8 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_COUNT=8
CONFIG_RELAY_CHN_ENABLE_TILTING=y

View File

@@ -0,0 +1 @@
CONFIG_RELAY_CHN_ENABLE_NVS=y

View File

@@ -0,0 +1,6 @@
# Partition configuration
CONFIG_PARTITION_TABLE_SINGLE_APP=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv"
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION=y

View File

@@ -0,0 +1,3 @@
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC=1

View File

@@ -1,13 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Partition configuration
CONFIG_PARTITION_TABLE_SINGLE_APP=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv"
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_ENABLE_NVS=y
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION=y

View File

@@ -1,16 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Partition configuration
CONFIG_PARTITION_TABLE_SINGLE_APP=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv"
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y
CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC=1
CONFIG_RELAY_CHN_ENABLE_TILTING=y
CONFIG_RELAY_CHN_ENABLE_NVS=y
CONFIG_RELAY_CHN_NVS_CUSTOM_PARTITION=y

View File

@@ -1,7 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_ENABLE_NVS=y

View File

@@ -1,8 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y
CONFIG_RELAY_CHN_RUN_LIMIT_MIN_SEC=1

View File

@@ -1,7 +0,0 @@
# Disable task WDT for tests
CONFIG_ESP_TASK_WDT_INIT=n
# Relay Channel Driver Default Configuration for Testing
# Keep this as short as possible for tests
CONFIG_RELAY_CHN_OPPOSITE_INERTIA_MS=200
CONFIG_RELAY_CHN_ENABLE_TILTING=y

View File

@@ -0,0 +1 @@
CONFIG_RELAY_CHN_ENABLE_TILTING=y