Skip to content

gmtest: don't require execute permission on test scripts - #9135

Merged
Esteban82 merged 1 commit into
masterfrom
fix-gmtest-exec-check
Aug 22, 2026
Merged

gmtest: don't require execute permission on test scripts#9135
Esteban82 merged 1 commit into
masterfrom
fix-gmtest-exec-check

Conversation

@Esteban82

Copy link
Copy Markdown
Member

Follow-up to #9133. Removing the executable bit from test/example scripts made every test fail, because test/gmtest.in explicitly checked for it:

if! [ -x"${script}" ];thenecho"error: cannot execute script ${script}.">&2exit 1
fi

Test scripts are sourced (. "${local_script}"), not executed, so this check was never actually needed — it only requires read permission. Relaxed it to -r.

@seisman also suggested changing the sourcing itself to bash "${local_script}". I kept . (source) instead: switching to bash runs the script in a subshell, so a classic-mode script's ps=... variable (used afterwards for the baseline image comparison) would no longer propagate back into gmtest.sh, breaking every classic-mode test.

Closes#9048

Assisted-by: Claude Sonnet 5 (High effort)

Test scripts are sourced (". ${local_script}"), not executed, so the
existing "if ! [ -x "${script}" ]" guard was checking the wrong bit.
It started failing every test once #9133 removed the unnecessary
executable permission from *.sh scripts. Relax the guard to check
readability instead.
Note: switching the sourcing itself (". ${local_script}") to
"bash ${local_script}" was also proposed, but that would run the test
script in a subshell instead of gmtest.sh's own shell, breaking the
"ps=" variable classic-mode scripts set for later baseline comparison
(it wouldn't propagate back). Sourcing is kept as-is since it never
required execute permission in the first place.
Related to #9048, #9133
Assisted-by: Claude Sonnet 5 (High effort)

@seismanseisman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@Esteban82Esteban82 added the AI-assisted All (or most) of the code was written by Artificial Intelligence. label Aug 22, 2026
@Esteban82
Esteban82 merged commit c78943d into masterAug 22, 2026
2 of 5 checks passed
@Esteban82
Esteban82 deleted the fix-gmtest-exec-check branch August 22, 2026 15:03
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-assistedAll (or most) of the code was written by Artificial Intelligence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove unnecessary executable permissions from Bash example and test scripts

2 participants

@Esteban82@seisman