diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2016-03-20 13:34:31 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2016-03-20 13:34:31 -0400 |
commit | 0db4badc02c172212386834b2d4b7fcf00bace00 (patch) | |
tree | c0a266f98fa40cec8b58fbbd0baa013eef617295 /test | |
parent | 27f6a27bee5254147cb83a490200235b8839600f (diff) | |
download | deheader-0db4badc02c172212386834b2d4b7fcf00bace00.tar.gz deheader-0db4badc02c172212386834b2d4b7fcf00bace00.tar.bz2 deheader-0db4badc02c172212386834b2d4b7fcf00bace00.tar.xz deheader-0db4badc02c172212386834b2d4b7fcf00bace00.zip |
Steps towards working under Python 3.
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 3 | ||||
-rwxr-xr-x | test/setpython | 24 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile index 0e1d5bd..3841041 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,10 +1,13 @@ +PATH := ..:.:${PATH} SOURCES = $(shell ls *.c) regress: @echo "Testing deheader: no output is good news." + @setpython python2 @deheader -v -v . >/tmp/regress @diff -u regress.chk /tmp/regress + @setpython python @rm /tmp/regress makeregress: @deheader -v -v . >regress.chk diff --git a/test/setpython b/test/setpython new file mode 100755 index 0000000..8d8d2fc --- /dev/null +++ b/test/setpython @@ -0,0 +1,24 @@ +#!/bin/sh +# +# setpython - create a local link from 'python' to a specified version +# +# This script is used to to redirect the 'python' in reposurgeon's +# shebang line to a specified version when running regression tests. + +if [ -z "$1" ] +then + ls -l python +elif [ $1 = "python" ] +then + rm -f ./python +elif [ $1 = python2 -o $1 = python3 ] +then + set -- `whereis $1` + shift + case $1 in + */bin/*) ln -sf $1 ./python; echo "python -> $1";; + *) echo "setpython: no python binary" >&2;; + esac +else + echo "setpython: unrecognized python version" >&2 +fi |