diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c2e0b9..867a714 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,24 @@ name: build on: [push, pull_request] permissions: read-all jobs: + build_freebsd: + # FreeBSD support is provided via virtualization on MacOS 12 + # See https://github.com/vmactions/freebsd-vm#under-the-hood. + runs-on: macos-12 + steps: + - uses: actions/checkout@v3 + - name: Building from source + id: build_freebsd + uses: vmactions/freebsd-vm@v0 + with: + usesh: true + mem: 4096 + # Note that the test scripts require bash + prepare: | + pkg install -y autoconf automake bash gettext git libtool pkgconf + run: | + tests/build.sh + tests/runtests.sh build_ubuntu: runs-on: ubuntu-22.04 strategy: @@ -27,7 +45,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-static-executables=yes --enable-multi-threading-support=no' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config @@ -56,7 +74,7 @@ jobs: configure_options: '--enable-python3' python_version: '3' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install build dependencies run: | sudo add-apt-repository universe && @@ -85,7 +103,7 @@ jobs: configure_options: '' python-version: '3.10' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: @@ -115,7 +133,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config @@ -135,7 +153,7 @@ jobs: for DIRECTORY in `find . -maxdepth 1 -type d`; do \ (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) \ done - - name: Upload coverage data - run: | - git clone https://github.com/codecov/codecov-bash.git ../codecov-bash - /bin/bash ../codecov-bash/codecov -n linux-${{ matrix.architecture }}-gcc-no-optimization -X gcov; + - name: Upload coverage report to Codecov + uses: codecov/codecov-action@v3 + with: + name: linux-${{ matrix.architecture }}-gcc-no-optimization diff --git a/.github/workflows/build_shared.yml b/.github/workflows/build_shared.yml index ca758eb..d0bff2f 100644 --- a/.github/workflows/build_shared.yml +++ b/.github/workflows/build_shared.yml @@ -17,7 +17,7 @@ jobs: compiler: 'gcc' configure_options: '--enable-wide-character-type' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install build dependencies run: | sudo apt-get -y install autoconf automake autopoint build-essential git libtool pkg-config diff --git a/.gitignore b/.gitignore index e64a9b5..6b09032 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Files to ignore by git # -# Version: 20200912 +# Version: 20230405 # Generic auto-generated build files *~ @@ -82,6 +82,7 @@ stamp-h[1-9] /m4/ltsugar.m4 /m4/ltversion.m4 /m4/nls.m4 +/m4/pkg.m4 /m4/po.m4 /m4/printf-posix.m4 /m4/progtest.m4 diff --git a/appveyor.yml b/appveyor.yml index 9ccd00d..834964c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,40 +8,77 @@ environment: VisualStudioVersion: 9.0 platform: Win32 configuration: Release + PYTHON_PATH: "C:\\Python37" - TARGET: vs2010 BUILD_ENVIRONMENT: msbuild APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 VisualStudioVersion: 10.0 platform: Win32 - configuration: VSDebug + configuration: Release + PYTHON_PATH: "C:\\Python37" - TARGET: vs2012 BUILD_ENVIRONMENT: msbuild APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 VisualStudioVersion: 11.0 - platform: x64 + platform: Win32 configuration: Release + PYTHON_PATH: "C:\\Python37" - TARGET: vs2013 BUILD_ENVIRONMENT: msbuild APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 VisualStudioVersion: 12.0 platform: Win32 configuration: Release + PYTHON_PATH: "C:\\Python37" - TARGET: vs2015 BUILD_ENVIRONMENT: msbuild APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 VisualStudioVersion: 14.0 platform: Win32 configuration: Release + PYTHON_PATH: "C:\\Python38" - TARGET: vs2017 BUILD_ENVIRONMENT: msbuild APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 VisualStudioVersion: 15.0 + platform: Win32 configuration: Release + PYTHON_PATH: "C:\\Python38" - TARGET: vs2019 BUILD_ENVIRONMENT: msbuild APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 VisualStudioVersion: 16.0 + platform: Win32 + configuration: Release + PYTHON_PATH: "C:\\Python311" + - TARGET: vs2022 + BUILD_ENVIRONMENT: msbuild + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + VisualStudioVersion: 17.0 + platform: Win32 + configuration: Release + PYTHON_PATH: "C:\\Python311" + - TARGET: vs2022-vsdebug + BUILD_ENVIRONMENT: msbuild + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + VisualStudioVersion: 17.0 + platform: Win32 + configuration: VSDebug + PYTHON_PATH: "C:\\Python311" + - TARGET: vs2022-x64 + BUILD_ENVIRONMENT: msbuild + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + VisualStudioVersion: 17.0 + platform: x64 configuration: Release + PYTHON_PATH: "C:\\Python311" + - TARGET: vs2022-python + BUILD_ENVIRONMENT: msbuild + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + VisualStudioVersion: 17.0 + platform: x64 + configuration: Release + PYTHON_PATH: "C:\\Python311-x64" - TARGET: macos-x64-clang BUILD_ENVIRONMENT: xcode APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey @@ -71,14 +108,14 @@ environment: CFLAGS: "-I/usr/local/include" LDFLAGS: "-L/usr/local/lib" CONFIGURE_OPTIONS: "--disable-dependency-tracking --prefix=/usr/local --enable-python --with-pyprefix" - - TARGET: python310 + - TARGET: python311 BUILD_ENVIRONMENT: python - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - PYTHON: "C:\\Python310\\python.exe" - - TARGET: python310-x64 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + PYTHON: "C:\\Python311\\python.exe" + - TARGET: python311-x64 BUILD_ENVIRONMENT: python - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - PYTHON: "C:\\Python310-x64\\python.exe" + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 + PYTHON: "C:\\Python311-x64\\python.exe" - TARGET: macos-tox-py37 BUILD_ENVIRONMENT: python-tox APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey @@ -150,7 +187,6 @@ environment: CONFIGURE_OPTIONS: "--enable-static-executables" install: -- cmd: git clone https://github.com/codecov/codecov-bash.git ..\codecov-bash - cmd: if [%BUILD_ENVIRONMENT%]==[msbuild] ( git clone https://github.com/libyal/vstools.git ..\vstools ) - sh: if test ${BUILD_ENVIRONMENT} = "python-tox" || test ${BUILD_ENVIRONMENT} = "xcode"; then brew update -q; fi @@ -164,33 +200,28 @@ install: C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget -P python3-devel ) - cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] ( C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gcc gettext-devel libtool make ) +- ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) { + $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe } build_script: - ps: If ($env:BUILD_ENVIRONMENT -eq "msbuild" -or ($env:BUILD_ENVIRONMENT -eq "python" -and $isWindows)) { .\synclibs.ps1; .\autogen.ps1 } - ps: If ($env:TARGET -eq "vs2008") { - .\build.ps1 -VisualStudioVersion 2008 -VSToolsOptions "" } -- ps: If ($env:TARGET -eq "vs2010") { - .\build.ps1 -VisualStudioVersion 2010 -VSToolsOptions "--no-python-dll" } -- ps: If ($env:TARGET -eq "vs2012") { - .\build.ps1 -VisualStudioVersion 2012 -VSToolsOptions "--extend-with-x64 --python-path C:\\Python27-x64" } -- ps: If ($env:TARGET -eq "vs2013") { - .\build.ps1 -VisualStudioVersion 2013 -VSToolsOptions "" } -- ps: If ($env:TARGET -eq "vs2015") { - .\build.ps1 -VisualStudioVersion 2015 -VSToolsOptions "" } -- ps: If ($env:TARGET -eq "vs2017") { - .\build.ps1 -VisualStudioVersion 2017 -Platform Win32 -VSToolsOptions "--extend-with-x64 --no-python-dll --with-dokany"; - .\build.ps1 -VisualStudioVersion 2017 -Platform x64 -VSToolsOptions "--extend-with-x64 --no-python-dll --with-dokany" } -- ps: If ($env:TARGET -eq "vs2019") { - .\build.ps1 -VisualStudioVersion 2019 -VSToolsOptions "--extend-with-x64 --no-python-dll --with-dokany" } + .\build.ps1 -VisualStudioVersion 2008 -PythonPath $env:PYTHON_PATH -VSToolsOptions "--no-python-dll" } +- ps: If ( ( "vs2010", "vs2012", "vs2013", "vs2015" ).Contains( $env:TARGET ) ) { + .\build.ps1 -VisualStudioVersion $env:TARGET.Substring(2, 4) -Configuration $env:CONFIGURATION -Platform $env:PLATFORM -PythonPath $env:PYTHON_PATH -VSToolsOptions "--extend-with-x64 --no-python-dll" } +- ps: If ( ( "vs2017", "vs2019", "vs2022", "vs2022-vsdebug", "vs2022-x64" ).Contains( $env:TARGET ) ) { + .\build.ps1 -VisualStudioVersion $env:TARGET.Substring(2, 4) -Configuration $env:CONFIGURATION -Platform $env:PLATFORM -PythonPath $env:PYTHON_PATH -VSToolsOptions "--extend-with-x64 --no-python-dll --with-dokany" } +- ps: If ($env:TARGET -eq "vs2022-python") { + .\build.ps1 -VisualStudioVersion $env:TARGET.Substring(2, 4) -Configuration $env:CONFIGURATION -Platform $env:PLATFORM -PythonPath $env:PYTHON_PATH -VSToolsOptions "--extend-with-x64 --python-path $env:PYTHON_PATH --with-dokany" } - sh: if test ${BUILD_ENVIRONMENT} = "xcode"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; tests/build.sh ${CONFIGURE_OPTIONS}; fi - cmd: if [%BUILD_ENVIRONMENT%]==[python] ( "%PYTHON%" setup.py bdist_wheel ) - sh: if test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make >/dev/null && tox -e${TOXENV}; fi - cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] ( xcopy /i /q /s C:\projects\libsmdev C:\cygwin64\home\appveyor\libsmdev && - C:\cygwin64\bin\bash -e -l -c "cd libsmdev && wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' && wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'" && + C:\cygwin64\bin\bash -e -l -c "cd libsmdev && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'" && C:\cygwin64\bin\bash -e -l -c "cd libsmdev && tests/build.sh ${CONFIGURE_OPTIONS}" ) - cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] ( xcopy /i /q /s C:\projects\libsmdev C:\msys64\home\appveyor\libsmdev && @@ -208,9 +239,12 @@ test_script: C:\msys64\usr\bin\bash -l -c "cd libsmdev && tests/runtests.sh" ) after_test: +- cmd: if [%TARGET%]==[cygwin64-gcc-no-optimization] ( + C:\cygwin64\bin\bash -e -l -c "cd libsmdev && for DIRECTORY in `find . -maxdepth 1 -type d`; do (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) done" && + C:\projects\codecov.exe -R \cygwin64\home\appveyor\libsmdev --name %TARGET% ) - cmd: if [%TARGET%]==[mingw-w64-gcc-no-optimization] ( - copy C:\projects\codecov-bash\codecov C:\msys64\home\appveyor\libsmdev\codecov.sh && - C:\msys64\usr\bin\bash -e -l -c "cd libsmdev && chmod a+x ./codecov.sh && ./codecov.sh -n ${TARGET}" ) + C:\msys64\usr\bin\bash -e -l -c "cd libsmdev && for DIRECTORY in `find . -maxdepth 1 -type d`; do (cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) done" && + C:\projects\codecov.exe -R \msys64\home\appveyor\libsmdev --name %TARGET% ) artifacts: - path: dist\*.whl diff --git a/autogen.sh b/autogen.sh index 48276a3..83f54ea 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,7 @@ #!/bin/sh # Script to generate ./configure using the autotools # -# Version: 20220709 +# Version: 20230405 EXIT_SUCCESS=0; EXIT_FAILURE=1; @@ -133,7 +133,7 @@ else exit $?; fi - ${ACLOCAL} --force -I m4; + ${ACLOCAL} --force --install -I m4; if test $? -ne 0; then exit $?; diff --git a/build.ps1 b/build.ps1 index 7c446c2..5a40f66 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,12 +1,12 @@ # Script that builds libsmdev # -# Version: 20200130 +# Version: 20230411 Param ( [string]$Configuration = ${Env:Configuration}, [string]$Platform = ${Env:Platform}, [string]$PlatformToolset = "", - [string]$PythonPath = "C:\Python37", + [string]$PythonPath = "C:\Python311", [string]$VisualStudioVersion = "", [string]$VSToolsOptions = "--extend-with-x64", [string]$VSToolsPath = "..\vstools" @@ -32,7 +32,7 @@ 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" + $Output = Invoke-Expression -Command "${Git} clone ${GitUrl} ${VSToolsPath} 2>&1" | %{ "$_" } } Else { @@ -41,7 +41,7 @@ Else Try { # Make sure vstools are up to date. - $Output = Invoke-Expression -Command "${Git} pull 2>&1" + $Output = Invoke-Expression -Command "${Git} pull 2>&1" | %{ "$_" } } Finally { @@ -56,11 +56,11 @@ If (-Not (Test-Path ${MSVSCppConvert})) } If (-Not ${VisualStudioVersion}) { - $VisualStudioVersion = "2019" + $VisualStudioVersion = "2022" Write-Host "Visual Studio version not set defauting to: ${VisualStudioVersion}" -foreground Red } -If ((${VisualStudioVersion} -ne "2008") -And (${VisualStudioVersion} -ne "2010") -And (${VisualStudioVersion} -ne "2012") -And (${VisualStudioVersion} -ne "2013") -And (${VisualStudioVersion} -ne "2015") -And (${VisualStudioVersion} -ne "2017") -And (${VisualStudioVersion} -ne "2019")) +If ((${VisualStudioVersion} -ne "2008") -And (${VisualStudioVersion} -ne "2010") -And (${VisualStudioVersion} -ne "2012") -And (${VisualStudioVersion} -ne "2013") -And (${VisualStudioVersion} -ne "2015") -And (${VisualStudioVersion} -ne "2017") -And (${VisualStudioVersion} -ne "2019") -And (${VisualStudioVersion} -ne "2022")) { Write-Host "Unsupported Visual Studio version: ${VisualStudioVersion}" -foreground Red @@ -86,17 +86,25 @@ ElseIf (${VisualStudioVersion} -eq "2015") } ElseIf (${VisualStudioVersion} -eq "2017") { - $Results = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\*\MSBuild\15.0\Bin\MSBuild.exe" -Recurse -ErrorAction SilentlyContinue -Force + $Results = Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\${VisualStudioVersion}\*\MSBuild\15.0\Bin\MSBuild.exe" -Recurse -ErrorAction SilentlyContinue -Force + If ($Results.Count -eq 0) + { + $Results = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio\${VisualStudioVersion}\*\MSBuild\15.0\Bin\MSBuild.exe" -Recurse -ErrorAction SilentlyContinue -Force + } If ($Results.Count -gt 0) { $MSBuild = $Results[0].FullName } } -ElseIf (${VisualStudioVersion} -eq "2019") +ElseIf (${VisualStudioVersion} -eq "2019" -Or ${VisualStudioVersion} -eq "2022") { - $Results = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio\2019\*\MSBuild\Current\Bin\MSBuild.exe" -Recurse -ErrorAction SilentlyContinue -Force + $Results = Get-ChildItem -Path "C:\Program Files\Microsoft Visual Studio\${VisualStudioVersion}\*\MSBuild\Current\Bin\MSBuild.exe" -Recurse -ErrorAction SilentlyContinue -Force + If ($Results.Count -eq 0) + { + $Results = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio\${VisualStudioVersion}\*\MSBuild\Current\Bin\MSBuild.exe" -Recurse -ErrorAction SilentlyContinue -Force + } If ($Results.Count -gt 0) { $MSBuild = $Results[0].FullName @@ -127,7 +135,7 @@ Else { ${Env:PYTHONPATH} = ${VSToolsPath} - Invoke-Expression -Command "& '${Python}' ${MSVSCppConvert} --output-format ${VisualStudioVersion} ${VSToolsOptions} msvscpp\libsmdev.sln 2>&1 | %{ '$_' }" + Invoke-Expression -Command "& '${Python}' ${MSVSCppConvert} --output-format ${VisualStudioVersion} ${VSToolsOptions} msvscpp\libsmdev.sln 2>&1" | %{ "$_" } } } $VSSolutionFile = "${VSSolutionPath}\libsmdev.sln" @@ -166,6 +174,10 @@ If (-Not ${PlatformToolset}) { $PlatformToolset = "v142" } + ElseIf (${VisualStudioVersion} -eq "2022") + { + $PlatformToolset = "v143" + } Write-Host "PlatformToolset not set defauting to: ${PlatformToolset}" } $MSBuildOptions = "/verbosity:quiet /target:Build /property:Configuration=${Configuration},Platform=${Platform}" @@ -176,11 +188,11 @@ If (${PlatformToolset}) } If (${Env:APPVEYOR} -eq "True") { - Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${VSSolutionFile} /logger:'C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll'"; + Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${VSSolutionFile} /logger:'C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll' 2>&1" | %{ "$_" } } Else { - Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${VSSolutionFile}" + Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${VSSolutionFile} 2>&1" | %{ "$_" } } Exit ${ExitSuccess} diff --git a/common/config_winapi.h b/common/config_winapi.h index 2628caf..2fb1c9b 100644 --- a/common/config_winapi.h +++ b/common/config_winapi.h @@ -45,7 +45,10 @@ #endif /* Define the size of size_t for WINAPI + * Do not define when pyconfig.h has been included via python.h */ +#if !defined( HAVE_PYCONFIG_H ) + #if !defined( SIZEOF_SIZE_T ) #if __WORDSIZE == 64 #define SIZEOF_SIZE_T 8 @@ -54,6 +57,8 @@ #endif #endif +#endif /* !defined( HAVE_PYCONFIG_H ) */ + /* Define the size of the wide character for WINAPI */ #if !defined( SIZEOF_WCHAR_T ) diff --git a/common/types.h.in b/common/types.h.in index 86cbeb7..1d8ff33 100644 --- a/common/types.h.in +++ b/common/types.h.in @@ -60,7 +60,10 @@ typedef int system_integer_t; #endif /* defined( WINAPI ) && ( defined( _UNICODE ) || defined( UNICODE ) ) */ /* Fallback for systems without PRI definitions + * Do not define when pyconfig.h has been included via python.h */ +#if !defined( HAVE_PYCONFIG_H ) + #if !defined( PRId8 ) #define PRId8 "d" #endif @@ -216,6 +219,8 @@ typedef int system_integer_t; #endif #endif /* !defined( PRIx64 ) */ +#endif /* !defined( HAVE_PYCONFIG_H ) */ + /* Fallback for systems without printf %jd definition */ #if defined( HAVE_PRINTF_JD ) diff --git a/configure.ac b/configure.ac index ce88939..d959fcb 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.71]) AC_INIT( [libsmdev], - [20230217], + [20230504], [joachim.metz@gmail.com]) AC_CONFIG_SRCDIR( diff --git a/runtests.sh b/runtests.sh index 78560b9..32115f4 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Script that runs the tests # -# Version: 20220819 +# Version: 20230410 EXIT_SUCCESS=0; EXIT_FAILURE=1; diff --git a/setup.py b/setup.py index b06f7cc..afd9215 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # # Script to build and install Python-bindings. -# Version: 20221217 +# Version: 20230411 from __future__ import print_function @@ -95,6 +95,7 @@ def run(self): compiler = new_compiler(compiler=self.compiler) if compiler.compiler_type == "msvc": self.define = [ + ("_CRT_SECURE_NO_WARNINGS", ""), ("UNICODE", ""), ] diff --git a/tests/test_library.ps1 b/tests/test_library.ps1 index bfd92ab..1361a2b 100644 --- a/tests/test_library.ps1 +++ b/tests/test_library.ps1 @@ -1,6 +1,6 @@ # Tests library functions and types. # -# Version: 20200427 +# Version: 20230410 $ExitSuccess = 0 $ExitFailure = 1 @@ -16,11 +16,11 @@ Function GetTestExecutablesDirectory { $TestExecutablesDirectory = "" - ForEach (${VSDirectory} in "msvscpp vs2008 vs2010 vs2012 vs2013 vs2015 vs2017 vs2019" -split " ") + ForEach (${VSDirectory} in ("msvscpp", "vs2008", "vs2010", "vs2012", "vs2013", "vs2015", "vs2017", "vs2019", "vs2022")) { - ForEach (${VSConfiguration} in "Release VSDebug" -split " ") + ForEach (${VSConfiguration} in ("Release", "VSDebug")) { - ForEach (${VSPlatform} in "Win32 x64" -split " ") + ForEach (${VSPlatform} in ("Win32", "x64")) { $TestExecutablesDirectory = "..\${VSDirectory}\${VSConfiguration}\${VSPlatform}" diff --git a/tests/test_library.sh b/tests/test_library.sh index a4afaf1..82820e7 100755 --- a/tests/test_library.sh +++ b/tests/test_library.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Tests library functions and types. # -# Version: 20200705 +# Version: 20230410 EXIT_SUCCESS=0; EXIT_FAILURE=1; diff --git a/tests/test_manpage.sh b/tests/test_manpage.sh index 9246cf2..4abb656 100755 --- a/tests/test_manpage.sh +++ b/tests/test_manpage.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Tests man pages. # -# Version: 20190302 +# Version: 20230410 EXIT_SUCCESS=0; EXIT_FAILURE=1; diff --git a/tests/test_python_module.sh b/tests/test_python_module.sh index 8bcd06c..ed8f923 100755 --- a/tests/test_python_module.sh +++ b/tests/test_python_module.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Tests Python module functions and types. # -# Version: 20200705 +# Version: 20230410 EXIT_SUCCESS=0; EXIT_FAILURE=1; diff --git a/tests/test_runner.sh b/tests/test_runner.sh index 4580f73..6313971 100644 --- a/tests/test_runner.sh +++ b/tests/test_runner.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Bash functions to run an executable for testing. # -# Version: 20220924 +# Version: 20230410 # # When CHECK_WITH_ASAN is set to a non-empty value the test executable # is run with asan, otherwise it is run without. diff --git a/tests/test_smdevinfo.ps1 b/tests/test_smdevinfo.ps1 index 556020b..35f5240 100644 --- a/tests/test_smdevinfo.ps1 +++ b/tests/test_smdevinfo.ps1 @@ -1,6 +1,6 @@ # Info tool testing script # -# Version: 20200726 +# Version: 20230410 $ExitSuccess = 0 $ExitFailure = 1 @@ -16,11 +16,11 @@ Function GetTestExecutablesDirectory { $TestExecutablesDirectory = "" - ForEach (${VSDirectory} in "msvscpp vs2008 vs2010 vs2012 vs2013 vs2015 vs2017 vs2019" -split " ") + ForEach (${VSDirectory} in ("msvscpp", "vs2008", "vs2010", "vs2012", "vs2013", "vs2015", "vs2017", "vs2019", "vs2022")) { - ForEach (${VSConfiguration} in "Release VSDebug" -split " ") + ForEach (${VSConfiguration} in ("Release", "VSDebug")) { - ForEach (${VSPlatform} in "Win32 x64" -split " ") + ForEach (${VSPlatform} in ("Win32", "x64")) { $TestExecutablesDirectory = "..\${VSDirectory}\${VSConfiguration}\${VSPlatform}" diff --git a/tests/test_smdevinfo.sh b/tests/test_smdevinfo.sh index 421f34e..4a733b8 100755 --- a/tests/test_smdevinfo.sh +++ b/tests/test_smdevinfo.sh @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env bash # Info tool testing script # -# Version: 20230107 +# Version: 20230410 EXIT_SUCCESS=0; EXIT_FAILURE=1;