diff --git a/tests/unit/test-deploy-refactor.sh b/tests/unit/test-deploy-refactor.sh index 4331787..dcec8e7 100644 --- a/tests/unit/test-deploy-refactor.sh +++ b/tests/unit/test-deploy-refactor.sh @@ -201,7 +201,7 @@ EOF done KIT_MDM_MANAGED=false _build_tmp="$(mktemp -d)" - build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1 + build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1 || exit 1 jq -e 'any(.hooks.SessionStart[]?.hooks[]?.command?; contains("feature-recommendation/check-pending.sh"))' \ "$_build_tmp/settings.json" >/dev/null @@ -221,7 +221,7 @@ EOF done KIT_MDM_MANAGED=true _build_tmp="$(mktemp -d)" - build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1 + build_settings_file "$_build_tmp/settings.json" >/dev/null 2>&1 || exit 1 ! jq -e 'any(.hooks.SessionStart[]?.hooks[]?.command?; contains("feature-recommendation/check-pending.sh"))' \ "$_build_tmp/settings.json" >/dev/null diff --git a/tests/unit/test-ghostty.sh b/tests/unit/test-ghostty.sh index 729ae93..ec9fb21 100644 --- a/tests/unit/test-ghostty.sh +++ b/tests/unit/test-ghostty.sh @@ -80,7 +80,7 @@ _ghostty_test_make_app() { mkdir -p "$_app/Contents/MacOS" printf 'outside' > "$_tmpdir/ghostty" chmod +x "$_tmpdir/ghostty" - ln -s "$_tmpdir/ghostty" "$_app/Contents/MacOS/ghostty" + ln -s "$_tmpdir/ghostty" "$_app/Contents/MacOS/ghostty" || exit 1 _codesign_called=0 _ghostty_codesign() { _codesign_called=1; return 0; } ! ghostty_mdm_is_trusted "$_app" \ @@ -97,7 +97,7 @@ _ghostty_test_make_app() { if ( _tmpdir="$(mktemp -d)" _app="$_tmpdir/Ghostty.app" - _ghostty_test_make_app "$_app" + _ghostty_test_make_app "$_app" || exit 1 _ghostty_codesign() { return 1; } ! ghostty_mdm_is_trusted "$_app" ); then @@ -262,7 +262,7 @@ _ghostty_test_make_app() { mkdir -p "$_config_dir" printf 'old\n' > "$_config" printf 'new\n' > "$_template" - deploy_ghostty_config "$_template" >/dev/null 2>&1 + deploy_ghostty_config "$_template" >/dev/null 2>&1 || exit 1 _backups=("$_config".backup.*) [[ "$(cat "$_config")" == new && ! -e "${_backups[0]}" ]] ); then @@ -288,7 +288,7 @@ _ghostty_test_make_app() { printf 'old\n' > "$_config" printf 'new\n' > "$_template" date() { printf '%s' 20000101000000; } - deploy_ghostty_config "$_template" >/dev/null 2>&1 + deploy_ghostty_config "$_template" >/dev/null 2>&1 || exit 1 [[ "$(cat "$_config")" == new \ && "$(cat "$_config.backup.20000101000000")" == old ]] ); then @@ -313,7 +313,7 @@ _ghostty_test_make_app() { printf 'old\n' > "$_config" printf 'new\n' > "$_template" date() { printf '%s' 20000101000000; } - deploy_ghostty_config "$_template" >/dev/null 2>&1 + deploy_ghostty_config "$_template" >/dev/null 2>&1 || exit 1 [[ "$(cat "$_config")" == new \ && "$(cat "$_config.backup.20000101000000")" == old ]] ); then diff --git a/tests/unit/test-mdm-install.sh b/tests/unit/test-mdm-install.sh index 02e3d09..d2f3596 100644 --- a/tests/unit/test-mdm-install.sh +++ b/tests/unit/test-mdm-install.sh @@ -2096,7 +2096,7 @@ fi /bin/sleep 0.01 _attempt=$((_attempt + 1)) done - [[ -e "$_ready" && "$_actual_pgid" == "$_leader" ]] + [[ -e "$_ready" && "$_actual_pgid" == "$_leader" ]] || exit 1 /bin/kill -STOP -- "-$_leader" _attempt=0 while ! _mdm_launcher_group_quiesced "$_leader" \ @@ -2108,14 +2108,14 @@ fi _member_count="$(printf '%s\n' "$_listing" \ | /usr/bin/awk -v pgid="$_leader" '$1 == pgid { count++ } END { print count + 0 }')" - [[ "$_member_count" -ge 2 ]] - _mdm_launcher_group_quiesced "$_leader" + [[ "$_member_count" -ge 2 ]] || exit 1 + _mdm_launcher_group_quiesced "$_leader" || exit 1 exec 2>/dev/null /bin/kill -KILL -- "-$_leader" 2>/dev/null || true _mdm_launcher_wait_child_bounded "$_leader" 100 || true _state=0 _mdm_launcher_group_state "$_leader" || _state=$? - [[ "$_state" -eq 1 ]] + [[ "$_state" -eq 1 ]] || exit 1 _leader="" trap - EXIT ) > "$_diagnostic" 2>&1 || _rc=$? @@ -2145,7 +2145,7 @@ fi LC_ALL=C /bin/ps -p "$_quick_pid" -o pgid= 2>/dev/null || true )" _actual_pgid="${_actual_pgid//[[:space:]]/}" - [[ -z "$_actual_pgid" || "$_actual_pgid" == "$_quick_pgid" ]] + [[ -z "$_actual_pgid" || "$_actual_pgid" == "$_quick_pgid" ]] || exit 1 wait "$_quick_pid" _quick_pid="" _quick_pgid="" _quick_starting=0 _attempt=$((_attempt + 1))