Skip to content

Commit

Permalink
AppVeyor: Add LTO integration test
Browse files Browse the repository at this point in the history
And test portability too.
  • Loading branch information
kinke committed Jul 28, 2018
1 parent 82e2989 commit 19ac80a
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ install:
- cd libcurl
- 7z x ..\libcurl.zip > nul
- cd ..
# Copy libcurl.{dll,lib} to final LDC installation directory and add to PATH
# Copy libcurl.{dll,lib} to LDC installation directory and add to PATH
- md ldc2-%APPVEYOR_JOB_ARCH% && md ldc2-%APPVEYOR_JOB_ARCH%\bin && md ldc2-%APPVEYOR_JOB_ARCH%\lib
- ps: |
If ($Env:APPVEYOR_JOB_ARCH -eq 'x64') {
Expand Down Expand Up @@ -161,10 +161,21 @@ after_test:
cp ldc/LICENSE "$ldcInstallDir"
git clone https://github.com/ldc-developers/ldc-scripts.git
cp ldc-scripts\ldc2-packaging\pkgfiles\README.txt "$ldcInstallDir"
# Now rename the installation dir to test portability.
ren "$ldcInstallDir" ldc2-install
# Hello world integration test with LTO
- ps: |
cd c:\projects
$ldcInstallDir = 'c:\projects\ldc2-install'
echo 'void main() { import std.stdio; writefln("Hello world, %d bits", size_t.sizeof * 8); }' > hello.d
& "$ldcInstallDir\bin\ldc2.exe" hello.d -of=hello_thin.exe -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
.\hello_thin.exe
& "$ldcInstallDir\bin\ldc2.exe" hello.d -of=hello_full.exe -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
.\hello_full.exe
# Build dub
- ps: |
cd c:\projects
$ldcInstallDir = "c:\projects\ldc2-$Env:APPVEYOR_JOB_ARCH"
$ldcInstallDir = 'c:\projects\ldc2-install'
Set-Item -path env:DC -value "$ldcInstallDir\bin\ldmd2"
git clone --recursive https://github.com/dlang/dub.git
cd dub
Expand All @@ -175,7 +186,7 @@ after_test:
# Build dlang tools
- ps: |
cd c:\projects
$ldcInstallDir = "c:\projects\ldc2-$Env:APPVEYOR_JOB_ARCH"
$ldcInstallDir = 'c:\projects\ldc2-install'
git clone --recursive https://github.com/dlang/tools.git
cd tools
& "$ldcInstallDir\bin\ldmd2" -w rdmd.d
Expand All @@ -190,9 +201,9 @@ after_test:
} Else {
$artifactBasename = "ldc2-$($Env:APPVEYOR_REPO_COMMIT.Substring(0, 8))-windows-$Env:APPVEYOR_JOB_ARCH"
}
ren "ldc2-$Env:APPVEYOR_JOB_ARCH" $artifactBasename
ren ldc2-install $artifactBasename
7z a -mx=9 "$artifactBasename.7z" $artifactBasename > $null
ren $artifactBasename "ldc2-$Env:APPVEYOR_JOB_ARCH"
ren $artifactBasename ldc2-install
Push-AppveyorArtifact "$artifactBasename.7z"
# x86 job: Create a 32/64-bit multilib artifact if the commit is on the master branch
# (or a tag). It consists of the x64 artifact (published by a successful x64 job)
Expand Down Expand Up @@ -225,10 +236,10 @@ after_test:
ren "$artifactBasename-x64" "$artifactBasename-multilib"
cd "$artifactBasename-multilib"
ren lib lib64
copy ..\ldc2-x86\lib -Recurse
copy ..\ldc2-install\lib -Recurse
ren lib lib32
(cat etc\ldc2.conf).replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib64') | Set-Content etc\ldc2.conf
$conf32 = cat ..\ldc2-x86\etc\ldc2.conf -Raw
$conf32 = cat ..\ldc2-install\etc\ldc2.conf -Raw
$conf32 = "`r`n""i[3-6]86-.*-windows-msvc"":" + $conf32.Substring($conf32.IndexOf("`r`ndefault:") + 10)
$conf32 = $conf32.Substring(0, $conf32.IndexOf("`r`n};`r`n") + 6)
$conf32 = $conf32.Replace('%%ldcbinarypath%%/../lib', '%%ldcbinarypath%%/../lib32')
Expand Down

0 comments on commit 19ac80a

Please sign in to comment.