Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
language: c
script: ./travis.sh
46 changes: 46 additions & 0 deletions travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

set -uexo pipefail

declare -A compilers=(
["dmd-2.069.2"]="DMD64 D Compiler v2.069.2"
["dmd-2.071.2"]="DMD64 D Compiler v2.071.2"
["dmd-2016-10-19"]="DMD64 D Compiler v2.073.0-master-878b882"
["dmd-master-2016-10-24"]="DMD64 D Compiler v2.073.0-master-ab9d712"
["ldc-1.0.0"]="LDC - the LLVM D compiler (1.0.0):"
["gdc-4.9.3"]="gdc (crosstool-NG crosstool-ng-1.20.0-232-gc746732 - 20150825-2.066.1-58ec4c13ec) 4.9.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should test name resolutions as well. The values could be globs matched via ~= or regexes for grep/egrep.

)

for compiler in "${!compilers[@]}"
do
echo "Testing: $compiler"
bash script/install.sh $compiler
source ~/dlang/$compiler/activate

# simple check whether the installation was successful
if [[ $compiler =~ dmd ]]
then
compilerVersion=$(dmd --version | head -n1)
elif [[ $compiler =~ ldc ]]
then
compilerVersion=$(ldc2 --version | head -n1)
elif [[ $compiler =~ gdc ]]
then
compilerVersion=$(gdc --version | head -n1)
fi

if [ "$compilerVersion" != "${compilers[$compiler]}" ]
then
echo "Mismatch - expected: '${compilers[$compiler]}', received: $compilerVersion"
exit 1
fi

bash script/install.sh uninstall $compiler
done

# check whether all installations have been uninstalled successfully
if bash script/install.sh list
then
echo "Uninstall of the compilers failed."
exit 1
fi