File: test.sh

package info (click to toggle)
linuxcnc 1%3A2.9.7-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 285,604 kB
  • sloc: python: 202,568; ansic: 109,036; cpp: 99,239; tcl: 16,054; xml: 10,631; sh: 10,303; makefile: 1,255; javascript: 138; sql: 72; asm: 15
file content (35 lines) | stat: -rwxr-xr-x 1,117 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -e

${SUDO} halcompile --personalities=2 --install lincurve_test.comp
${SUDO} halcompile --personalities=2 --install logic_test.comp
${SUDO} halcompile --personalities=2 --install bitslice_test.comp

# This tells us the expected filename extension ${MODULE_EXT} of realtime
# modules.
if [[ -f "${EMC2_HOME}/scripts/rtapi.conf" ]]; then
    source "${EMC2_HOME}/scripts/rtapi.conf"
else
    source "/etc/linuxcnc/rtapi.conf"
fi

for INSTALLED_FILE in "${RTLIB_DIR}"/{lincurve_test,logic_test,bitslice_test}"${MODULE_EXT}"; do
    if [[ ! -f "${INSTALLED_FILE}" ]]; then
        echo "'halcompile --install' did not install '${INSTALLED_FILE}'"
        exit 1
    fi

    MODE=$(stat --printf '%#03a\n' "${INSTALLED_FILE}")
    if [[ $((MODE & 0111)) != '0' ]]; then
        echo "installed file '${INSTALLED_FILE}' has incorrect permissions"
        echo "expected no execute bits, got ${MODE}"
        exit 1
    fi
done

for HAL in *.hal; do
    echo "testing $HAL"
    BASE=$(basename $HAL .hal)
    # use -s to avoid different user assignments in show output
    halrun -s $HAL >| $BASE.result
done