Adding first versions of VS Studio regression tests

This commit is contained in:
Rob Falgout 2017-11-10 16:21:45 -08:00
parent 68381d22eb
commit adb349125f
2 changed files with 113 additions and 0 deletions

68
AUTOTEST/cmake.bat Executable file
View File

@ -0,0 +1,68 @@
@echo off
setlocal
rem This script can be run from anywhere
rem Example usage: cmake.bat ..\src "-DHYPRE_SEQUENTIAL=ON"
rem directory where script is being run
set rundir=%cd%
rem directory where script is located
cd %~dp0
set scriptdir=%cd%
rem source directory passed in as argument 1
cd %rundir%
cd %1
set srcdir=%cd%
rem output directory is a subdirectory of rundir
set outdir=%rundir%\cmake.dir
rem cmake options passed in as argument 2
set cmakeopts=%2
rem set location of cmake and msbuild programs
set CMAKE="C:\Program Files\CMake\bin\cmake.exe"
set MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild"
rem create clean output directory
if exist %outdir% rmdir /s /q %outdir%
mkdir %outdir%
rem clean out 'cmbuild' directories
cd %srcdir% && rmdir /s /q cmbuild & mkdir cmbuild
cd %srcdir%\test && rmdir /s /q cmbuild & mkdir cmbuild
rem run cmake for hypre library and test directory
cd %srcdir%\cmbuild
%CMAKE% -G "Visual Studio 15 2017" %cmakeopts% .. > %outdir%\lib-cmake.out
cd %srcdir%\test\cmbuild
%CMAKE% -G "Visual Studio 15 2017" %cmakeopts% .. > %outdir%\test-cmake.out
rem build release version
cd %srcdir%\cmbuild
rem %MSBUILD% HYPRE.vcxproj /t:Rebuild /p:Configuration=Release > %outdir%\lib-release.out
rem %MSBUILD% INSTALL.vcxproj /p:Configuration=Release >> %outdir%\lib-release.out
cd %srcdir%\test\cmbuild
rem %MSBUILD% ALL_BUILD.vcxproj /t:Rebuild /p:Configuration=Release > %outdir%\test-release.out
rem build debug version
cd %srcdir%\cmbuild
rem %MSBUILD% HYPRE.vcxproj /t:Rebuild /p:Configuration=Debug > %outdir%\lib-debug.out
rem %MSBUILD% INSTALL.vcxproj /p:Configuration=Debug >> %outdir%\lib-debug.out
cd %srcdir%\test\cmbuild
rem %MSBUILD% ALL_BUILD.vcxproj /t:Rebuild /p:Configuration=Release > %outdir%\test-debug.out
rem create error file - inspect output file lines with "Error(s)" substring
cd %rundir%
type NUL > cmake.err
for %%f in (%outdir%\*.out) do (
set sum=0
for /f "tokens=1" %%i in ('findstr "Error(s)" %%f') do set /a sum+=%%i
if %sum% gtr 0 @echo %%f > cmake.err
)
cd %rundir%
endlocal

45
AUTOTEST/machine-vs-pro.bat Executable file
View File

@ -0,0 +1,45 @@
@echo off
setlocal
rem This script can be run from anywhere, but must live in the same directory
rem (e.g., AUTOTEST) as supporting batch scripts like 'cmake.bat'
rem directory where script is being run
set rundir=%cd%
rem directory where script is located
cd %~dp0
set scriptdir=%cd%
rem source directory passed in as argument 1
cd %rundir%
cd %1
set srcdir=%cd%
rem output directory is a subdirectory of rundir
set outdir=%rundir%\machine-vs-pro.dir
rem create clean output directory
if exist %outdir% rmdir /s /q %outdir%
mkdir %outdir%
rem run the cmake.bat script from rundir in a subshell to avoid overwriting variables
rem (i.e., use 'cmd /c')
cd %rundir%
cmd /c %scriptdir%\cmake.bat %srcdir% "-DHYPRE_SEQUENTIAL=ON"
move %rundir%\cmake.dir %outdir%\cmake-sequential.dir
move %rundir%\cmake.err %outdir%\cmake-sequential.err
rem put more tests here...
rem create error file - check file size of cmake error files
cd %rundir%
type NUL > machine-vs-pro.err
for %%f in (%outdir%\*.err) do (
if %%~zf gtr 0 @echo %%f >> machine-vs-pro.err
)
cd %rundir%
endlocal