Merge commit '62e8601919faca57a0fa4be1a910458390450cc9' as 'third_party/variant'

This commit is contained in:
Patrick Niklaus
2016-03-24 21:32:27 +01:00
51 changed files with 15816 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
@ECHO OFF
SETLOCAL
SET PATH=c:\python27;%PATH%
ECHO activating VS command prompt
IF /I "%PLATFORM"=="x64" (
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
) ELSE (
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
)
IF NOT EXIST deps\gyp git clone --quiet --depth 1 https://chromium.googlesource.com/external/gyp.git deps/gyp
CALL deps\gyp\gyp.bat variant.gyp --depth=. ^
-f msvs ^
-G msvs_version=2015 ^
--generator-output=build
SET MSBUILD_PLATFORM=%platform%
IF /I "%MSBUILD_PLATFORM%" == "x86" SET MSBUILD_PLATFORM=Win32
msbuild ^
build\variant.sln ^
/nologo ^
/toolsversion:14.0 ^
/p:PlatformToolset=v140 ^
/p:Configuration=%configuration% ^
/p:Platform=%MSBUILD_PLATFORM%
build\"%configuration%"\tests.exe
+7
View File
@@ -0,0 +1,7 @@
@ECHO OFF
SETLOCAL
SET platform=x64
SET configuration=Release
CALL scripts\build-appveyor.bat
+50
View File
@@ -0,0 +1,50 @@
#!/bin/sh
#
# Try to compile all programs in the test/compilation_failure directory.
# Compilation must fail and the error message must match the pattern in the
# corresponding .pattern file.
#
DIR="test/compilation_failure"
CXX=${CXX:-clang++}
if [ `uname -s` = "Darwin" ]; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi
error_msg() {
if [ ! -z "$1" ]; then
printf 'output was:\n=======\n%s\n=======\n' "$1"
fi
}
exit_code=0
for test_code in $DIR/*.cpp; do
name=`basename $test_code .cpp`
result=`${CXX} -std=c++11 -c -o /dev/null -I. ${CXXFLAGS} ${test_code} 2>&1`
status=$?
if [ $status = 1 ]; then
expected=`sed -n -e '/@EXPECTED/s/.*: \+//p' ${test_code}`
if echo $result | grep -q "$expected"; then
echo "$name [OK]"
else
echo "$name [FAILED - wrong error message]"
echo "Expected error message: $expected"
error_msg "$result"
exit_code=1
fi
elif [ $status = 0 ]; then
echo "$name [FAILED - compile was successful]"
error_msg "$result"
exit_code=1
else
echo "$name [FAILED - unknown error in compile]"
error_msg "$result"
exit_code=1
fi
done
exit ${exit_code}