Skip to content

Commit

Permalink
Applied updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Dec 28, 2018
1 parent cb81ff1 commit cd32f68
Show file tree
Hide file tree
Showing 32 changed files with 998 additions and 263 deletions.
198 changes: 179 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ env:
- secure: "V624S2sinRh1pSqwlAJ5Ycz+pI9OhiWBhlUqCMyzncDc+VVwXNbcNhFuPpriE81PvCyo6cSyjRpk9/PtBd5TOKNGqj9FDUzdG4usIJT38vmwTyzhPsJaUCMhcFNdz7/ypfLzY5+g5h4oB4JuKlMI2S73EeFF6TAtJWyTW9eDKv4="
matrix:
include:
- env: TARGET="coverity"
- name: "Coverity"
env:
- CONFIGURE_OPTIONS=""
- TARGET="coverity"
compiler: clang
os: linux
dist: trusty
Expand All @@ -20,43 +23,200 @@ matrix:
build_command_prepend: "./synclibs.sh && ./autogen.sh && ./configure"
build_command: "make -j4"
branch_pattern: master
- env: TARGET="linux-clang"
- name: "Linux with clang"
env:
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-clang"
compiler: clang
os: linux
dist: trusty
sudo: required
group: edge
- env: TARGET="linux-gcc"
- name: "Linux with gcc"
env:
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- env: TARGET="macos-clang"
- name: "Linux with gcc and wide character type (wchar_t) support"
env:
- CONFIGURE_OPTIONS="--enable-wide-character-type"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-wide-character-type"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc without optimization"
env:
- CONFIGURE_OPTIONS="--enable-shared=no --enable-wide-character-type"
- CFLAGS="--coverage -O0"
- CPPFLAGS="-DOPTIMIZATION_DISABLED"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-no-optimization"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc and Python module"
env:
- CONFIGURE_OPTIONS="--enable-python"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-python"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc and Python module (setup.py)"
env:
- CONFIGURE_OPTIONS="--enable-python"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-python-setup-py"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc and Python 2 module"
env:
- CONFIGURE_OPTIONS="--enable-python2"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-python2"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc and Python 3 module"
env:
- CONFIGURE_OPTIONS="--enable-python3"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-python3"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc and shared libraries"
env:
- CONFIGURE_OPTIONS=""
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-shared"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc, shared libraries and wide character type (wchar_t) support"
env:
- CONFIGURE_OPTIONS="--enable-wide-character-type"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-shared-wide-character-type"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "Linux with gcc and static executables support"
env:
- CONFIGURE_OPTIONS="--enable-static-executables"
- CFLAGS="--coverage"
- LDFLAGS="--coverage"
- TARGET="linux-gcc-static-executables"
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
- name: "MacOS with clang"
env:
- CONFIGURE_OPTIONS=""
- TARGET="macos-clang"
compiler: clang
os: osx
osx_image: xcode8.3
- name: "MacOS with gcc"
env:
- CONFIGURE_OPTIONS=""
- TARGET="macos-gcc"
compiler: clang
compiler: gcc
os: osx
osx_image: xcode8.3
- env: TARGET="macos-gcc"
- name: "MacOS with gcc and Python module"
env:
- CONFIGURE_OPTIONS="--enable-python"
- TARGET="macos-gcc-python"
compiler: clang
compiler: gcc
os: osx
osx_image: xcode8.3
- env: TARGET="shared"
- name: "MacOS with gcc and Python module (setup.py)"
env:
- CONFIGURE_OPTIONS="--enable-python"
- TARGET="macos-gcc-python-setup-py"
compiler: clang
compiler: gcc
os: linux
dist: trusty
sudo: required
group: edge
os: osx
osx_image: xcode8.3
- name: "MacOS with gcc and Python 2 module"
env:
- CONFIGURE_OPTIONS="--enable-python2"
- TARGET="macos-gcc-python2"
compiler: clang
compiler: gcc
os: osx
osx_image: xcode8.3
before_install:
- if test ${TRAVIS_OS_NAME} = "linux"; then sudo apt-get update && sudo apt-mark hold oracle-java9-installer postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6 postgresql-client postgresql-client-common postgresql-common postgresql-contrib-9.2 postgresql-contrib-9.3 postgresql-contrib-9.4 postgresql-contrib-9.5 postgresql-contrib-9.6 postgresql-doc && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated && sudo apt-get install -y autopoint; fi
- if test ${TRAVIS_OS_NAME} = "osx"; then brew update && brew install gettext gnu-sed && brew link --force gettext; fi
- if test ${TARGET} = "coverity"; then echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-; fi
- if test ${TRAVIS_OS_NAME} = "linux"; then
sudo apt-get update && sudo apt-mark hold oracle-java8-installer oracle-java9-installer postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5 postgresql-9.6 postgresql-client postgresql-client-common postgresql-common postgresql-contrib-9.2 postgresql-contrib-9.3 postgresql-contrib-9.4 postgresql-contrib-9.5 postgresql-contrib-9.6 postgresql-doc && sudo apt-get --fix-missing -o Dpkg::Options::="--force-confold" upgrade -y --allow-unauthenticated && sudo apt-get install -y autopoint;
elif test ${TRAVIS_OS_NAME} = "osx"; then
brew update && brew install gettext gnu-sed && brew link --force gettext;
fi
- if test ${TARGET} = "coverity"; then
echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-;
fi
install:
- if test ${TRAVIS_OS_NAME} = "osx"; then export SED="/usr/local/bin/gsed"; fi
- if test ${TRAVIS_OS_NAME} = "osx"; then
export SED="/usr/local/bin/gsed";
fi
- ./synclibs.sh --use-head && ./autogen.sh
- if test ${TARGET} = "shared"; then ./configure > /dev/null && make > /dev/null && ./syncsharedlibs.sh --use-head; fi
- if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- if test ${TARGET} = "linux-gcc-shared" || test ${TARGET} = "linux-gcc-shared-wide-character-type"; then
./configure > /dev/null && make > /dev/null && ./syncsharedlibs.sh --use-head;
fi
- if test -x "synctestdata.sh"; then
./synctestdata.sh;
fi
script:
- if test ${TRAVIS_OS_NAME} = "linux"; then export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g"); fi
- if test ${TARGET} != "coverity"; then ./runtests.sh; fi
- if test ${TRAVIS_OS_NAME} = "linux"; then
export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g");
fi
- if test ${TARGET} = "linux-gcc-python-setup-py" || test ${TARGET} = "macos-gcc-python-setup-py"; then
./setup.py build;
elif test ${TARGET} != "coverity"; then
./configure ${CONFIGURE_OPTIONS} && make > /dev/null && make check CHECK_WITH_STDERR=1;
if test $? -ne 0 && test -f tests/test-suite.log; then
cat tests/test-suite.log;
fi;
fi
after_success:
- if test ${TARGET} = "linux-gcc"; then curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh; fi
- if test ${TARGET} = "linux-gcc-no-optimization"; then
curl -o codecov.sh -s https://codecov.io/bash && /bin/bash ./codecov.sh -n ${TARGET} -y .codecov.yml;
fi
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ test_script:
after_test:
- cmd: if [%TARGET%]==[mingw] (
copy C:\projects\codecov-bash\codecov C:\MinGW\msys\1.0\home\appveyor\libesedb\codecov.sh &&
C:\MinGW\msys\1.0\bin\bash -e -l -c "cd libesedb && chmod a+x ./codecov.sh && ./codecov.sh" )
C:\MinGW\msys\1.0\bin\bash -e -l -c "cd libesedb && chmod a+x ./codecov.sh && sed -i 's/-execdir /-exec /' ./codecov.sh && ./codecov.sh -n mingw -y .codecov.yml" )

150 changes: 150 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Script that builds libesedb
#
# Version: 20180728

Param (
[string]$Configuration = ${Env:Configuration},
[string]$MSVSCppConvertOptions = "--extend-with-x64",
[string]$Platform = ${Env:Platform},
[string]$PythonPath = "C:\Python27",
[string]$VSToolsPath = "..\vstools"
)

$ExitSuccess = 0
$ExitFailure = 1

$Python = "${PythonPath}\python.exe"

$Git = "git"
$GitUrl = "https://github.com/libyal/vstools.git"

$MSVSCppConvert = "${VSToolsPath}\scripts\msvscpp-convert.py"

If (-Not (Test-Path $Python))
{
Write-Host "Missing Python: ${Python}" -foreground Red

Exit ${ExitFailure}
}
If (-Not (Test-Path ${VSToolsPath}))
{
# PowerShell will raise NativeCommandError if git writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "${Git} clone ${GitUrl} ${VSToolsPath} 2>&1"
}
Else
{
Push-Location "${VSToolsPath}"

Try
{
# Make sure vstools are up to date.
$Output = Invoke-Expression -Command "${Git} pull 2>&1"
}
Finally
{
Pop-Location
}
}
If (-Not (Test-Path ${MSVSCppConvert}))
{
Write-Host "Missing msvscpp-convert.py: ${MSVSCppConvert}" -foreground Red

Exit ${ExitFailure}
}
ElseIf (-Not ${Env:VisualStudioVersion})
{
Write-Host "Unknown Visual Studio version make sure to set %VisualStudioVersion%" -foreground Red

Exit ${ExitFailure}
}
$OutputFormat = ""

If (${Env:VisualStudioVersion} -eq "15.0")
{
$OutputFormat = "2017"
}
ElseIf (${Env:VisualStudioVersion} -eq "14.0")
{
$OutputFormat = "2015"
}
ElseIf (${Env:VisualStudioVersion} -eq "12.0")
{
$OutputFormat = "2013"
}
ElseIf (${Env:VisualStudioVersion} -eq "11.0")
{
$OutputFormat = "2012"
}
ElseIf (${Env:VisualStudioVersion} -eq "10.0")
{
$OutputFormat = "2010"
}
ElseIf (${Env:VisualStudioVersion} -eq "9.0")
{
$OutputFormat = "2008"
}
Else
{
Write-Host "Unsupported Visual Studio version: %VisualStudioVersion% = ${Env:VisualStudioVersion}" -foreground Red

Exit ${ExitFailure}
}
If (${OutputFormat} -eq "2017")
{
$MSBuild = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe"
}
ElseIf (${OutputFormat} -eq "2008")
{
$MSBuild = "C:\\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe"
}
Else
{
$MSBuild = "C:\\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
}
If (-Not (Test-Path ${MSBuild}))
{
Write-Host "Missing msbuild.exe: ${MSBuild}" -foreground Red

Exit ${ExitFailure}
}
If (${OutputFormat} -eq "2008")
{
$VSSolutionPath = "msvscpp"
}
Else
{
$VSSolutionPath = "vs${OutputFormat}"

If (-Not (Test-Path "${VSSolutionPath}"))
{
${Env:PYTHONPATH} = ${VSToolsPath}

Invoke-Expression -Command "& '${Python}' ${MSVSCppConvert} --output-format ${OutputFormat} ${MSVSCppConvertOptions} msvscpp\libesedb.sln"
}
}
$VSSolutionFile = "${VSSolutionPath}\libesedb.sln"

If (-Not (Test-Path "${VSSolutionFile}"))
{
Write-Host "Missing Visual Studio ${OutputFormat} solution file: ${VSSolutionFile}" -foreground Red

Exit ${ExitFailure}
}
If (-Not ${Configuration})
{
$Configuration = "Release"
}
If (-Not ${Platform})
{
$Platform = "Win32"
}
$MSBuildOptions = "/verbosity:quiet /target:Build /property:Configuration=${Configuration},Platform=${Platform}"

If (${Env:VisualStudioVersion} -eq "15.0")
{
$MSBuildOptions = "${MSBuildOptions} /property:PlatformToolset=v141"
}
Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${VSSolutionFile}"

Exit ${ExitSuccess}
Loading

0 comments on commit cd32f68

Please sign in to comment.