File: 021_test_open.sh

package info (click to toggle)
cowdancer 0.47
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 696 kB
  • ctags: 179
  • sloc: ansic: 2,634; sh: 407; makefile: 116; cpp: 6; python: 4
file content (22 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# test close(0); open() pair will create FD=0
set -ex

TESTDIR=$(mktemp -d )
TESTCODE=$(readlink -f tests/021_test_open.c)

cd "${TESTDIR}"
mkdir 1/
# make a few files for testing.
touch 1/a 1/b 1/c 1/d
ln -s a 1/f
ln -s b 1/g
cp -al 1/ 2
# first, exclude non-cowdancer problem
"${TESTCODE}" "${TESTCODE}"
#check that cowdancer works.
cow-shell "${TESTCODE}" "${TESTCODE}"
RET=$?
echo $RET

rm -rf ${TESTDIR}