release-1.0.0 #39
@@ -11,12 +11,12 @@ fi
|
||||
|
||||
# ==== 2. Valid Modes and Defaults ====
|
||||
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_profile="full_multi" # Default to 'full_multi' if no profile specified
|
||||
arg_clean=false
|
||||
arg_log=false
|
||||
arg_dry_run=false
|
||||
arg_sdkconfig_file=""
|
||||
flag_file=false
|
||||
|
||||
print_help() {
|
||||
echo "Usage: $0 -t <tags> [OPTIONS]"
|
||||
@@ -28,6 +28,10 @@ print_help() {
|
||||
echo ""
|
||||
echo " If no tag is specified, it defaults to 'all'."
|
||||
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 " -f, --file <path> Specify a custom sdkconfig file to use for the build."
|
||||
echo " Defaults to 'sdkconfig.defaults' if not provided."
|
||||
@@ -54,9 +58,8 @@ while [[ $# -gt 0 ]]; do
|
||||
arg_tag="$2"
|
||||
shift 2
|
||||
;;
|
||||
--file|-f)
|
||||
arg_sdkconfig_file="$2"
|
||||
flag_file=true
|
||||
--profile|-p)
|
||||
arg_profile="$2"
|
||||
shift 2
|
||||
;;
|
||||
--clean|-c)
|
||||
@@ -86,6 +89,11 @@ if [[ ! " ${valid_test_tags[*]} " =~ " $arg_tag " ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [[ ! " ${valid_test_profiles[*]} " =~ " $arg_profile " ]]; then
|
||||
echo "❌ Invalid profile: '$arg_profile'"
|
||||
usage
|
||||
fi
|
||||
|
||||
# ==== 5. Resolve Paths and Switch to Working Directory ====
|
||||
script_dir=$(dirname "$(readlink -f "$0")")
|
||||
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."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Found 'test_apps' at: $test_apps_dir"
|
||||
|
||||
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 "🧪 Test mode: $arg_tag | Profile: $arg_profile"
|
||||
echo "🧹 Clean: $arg_clean | 📄 Log: $arg_log"
|
||||
|
||||
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'"
|
||||
# The 'LC_ALL=C' env variable is set to ensure consistent locale settings.
|
||||
LC_ALL=C \
|
||||
SDKCONFIG_DEFAULTS="$arg_sdkconfig_file" \
|
||||
RELAY_CHN_UNITY_TEST_GROUP_TAG="$arg_tag" \
|
||||
idf.py reconfigure build
|
||||
idf.py @profiles/"${arg_profile}" reconfigure build
|
||||
|
||||
echo "🚀 Running test with QEMU..."
|
||||
|
||||
if $arg_log; then
|
||||
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
|
||||
echo "🔍 Dry run mode: Logging to $LOGFILE but not executing." | tee "$LOGFILE"
|
||||
echo "Command: idf.py qemu" | tee "$LOGFILE"
|
||||
|
||||
@@ -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)
|
||||
echo "test_apps dir: ${test_apps_dir}"
|
||||
|
||||
# Execute tests for all configs
|
||||
mapfile -t sdkcfg_files < <(find "$test_apps_dir" -maxdepth 1 -type f -name "sdkconfig.defaults*")
|
||||
# Execute tests for all profiles
|
||||
mapfile -t profiles < <(find "${test_apps_dir}/profiles" -maxdepth 1 -type f)
|
||||
|
||||
for sdkcfg_file in "${sdkcfg_files[@]}"; do
|
||||
echo "🔧 Running tests with config: $sdkcfg_file"
|
||||
"${script_dir}"/run_tests.sh -c -f "$sdkcfg_file" -t "$arg_tag" || {
|
||||
echo "❌ Tests failed with config: $sdkcfg_file"
|
||||
for profile in "${profiles[@]}"; do
|
||||
# Get only the name of the profile file
|
||||
profile=$(basename "${profile}")
|
||||
|
||||
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
|
||||
}
|
||||
done
|
||||
1
test_apps/profiles/full_multi
Normal file
1
test_apps/profiles/full_multi
Normal 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"
|
||||
1
test_apps/profiles/full_single
Normal file
1
test_apps/profiles/full_single
Normal 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
1
test_apps/profiles/multi
Normal file
@@ -0,0 +1 @@
|
||||
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.multi"
|
||||
1
test_apps/profiles/nvs
Normal file
1
test_apps/profiles/nvs
Normal file
@@ -0,0 +1 @@
|
||||
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.nvs"
|
||||
1
test_apps/profiles/nvs_custom
Normal file
1
test_apps/profiles/nvs_custom
Normal file
@@ -0,0 +1 @@
|
||||
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.nvs;sdkconfig.defaults.nvs_custom"
|
||||
1
test_apps/profiles/run_limit
Normal file
1
test_apps/profiles/run_limit
Normal file
@@ -0,0 +1 @@
|
||||
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.run_limit"
|
||||
1
test_apps/profiles/tilt
Normal file
1
test_apps/profiles/tilt
Normal file
@@ -0,0 +1 @@
|
||||
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.tilt"
|
||||
@@ -395,13 +395,13 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
|
||||
#
|
||||
# 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_TWO_OTA is not set
|
||||
# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set
|
||||
CONFIG_PARTITION_TABLE_CUSTOM=y
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions/part_nvs.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions/part_nvs.csv"
|
||||
# CONFIG_PARTITION_TABLE_CUSTOM is not set
|
||||
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
||||
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
|
||||
CONFIG_PARTITION_TABLE_OFFSET=0x8000
|
||||
CONFIG_PARTITION_TABLE_MD5=y
|
||||
# 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_COUNT=8
|
||||
CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT=y
|
||||
CONFIG_RELAY_CHN_ENABLE_TILTING=y
|
||||
CONFIG_RELAY_CHN_ENABLE_NVS=y
|
||||
# CONFIG_RELAY_CHN_ENABLE_RUN_LIMIT is not set
|
||||
# CONFIG_RELAY_CHN_ENABLE_TILTING is not set
|
||||
# CONFIG_RELAY_CHN_ENABLE_NVS is not set
|
||||
# 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
|
||||
|
||||
# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
1
test_apps/sdkconfig.defaults.nvs
Normal file
1
test_apps/sdkconfig.defaults.nvs
Normal file
@@ -0,0 +1 @@
|
||||
CONFIG_RELAY_CHN_ENABLE_NVS=y
|
||||
6
test_apps/sdkconfig.defaults.nvs_custom
Normal file
6
test_apps/sdkconfig.defaults.nvs_custom
Normal 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
|
||||
3
test_apps/sdkconfig.defaults.run_limit
Normal file
3
test_apps/sdkconfig.defaults.run_limit
Normal 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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
1
test_apps/sdkconfig.defaults.tilt
Normal file
1
test_apps/sdkconfig.defaults.tilt
Normal file
@@ -0,0 +1 @@
|
||||
CONFIG_RELAY_CHN_ENABLE_TILTING=y
|
||||
Reference in New Issue
Block a user