-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A script to build known versions of all shells we test against.
Right now they are the versions that come with Ubuntu 16.04. test/spec.sh: If possible, use these hermetic shell binaries for spec tests. Addresses issue #42. I'm not sure why, but I had to adjust two tests. glob.test.sh: Upstream dash 0.5.8 also has the same bug as mksh. I'm not sure why the Ubuntu package, which is marked 0.5.8, doesn't have it. Maybe they ported a patch over? quote.test.sh: hermetic ash doesn't have this bug for some reason. Also: the regex test is currently failing for ZSH because we're not building with regex support. To be fixed.
- Loading branch information
Andy Chu
committed
Jul 4, 2018
1 parent
5fc5f8a
commit 5151cf8
Showing
4 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
# | ||
# Build binaries for the spec tests. | ||
# | ||
# Usage: | ||
# ./spec-bin.sh <function name> | ||
|
||
set -o nounset | ||
set -o pipefail | ||
set -o errexit | ||
|
||
readonly DIR=_tmp/spec-bin | ||
|
||
download() { | ||
mkdir -p $DIR | ||
wget --no-clobber --directory $DIR \ | ||
https://www.oilshell.org/blob/spec-bin/bash-4.3.tar.gz \ | ||
https://www.oilshell.org/blob/spec-bin/busybox-1.22.0.tar.bz2 \ | ||
https://www.oilshell.org/blob/spec-bin/dash-0.5.8.tar.gz \ | ||
https://www.oilshell.org/blob/spec-bin/mksh-R52c.tgz \ | ||
https://www.oilshell.org/blob/spec-bin/zsh-5.1.1.tar.xz | ||
} | ||
|
||
extract-all() { | ||
pushd $DIR | ||
for archive in *.tar.* *.tgz; do | ||
echo $archive | ||
tar --extract --file $archive | ||
done | ||
mv -v mksh mksh-R52c # so it doesn't collide | ||
popd | ||
} | ||
|
||
build-all() { | ||
# bash/dash/zsh: ./configure; make | ||
# mksh: sh Build.sh | ||
# busybox: make defconfig (default config); make | ||
|
||
pushd $DIR | ||
# TODO: Are they all different? | ||
popd | ||
} | ||
|
||
link-all() { | ||
pushd $DIR | ||
ln -s -f -v bash-4.3/bash . | ||
ln -s -f -v dash-0.5.8/src/dash . | ||
ln -s -f -v zsh-5.1.1/Src/zsh . | ||
ln -s -f -v mksh-R52c/mksh . | ||
ln -s -f -v busybox-1.22.0/busybox ./ash | ||
popd | ||
} | ||
|
||
test-all() { | ||
for sh in bash dash zsh mksh ash; do | ||
$DIR/$sh -c 'echo "Hello from $0"' | ||
|
||
# bash and zsh depend on libtinfo, but others don't | ||
# ash and zsh depend on libm, but others don't | ||
# bash and zsh depend on libdl, but others don't | ||
ldd $DIR/$sh | ||
done | ||
} | ||
|
||
"$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters