Update test_build_components (#7597)

Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
tomaszduda23 2024-10-14 03:31:37 +02:00 committed by GitHub
parent 5bc5a9dcb6
commit 312799babf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,15 @@
set -e set -e
help() {
echo "Usage: $0 [-e <config|compile|clean>] [-c <string>] [-t <string>]" 1>&2
echo 1>&2
echo " - e - Parameter for esphome command. Default compile. Common alternative is config." 1>&2
echo " - c - Component folder name to test. Default *. E.g. '-c logger'." 1>&2
echo " - t - Target name to test. Put '-t list' to display all possibilities. E.g. '-t esp32-s2-idf-51'." 1>&2
exit 1
}
# Parse parameter: # Parse parameter:
# - `e` - Parameter for `esphome` command. Default `compile`. Common alternative is `config`. # - `e` - Parameter for `esphome` command. Default `compile`. Common alternative is `config`.
# - `c` - Component folder name to test. Default `*`. # - `c` - Component folder name to test. Default `*`.
@ -13,7 +22,7 @@ do
e) esphome_command=${OPTARG};; e) esphome_command=${OPTARG};;
c) target_component=${OPTARG};; c) target_component=${OPTARG};;
t) requested_target_platform=${OPTARG};; t) requested_target_platform=${OPTARG};;
\?) echo "Usage: $0 [-e <config|compile|clean>] [-c <string>] [-t <string>]" 1>&2; exit 1;; \?) help;;
esac esac
done done
@ -24,8 +33,8 @@ if ! [ -d "./tests/test_build_components/build" ]; then
fi fi
start_esphome() { start_esphome() {
if [ -n "$requested_target_platform" ] && [ "$requested_target_platform" != "$target_platform" ]; then if [ -n "$requested_target_platform" ] && [ "$requested_target_platform" != "$target_platform_with_version" ]; then
echo "Skiping $target_platform" echo "Skipping $target_platform_with_version"
return return
fi fi
# create dynamic yaml file in `build` folder. # create dynamic yaml file in `build` folder.