diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-12-20 21:12:02 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-20 21:12:02 +0100 |
commit | 823e1deb863542192253bf2434e1d2c719e50b42 (patch) | |
tree | 2f00a9f1c328f921fe975319874c72ae4dbcdee6 /dist | |
parent | 17b28b201226ab6c01b01b782a64e2ae7121f027 (diff) | |
download | ghdl-823e1deb863542192253bf2434e1d2c719e50b42.tar.gz ghdl-823e1deb863542192253bf2434e1d2c719e50b42.tar.bz2 ghdl-823e1deb863542192253bf2434e1d2c719e50b42.zip |
Appveyor configuration file.
Diffstat (limited to 'dist')
-rw-r--r-- | dist/appveyor/build.ps1 | 54 | ||||
-rw-r--r-- | dist/appveyor/configure.ps1 | 72 | ||||
-rw-r--r-- | dist/appveyor/info.ps1 | 68 | ||||
-rw-r--r-- | dist/appveyor/install.ps1 | 39 | ||||
-rw-r--r-- | dist/appveyor/setup.ps1 | 54 | ||||
-rw-r--r-- | dist/appveyor/shared.psm1 | 49 | ||||
-rw-r--r-- | dist/appveyor/test.ps1 | 118 |
7 files changed, 454 insertions, 0 deletions
diff --git a/dist/appveyor/build.ps1 b/dist/appveyor/build.ps1 new file mode 100644 index 000000000..4f1de95d2 --- /dev/null +++ b/dist/appveyor/build.ps1 @@ -0,0 +1,54 @@ +function Restore-NativeCommandStream +{ <# + .SYNOPSIS + This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs + as a single line. + + .DESCRIPTION + This CmdLet collects multiple ErrorRecord objects and emits one String + object per line. + .PARAMETER InputObject + A object stream is required as an input. + .PARAMETER Indent + Indentation string. + #> + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + $InputObject + ) + + begin + { $LineRemainer = "" } + + process + { if ($InputObject -is [System.Management.Automation.ErrorRecord]) + { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError") + { Write-Output $InputObject.ToString() } + elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") + { $NewLine = $LineRemainer + $InputObject.ToString() + while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1) + { Write-Output $NewLine.Substring(0, $NewLinePos) + $NewLine = $NewLine.Substring($NewLinePos + 1) + } + $LineRemainer = $NewLine + } + } + elseif ($InputObject -is [String]) + { Write-Output $InputObject } + else + { Write-Host "Unsupported object in pipeline stream" } + } + + end + { if ($LineRemainer -ne "") + { Write-Output $LineRemainer } + } +} + +Write-Host "Building GHDL and libraries..." -Foreground Yellow +cd $env:GHDL_BUILD_DIR +c:\msys64\usr\bin\make.exe 2>&1 | Restore-NativeCommandStream | %{ "$_" } + +cd $env:APPVEYOR_BUILD_FOLDER +exit 0 diff --git a/dist/appveyor/configure.ps1 b/dist/appveyor/configure.ps1 new file mode 100644 index 000000000..197bce630 --- /dev/null +++ b/dist/appveyor/configure.ps1 @@ -0,0 +1,72 @@ +function Restore-NativeCommandStream +{ <# + .SYNOPSIS + This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs + as a single line. + + .DESCRIPTION + This CmdLet collects multiple ErrorRecord objects and emits one String + object per line. + .PARAMETER InputObject + A object stream is required as an input. + .PARAMETER Indent + Indentation string. + #> + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + $InputObject + ) + + begin + { $LineRemainer = "" } + + process + { if ($InputObject -is [System.Management.Automation.ErrorRecord]) + { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError") + { Write-Output $InputObject.ToString() } + elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") + { $NewLine = $LineRemainer + $InputObject.ToString() + while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1) + { Write-Output $NewLine.Substring(0, $NewLinePos) + $NewLine = $NewLine.Substring($NewLinePos + 1) + } + $LineRemainer = $NewLine + } + } + elseif ($InputObject -is [String]) + { Write-Output $InputObject } + else + { Write-Host "Unsupported object in pipeline stream" } + } + + end + { if ($LineRemainer -ne "") + { Write-Output $LineRemainer } + } +} + +$GHDL_BUILD_DIR = "$($env:APPVEYOR_BUILD_FOLDER)\build\$($env:BUILD_MINGW)-$($env:BUILD_BACKEND)" +$GHDL_PREFIX_DIR = "/c/Tools/GHDL/0.34-dev-$($env:BUILD_MINGW)-$($env:BUILD_BACKEND)" + +if ($env:BUILD_BACKEND -eq "mcode") +{ Write-Host "Configuring GHDL for $($env:BUILD_MINGW), mcode..." -Foreground Yellow + + $env:GHDL_BUILD_DIR = $GHDL_BUILD_DIR + $env:GHDL_PREFIX_DIR = $GHDL_PREFIX_DIR + + mkdir $GHDL_BUILD_DIR | cd + c:\msys64\usr\bin\bash.exe -c "../../configure --prefix=$GHDL_PREFIX_DIR" 2>&1 | Restore-NativeCommandStream | %{ "$_" } +} +elseif ($env:BUILD_BACKEND -eq "llvm") +{ Write-Host "Configuring GHDL for $($env:BUILD_MINGW), LLVM-3.5..." -Foreground Yellow + + $env:GHDL_BUILD_DIR = $GHDL_BUILD_DIR + $env:GHDL_PREFIX_DIR = $GHDL_PREFIX_DIR + + mkdir $GHDL_BUILD_DIR | cd + c:\msys64\usr\bin\bash.exe -c "../../configure --prefix=$GHDL_PREFIX_DIR --with-llvm-config" 2>&1 | Restore-NativeCommandStream | %{ "$_" } +} + +cd $env:APPVEYOR_BUILD_FOLDER +exit 0 diff --git a/dist/appveyor/info.ps1 b/dist/appveyor/info.ps1 new file mode 100644 index 000000000..675bbe77e --- /dev/null +++ b/dist/appveyor/info.ps1 @@ -0,0 +1,68 @@ +function Restore-NativeCommandStream +{ <# + .SYNOPSIS + This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs + as a single line. + + .DESCRIPTION + This CmdLet collects multiple ErrorRecord objects and emits one String + object per line. + .PARAMETER InputObject + A object stream is required as an input. + .PARAMETER Indent + Indentation string. + #> + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + $InputObject + ) + + begin + { $LineRemainer = "" } + + process + { if ($InputObject -is [System.Management.Automation.ErrorRecord]) + { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError") + { Write-Output $InputObject.ToString() } + elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") + { $NewLine = $LineRemainer + $InputObject.ToString() + while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1) + { Write-Output $NewLine.Substring(0, $NewLinePos) + $NewLine = $NewLine.Substring($NewLinePos + 1) + } + $LineRemainer = $NewLine + } + } + elseif ($InputObject -is [String]) + { Write-Output $InputObject } + else + { Write-Host "Unsupported object in pipeline stream" } + } + + end + { if ($LineRemainer -ne "") + { Write-Output $LineRemainer } + } +} + + +Write-Host ("ExecutionPolicy = {0}" -f (Get-ExecutionPolicy)) -Foreground Yellow +Write-Host "List env:..." -Foreground Yellow +dir env: | foreach { Write-Host (" {0}={1}" -f $_.Name,$_.Value) } +Write-Host "Print env:PATH..." -Foreground Yellow +$env:PATH.Split(";") | foreach { Write-Host " $_" } +Write-Host "Print GCC setup..." -Foreground Yellow +gcc.exe -v 2>&1 | Restore-NativeCommandStream | %{ "$_" } +Write-Host "Print GCC search directories..." -Foreground Yellow +gcc.exe -print-search-dirs 2>&1 | Restore-NativeCommandStream | %{ "$_" } + +if ($env:BUILD_BACKEND -eq "llvm") +{ Write-Host "Print CLang setup..." -Foreground Yellow + clang.exe -v 2>&1 | Restore-NativeCommandStream | %{ "$_" } + Write-Host "Print CLang search directories..." -Foreground Yellow + clang.exe -print-search-dirs 2>&1 | Restore-NativeCommandStream | %{ "$_" } +} + +Write-Host "Print gnatls setup..." -Foreground Yellow +gnatls.exe -v 2>&1 | Restore-NativeCommandStream | %{ "$_" } diff --git a/dist/appveyor/install.ps1 b/dist/appveyor/install.ps1 new file mode 100644 index 000000000..bcff78ac8 --- /dev/null +++ b/dist/appveyor/install.ps1 @@ -0,0 +1,39 @@ +Write-Host "Installing dependencies ..." -Foreground Yellow +Write-Host "----------------------------------------" -Foreground Yellow +Write-Host "Installing MinGW64 packages ..." -Foreground Yellow + +C:\msys64\usr\bin\pacman -V +# list installed packages and versions +# C:\msys64\usr\bin\pacman -Q + +if ($env:BUILD_MINGW -eq "mingw32") +{ Write-Host "Installing MinGW32 packages ..." -Foreground Yellow + if ($env:BUILD_BACKEND -eq "mcode") + { + } + elseif ($env:BUILD_BACKEND -eq "llvm") + { C:\msys64\usr\bin\pacman -S mingw-w64-i686-llvm35 mingw-w64-i686-clang35 --noconfirm + } +} +elseif ($env:BUILD_MINGW -eq "mingw64") +{ Write-Host "Installing MinGW64 packages ..." -Foreground Yellow + if ($env:BUILD_BACKEND -eq "mcode") + { + } + elseif ($env:BUILD_BACKEND -eq "llvm") + { C:\msys64\usr\bin\pacman -S mingw-w64-x86_64-llvm35 mingw-w64-x86_64-clang35 --noconfirm + } +} + +Write-Host "Installing NuGet as PackageProvider ..." -Foreground Yellow +Install-PackageProvider NuGet -Force +Import-PackageProvider NuGet -Force +Set-PSRepository -Name PSGallery -InstallationPolicy Trusted + +Write-Host "Installing PowerShell modules ..." -Foreground Yellow +Install-Module Pscx -AllowClobber + +#Write-Host "Check all Write-* CmdLets ..." -Foreground Yellow +#Get-Command -Verb Write | Format-Table + +exit $LastExitCode diff --git a/dist/appveyor/setup.ps1 b/dist/appveyor/setup.ps1 new file mode 100644 index 000000000..117d8e9bd --- /dev/null +++ b/dist/appveyor/setup.ps1 @@ -0,0 +1,54 @@ +function Restore-NativeCommandStream +{ <# + .SYNOPSIS + This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs + as a single line. + + .DESCRIPTION + This CmdLet collects multiple ErrorRecord objects and emits one String + object per line. + .PARAMETER InputObject + A object stream is required as an input. + .PARAMETER Indent + Indentation string. + #> + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + $InputObject + ) + + begin + { $LineRemainer = "" } + + process + { if ($InputObject -is [System.Management.Automation.ErrorRecord]) + { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError") + { Write-Output $InputObject.ToString() } + elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") + { $NewLine = $LineRemainer + $InputObject.ToString() + while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1) + { Write-Output $NewLine.Substring(0, $NewLinePos) + $NewLine = $NewLine.Substring($NewLinePos + 1) + } + $LineRemainer = $NewLine + } + } + elseif ($InputObject -is [String]) + { Write-Output $InputObject } + else + { Write-Host "Unsupported object in pipeline stream" } + } + + end + { if ($LineRemainer -ne "") + { Write-Output $LineRemainer } + } +} + +Write-Host "Installing GHDL and libraries..." -Foreground Yellow +cd $env:GHDL_BUILD_DIR +c:\msys64\usr\bin\make.exe install 2>&1 | Restore-NativeCommandStream | %{ "$_" } + +cd $env:APPVEYOR_BUILD_FOLDER +exit 0 diff --git a/dist/appveyor/shared.psm1 b/dist/appveyor/shared.psm1 new file mode 100644 index 000000000..3335182ff --- /dev/null +++ b/dist/appveyor/shared.psm1 @@ -0,0 +1,49 @@ +function Restore-NativeCommandStream +{ <# + .SYNOPSIS + This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs + as a single line. + + .DESCRIPTION + This CmdLet collects multiple ErrorRecord objects and emits one String + object per line. + .PARAMETER InputObject + A object stream is required as an input. + .PARAMETER Indent + Indentation string. + #> + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + $InputObject + ) + + begin + { $LineRemainer = "" } + + process + { if ($InputObject -is [System.Management.Automation.ErrorRecord]) + { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError") + { Write-Output $InputObject.ToString() } + elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") + { $NewLine = $LineRemainer + $InputObject.ToString() + while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1) + { Write-Output $NewLine.Substring(0, $NewLinePos) + $NewLine = $NewLine.Substring($NewLinePos + 1) + } + $LineRemainer = $NewLine + } + } + elseif ($InputObject -is [String]) + { Write-Output $InputObject } + else + { Write-Host "Unsupported object in pipeline stream" } + } + + end + { if ($LineRemainer -ne "") + { Write-Output $LineRemainer } + } +} + +Export-ModuleMember -Function 'Restore-NativeCommandStream' diff --git a/dist/appveyor/test.ps1 b/dist/appveyor/test.ps1 new file mode 100644 index 000000000..a28186285 --- /dev/null +++ b/dist/appveyor/test.ps1 @@ -0,0 +1,118 @@ +function Restore-NativeCommandStream +{ <# + .SYNOPSIS + This CmdLet gathers multiple ErrorRecord objects and reconstructs outputs + as a single line. + + .DESCRIPTION + This CmdLet collects multiple ErrorRecord objects and emits one String + object per line. + .PARAMETER InputObject + A object stream is required as an input. + .PARAMETER Indent + Indentation string. + #> + [CmdletBinding()] + param( + [Parameter(ValueFromPipeline=$true)] + $InputObject + ) + + begin + { $LineRemainer = "" } + + process + { if ($InputObject -is [System.Management.Automation.ErrorRecord]) + { if ($InputObject.FullyQualifiedErrorId -eq "NativeCommandError") + { Write-Output $InputObject.ToString() } + elseif ($InputObject.FullyQualifiedErrorId -eq "NativeCommandErrorMessage") + { $NewLine = $LineRemainer + $InputObject.ToString() + while (($NewLinePos = $NewLine.IndexOf("`n")) -ne -1) + { Write-Output $NewLine.Substring(0, $NewLinePos) + $NewLine = $NewLine.Substring($NewLinePos + 1) + } + $LineRemainer = $NewLine + } + } + elseif ($InputObject -is [String]) + { Write-Output $InputObject } + else + { Write-Host "Unsupported object in pipeline stream" } + } + + end + { if ($LineRemainer -ne "") + { Write-Output $LineRemainer } + } +} + +Write-Host "Run testsuites..." -Foreground Yellow +cd "$($env:APPVEYOR_BUILD_FOLDER)\testsuite" +# Use a MinGW compatible path +$env:GHDL="$($env:GHDL_PREFIX_DIR)/bin/ghdl.exe" + +# ============================================================================== +$TestFramework = "GNA" +Write-Host "Running GNA tests..." -Foreground Yellow +cd gna + +$Directories = dir -Directory * +foreach ($Directory in $Directories) +{ $TestName = "GNA test: {0}" -f $Directory.Name + $FileName = $Directory.Name + + Write-Host $TestName -Foreground Yellow + cd $Directory + Add-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Running + $start = Get-Date + c:\msys64\usr\bin\bash.exe -c "./testsuite.sh" 2>&1 | Restore-NativeCommandStream | %{ "$_" } + $end = Get-Date + $TotalMilliseconds = ($end - $start).TotalMilliseconds + if ($LastExitCode -eq 0) + { Write-Host "PASSED" -Foreground Green + Update-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Passed -Duration $TotalMilliseconds + } + else + { Write-Host "FAILED" -Foreground Red + Update-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Failed -Duration $TotalMilliseconds + } +} +cd ..\.. + +# ============================================================================== +$TestFramework = "VESTS" +Write-Host "Running VESTS tests..." -Foreground Yellow + +c:\msys64\mingw64\bin\gnatmake.exe get_entities 2>&1 | Restore-NativeCommandStream | %{ "$_" } + +cd vests + +$TestName = "VESTS test:" # {0}" -f $Directory +$FileName = "VESTS" #$Directory + +Write-Host $TestName -Foreground Yellow +# Disable vests. It works but takes ~20 min +if ($true) +{ Add-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Skipped + $start = Get-Date +} +else +{ Add-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Running + $start = Get-Date + c:\msys64\usr\bin\bash.exe -c "./testsuite.sh" 2>&1 | Restore-NativeCommandStream | %{ "$_" } + $end = Get-Date + $TotalMilliseconds = ($end - $start).TotalMilliseconds + if ($LastExitCode -eq 0) + { Write-Host "PASSED" -Foreground Green + Update-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Passed -Duration $TotalMilliseconds + } + else + { Write-Host "FAILED" -Foreground Red + Update-AppveyorTest -Name $TestName -Framework $TestFramework -FileName $FileName -Outcome Failed -Duration $TotalMilliseconds + } + cd .. +} + +# ============================================================================== +cd $env:APPVEYOR_BUILD_FOLDER +exit 0 |