From adb349125f9b92b1b64f27fc0978fa23435afc01 Mon Sep 17 00:00:00 2001 From: Rob Falgout Date: Fri, 10 Nov 2017 16:21:45 -0800 Subject: [PATCH] Adding first versions of VS Studio regression tests --- AUTOTEST/cmake.bat | 68 +++++++++++++++++++++++++++++++++++++ AUTOTEST/machine-vs-pro.bat | 45 ++++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100755 AUTOTEST/cmake.bat create mode 100755 AUTOTEST/machine-vs-pro.bat diff --git a/AUTOTEST/cmake.bat b/AUTOTEST/cmake.bat new file mode 100755 index 000000000..2851b4375 --- /dev/null +++ b/AUTOTEST/cmake.bat @@ -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 diff --git a/AUTOTEST/machine-vs-pro.bat b/AUTOTEST/machine-vs-pro.bat new file mode 100755 index 000000000..2cd69df4f --- /dev/null +++ b/AUTOTEST/machine-vs-pro.bat @@ -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