File: test.sh

package info (click to toggle)
linuxcnc 1%3A2.9.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • 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 (27 lines) | stat: -rwxr-xr-x 578 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
#!/bin/bash
set -x

# this one must succeed
rm -f names_match.c
halcompile names_match.comp
if [ $? -ne 0 ]; then
    echo 'halcompile failed to process names_match.comp'
    exit 1
fi
if [ ! -f names_match.c ]; then
    echo 'halcompile failed to produce names_match.c'
    exit 1
fi

# this one must fail
rm -f names_dont_match.c
halcompile names_dont_match.comp
if [ $? -eq 0 ]; then
    echo 'halcompile erroneously accepted names_dont_match.comp'
    exit 1
fi
if [ -f names_dont_match.c ]; then
    echo 'halcompile erroneously produced names_dont_match.c'
    exit 1
fi