File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
2- # This test exercises the Tcl HAL extensions (tcl/hal.so,
3- # tcl/linuxcnc.so), which are only built in GUI builds (BUILD_GUI);
4- # skip in headless builds . The tcl dir is taken from TCLLIBPATH
5- # (exported by rip-environment) .
2+ # This test needs the Tcl HAL extensions, only built in GUI builds.
3+ # Ask tclsh to load them like the test does; works for run-in-place
4+ # (TCLLIBPATH) and installed packages (auto_path) . catch is needed
5+ # because tclsh reads stdin interactively and exits 0 even on error .
66set -u
77
88if ! command -v tclsh > /dev/null 2>&1 ; then
99 echo " skip: tclsh not installed" >&2
1010 exit 1
1111fi
1212
13- read -r tcldir _ <<< " ${TCLLIBPATH:-} "
14- if ! [ -f " ${tcldir :-/ nonexistent} /linuxcnc.so " ] ; then
13+ if ! echo ' exit [catch {package require Linuxcnc
14+ package require Hal}] ' | tclsh > /dev/null 2>&1 ; then
1515 echo " skip: Tcl HAL extensions not built (headless build)" >&2
1616 exit 1
1717fi
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # haltcl needs the Tcl HAL extension (tcl/hal.so), which is only built
3- # in GUI builds (BUILD_GUI); skip in headless builds. The tcl dir is
4- # taken from TCLLIBPATH (exported by rip-environment).
2+ # haltcl needs the Tcl HAL extension, only built in GUI builds. Ask
3+ # tclsh to load it like the test does; works for run-in-place
4+ # (TCLLIBPATH) and installed packages (auto_path). catch is needed
5+ # because tclsh reads stdin interactively and exits 0 even on error.
56set -u
67
78if ! command -v tclsh > /dev/null 2>&1 ; then
89 echo " skip: tclsh not installed" >&2
910 exit 1
1011fi
1112
12- read -r tcldir _ <<< " ${TCLLIBPATH:-}"
13- if ! [ -f " ${tcldir:-/ nonexistent} /hal.so" ]; then
13+ if ! echo ' exit [catch {package require Hal}]' | tclsh > /dev/null 2>&1 ; then
1414 echo " skip: Tcl HAL extension not built (headless build)" >&2
1515 exit 1
1616fi
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # haltcl needs the Tcl HAL extension (tcl/hal.so), which is only built
3- # in GUI builds (BUILD_GUI); skip in headless builds. The tcl dir is
4- # taken from TCLLIBPATH (exported by rip-environment).
2+ # haltcl needs the Tcl HAL extension, only built in GUI builds. Ask
3+ # tclsh to load it like the test does; works for run-in-place
4+ # (TCLLIBPATH) and installed packages (auto_path). catch is needed
5+ # because tclsh reads stdin interactively and exits 0 even on error.
56set -u
67
78if ! command -v tclsh > /dev/null 2>&1 ; then
89 echo " skip: tclsh not installed" >&2
910 exit 1
1011fi
1112
12- read -r tcldir _ <<< " ${TCLLIBPATH:-}"
13- if ! [ -f " ${tcldir:-/ nonexistent} /hal.so" ]; then
13+ if ! echo ' exit [catch {package require Hal}]' | tclsh > /dev/null 2>&1 ; then
1414 echo " skip: Tcl HAL extension not built (headless build)" >&2
1515 exit 1
1616fi
You can’t perform that action at this time.
0 commit comments