From 26df08c539a6e92a22d6575f93855da2a3d370d8 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Wed, 19 Aug 2026 08:40:16 +1000 Subject: [PATCH 1/5] Ruby run_all_unit_tests: skip tput without TERM / TTY CI has tput but no TERM, which printed "tput: No value for $TERM and no -T specified". Only invoke tput when TERM is set, stdout is a TTY, and tput works; still honour FG_*/FD_* overrides. 0.4.2. --- .github/workflows/ci.yml | 13 ++++++++-- CHANGES.md | 9 +++++++ NEWS.md | 1 + TODO.md | 1 + VERSION | 2 +- shell-scripts/run_all_unit_tests/README.md | 2 +- .../ruby/run_all_unit_tests.sh | 24 ++++++++++--------- 7 files changed, 37 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fe24b3..6ad0ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ # # Created: 11th August 2026 -# Updated: 11th August 2026 +# Updated: 19th August 2026 # name: CI @@ -49,4 +49,13 @@ jobs: run: shell-scripts/run_all_unit_tests/python/run_all_unit_tests.sh --help - name: Help smoke (Ruby) - run: shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh --help + run: | + set -euo pipefail + err=$(mktemp) + trap 'rm -f "$err"' EXIT + env -u TERM shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh --help 2>"$err" + if grep -q tput "$err"; then + echo "tput invoked without TERM:" >&2 + cat "$err" >&2 + exit 1 + fi diff --git a/CHANGES.md b/CHANGES.md index 851c39c..ac69490 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ ## Table of Contents +- [0.4.2 - 19th August 2026](#042---19th-august-2026) - [0.4.1 - 17th August 2026](#041---17th-august-2026) - [0.4.0 - 16th August 2026](#040---16th-august-2026) - [0.3.0 - 15th August 2026](#030---15th-august-2026) @@ -10,6 +11,14 @@ - [0.1.1 - 11th August 2026](#011---11th-august-2026) +## 0.4.2 - 19th August 2026 + +* **shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh**: + * skip `tput` when `$TERM` is unset or stdout is not a TTY (CI: `tput: No value for $TERM and no -T specified`); + * still honour **`FG_BLUE`**, **`FG_RED`**, **`FD_BOLD`**, **`FD_NONE`** when set; +* **.github/workflows/ci.yml**: Ruby `--help` smoke runs with `TERM` unset and fails if `tput` writes to stderr; + + ## 0.4.1 - 17th August 2026 * **shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh**: diff --git a/NEWS.md b/NEWS.md index fe358a6..7264bfb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ | Date | News Item | | ---------------- | -------------- | +| 19th August 2026 | [0.4.2 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.2) | | 17th August 2026 | [0.4.1 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.1) | | 16th August 2026 | [0.4.0 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.0) | | 15th August 2026 | [0.3.0 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.3.0) | diff --git a/TODO.md b/TODO.md index e1689df..f287cf8 100644 --- a/TODO.md +++ b/TODO.md @@ -35,6 +35,7 @@ * [x] `--separate` must aggregate non-zero exits from per-file runs; * [x] propagate failures from `rbenv versions --bare` instead of treating an empty version list as success; * [x] propagate `find` failures in `--separate` mode instead of succeeding when test discovery fails; +* [x] skip `tput` when `$TERM` is unset or stdout is not a TTY; * [ ] support ranges and wildcards in `.ruby-version-exclusions`; diff --git a/VERSION b/VERSION index 267577d..2b7c5ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.1 +0.4.2 diff --git a/shell-scripts/run_all_unit_tests/README.md b/shell-scripts/run_all_unit_tests/README.md index 6d277e9..af6fb29 100644 --- a/shell-scripts/run_all_unit_tests/README.md +++ b/shell-scripts/run_all_unit_tests/README.md @@ -75,7 +75,7 @@ Use `--help` on the installed script for the authoritative flag list. 4. otherwise probe `python3`, then `python` on `PATH`; with **`--include-python2-in-search`**, also probe `python2`; 5. if neither Python 2 flag is set and only `python2` is present on `PATH`, the script exits with an error suggesting **`--include-python2-in-search`** or **`--assume-python2`**; -**Ruby**: `--rbenv-versions` drives each child with **`RBENV_VERSION`** across `rbenv versions --bare`; optional **.ruby-version-exclusions** skips listed versions; optional **.ruby-version** is reported as “current” in the status line only (not required); +**Ruby**: `--rbenv-versions` drives each child with **`RBENV_VERSION`** across `rbenv versions --bare`; optional **.ruby-version-exclusions** skips listed versions; optional **.ruby-version** is reported as “current” in the status line only (not required); colours use `tput` only when **`$TERM`** is set and stdout is a TTY (override with **`FG_BLUE`**, **`FG_RED`**, **`FD_BOLD`**, **`FD_NONE`**); ## Layout diff --git a/shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh b/shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh index ec53c70..0a05634 100755 --- a/shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh +++ b/shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh @@ -8,7 +8,7 @@ # executing each rbenv version # # Created: 9th June 2011 -# Updated: 17th August 2026 +# Updated: 19th August 2026 # # Copyright (c) Matthew Wilson, 2011-2026 # All rights reserved @@ -58,18 +58,20 @@ Basename="$(basename "$Source")" # colours -if command -v tput > /dev/null; then +SisClr_Blue=${FG_BLUE:-} +SisClr_Red=${FG_RED:-} +SisClr_Bold=${FD_BOLD:-} +SisClr_None=${FD_NONE:-} - SisClr_Blue=${FG_BLUE:-$(tput setaf 4)} - SisClr_Red=${FG_RED:-$(tput setaf 1)} - SisClr_Bold=${FD_BOLD:-$(tput bold)} - SisClr_None=${FD_NONE:-$(tput sgr0)} -else +if [ -n "${TERM:-}" ] && [ -t 1 ] && command -v tput >/dev/null 2>&1; then + + if tput sgr0 >/dev/null 2>&1; then - SisClr_Blue= - SisClr_Red= - SisClr_Bold= - SisClr_None= + SisClr_Blue=${FG_BLUE:-$(tput setaf 4)} + SisClr_Red=${FG_RED:-$(tput setaf 1)} + SisClr_Bold=${FD_BOLD:-$(tput bold)} + SisClr_None=${FD_NONE:-$(tput sgr0)} + fi fi From ba04d355f52831b60a757688c4187db23b66c475 Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 25 Aug 2026 08:02:31 +1000 Subject: [PATCH 2/5] boilerplate --- CHANGES.md | 2 +- NEWS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ac69490..d205d5f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# misc-dev-scripts - CHANGES +# misc-dev-scripts - Changes ## Table of Contents diff --git a/NEWS.md b/NEWS.md index 7264bfb..f20a6b4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# misc-dev-scripts - NEWS +# misc-dev-scripts - News | Date | News Item | From 56ce22943aefe7b4ed87d76238afdf7eaeba4fad Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 25 Aug 2026 08:09:37 +1000 Subject: [PATCH 3/5] release --- CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d205d5f..993aa61 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,7 +3,7 @@ ## Table of Contents -- [0.4.2 - 19th August 2026](#042---19th-august-2026) +- [0.4.2 - 25th August 2026](#042---25th-august-2026) - [0.4.1 - 17th August 2026](#041---17th-august-2026) - [0.4.0 - 16th August 2026](#040---16th-august-2026) - [0.3.0 - 15th August 2026](#030---15th-august-2026) @@ -11,7 +11,7 @@ - [0.1.1 - 11th August 2026](#011---11th-august-2026) -## 0.4.2 - 19th August 2026 +## 0.4.2 - 25th August 2026 * **shell-scripts/run_all_unit_tests/ruby/run_all_unit_tests.sh**: * skip `tput` when `$TERM` is unset or stdout is not a TTY (CI: `tput: No value for $TERM and no -T specified`); From ddd58403db52cef7bd47be0fb033ab8cb6c9e19c Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 25 Aug 2026 08:10:49 +1000 Subject: [PATCH 4/5] release --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index f20a6b4..4857d9b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ | Date | News Item | | ---------------- | -------------- | -| 19th August 2026 | [0.4.2 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.2) | +| 25th August 2026 | [0.4.2 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.2) | | 17th August 2026 | [0.4.1 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.1) | | 16th August 2026 | [0.4.0 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.4.0) | | 15th August 2026 | [0.3.0 released](https://github.com/synesissoftware/misc-dev-scripts/releases/tag/0.3.0) | From baf38d3a713b79cd1def70b41bc5e3f2f500b09f Mon Sep 17 00:00:00 2001 From: Matt Wilson Date: Tue, 25 Aug 2026 08:18:20 +1000 Subject: [PATCH 5/5] TODO --- TODO.md | 2 +- shell-scripts/run_all_unit_tests/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index f287cf8..a50651d 100644 --- a/TODO.md +++ b/TODO.md @@ -48,7 +48,7 @@ * [ ] **Python**: `--separate` (one process per test module); * [ ] **Python**: multi-version matrix (`--pyenv-versions` + exclusions file, or document **tox** / **nox** as preferred and wrap thinly); * [ ] **Ruby**: optional `--suite` / `--pattern` overrides (keep `test/unit/ts_all.rb` and `tc_*.rb` defaults); -* [ ] **Ruby**: optional `bundle exec`; +* [ ] **Ruby**: consider a `--bundle` flag (run via `bundle exec`) so `--rbenv-versions` can resolve **Gemfile** runtime deps on each interpreter (library gems such as **xqsr3-xml** need **nokogiri** / **xqsr3**; bare `ruby` does not load the bundle); * [x] Document environment variables (`PYTHON_CMD_PATH`, `PYTHON_COMMAND_PATH`, …) in the nested script README; ### Modern Python / Ruby runners diff --git a/shell-scripts/run_all_unit_tests/README.md b/shell-scripts/run_all_unit_tests/README.md index af6fb29..34c52cf 100644 --- a/shell-scripts/run_all_unit_tests/README.md +++ b/shell-scripts/run_all_unit_tests/README.md @@ -75,7 +75,7 @@ Use `--help` on the installed script for the authoritative flag list. 4. otherwise probe `python3`, then `python` on `PATH`; with **`--include-python2-in-search`**, also probe `python2`; 5. if neither Python 2 flag is set and only `python2` is present on `PATH`, the script exits with an error suggesting **`--include-python2-in-search`** or **`--assume-python2`**; -**Ruby**: `--rbenv-versions` drives each child with **`RBENV_VERSION`** across `rbenv versions --bare`; optional **.ruby-version-exclusions** skips listed versions; optional **.ruby-version** is reported as “current” in the status line only (not required); colours use `tput` only when **`$TERM`** is set and stdout is a TTY (override with **`FG_BLUE`**, **`FG_RED`**, **`FD_BOLD`**, **`FD_NONE`**); +**Ruby**: `--rbenv-versions` drives each child with **`RBENV_VERSION`** across `rbenv versions --bare`; optional **.ruby-version-exclusions** skips listed versions; optional **.ruby-version** is reported as “current” in the status line only (not required); colours use `tput` only when **`$TERM`** is set and stdout is a TTY (override with **`FG_BLUE`**, **`FG_RED`**, **`FD_BOLD`**, **`FD_NONE`**). ## Layout