Add Kokoro presubmit scripts
diff --git a/kokoro/macos/clang-x64/cmake/presubmit.cfg b/kokoro/macos/clang-x64/cmake/presubmit.cfg
new file mode 100644
index 0000000..89357a7
--- /dev/null
+++ b/kokoro/macos/clang-x64/cmake/presubmit.cfg
@@ -0,0 +1,14 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Location of the continuous bash script in Git.
+build_file: "cppdap/kokoro/macos/presubmit.sh"
+
+env_vars {
+  key: "BUILD_SYSTEM"
+  value: "cmake"
+}
+
+env_vars {
+  key: "BUILD_TARGET_ARCH"
+  value: "x64"
+}
diff --git a/kokoro/macos/presubmit.sh b/kokoro/macos/presubmit.sh
new file mode 100755
index 0000000..cdf9eb1
--- /dev/null
+++ b/kokoro/macos/presubmit.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e # Fail on any error.
+set -x # Display commands being run.
+
+BUILD_ROOT=$PWD
+
+cd github/cppdap
+
+git submodule update --init
+
+if [ "$BUILD_SYSTEM" == "cmake" ]; then
+    mkdir build
+    cd build
+
+    cmake .. -DCPPDAP_BUILD_EXAMPLES=1 -DCPPDAP_BUILD_TESTS=1 -DCPPDAP_WARNINGS_AS_ERRORS=1
+    make -j$(sysctl -n hw.logicalcpu)
+
+    ./cppdap-unittests
+else
+    echo "Unknown build system: $BUILD_SYSTEM"
+    exit 1
+fi
\ No newline at end of file
diff --git a/kokoro/ubuntu/gcc-x64/cmake/asan/presubmit.cfg b/kokoro/ubuntu/gcc-x64/cmake/asan/presubmit.cfg
new file mode 100644
index 0000000..f4657cc
--- /dev/null
+++ b/kokoro/ubuntu/gcc-x64/cmake/asan/presubmit.cfg
@@ -0,0 +1,19 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Location of the continuous bash script in Git.
+build_file: "cppdap/kokoro/ubuntu/presubmit.sh"
+
+env_vars {
+  key: "BUILD_SYSTEM"
+  value: "cmake"
+}
+
+env_vars {
+  key: "BUILD_TARGET_ARCH"
+  value: "x64"
+}
+
+env_vars {
+  key: "BUILD_SANITIZER"
+  value: "asan"
+}
diff --git a/kokoro/ubuntu/gcc-x64/cmake/presubmit.cfg b/kokoro/ubuntu/gcc-x64/cmake/presubmit.cfg
new file mode 100644
index 0000000..55afbc2
--- /dev/null
+++ b/kokoro/ubuntu/gcc-x64/cmake/presubmit.cfg
@@ -0,0 +1,14 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Location of the continuous bash script in Git.
+build_file: "cppdap/kokoro/ubuntu/presubmit.sh"
+
+env_vars {
+  key: "BUILD_SYSTEM"
+  value: "cmake"
+}
+
+env_vars {
+  key: "BUILD_TARGET_ARCH"
+  value: "x64"
+}
diff --git a/kokoro/ubuntu/gcc-x64/cmake/tsan/presubmit.cfg b/kokoro/ubuntu/gcc-x64/cmake/tsan/presubmit.cfg
new file mode 100644
index 0000000..3899026
--- /dev/null
+++ b/kokoro/ubuntu/gcc-x64/cmake/tsan/presubmit.cfg
@@ -0,0 +1,19 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Location of the continuous bash script in Git.
+build_file: "cppdap/kokoro/ubuntu/presubmit.sh"
+
+env_vars {
+  key: "BUILD_SYSTEM"
+  value: "cmake"
+}
+
+env_vars {
+  key: "BUILD_TARGET_ARCH"
+  value: "x64"
+}
+
+env_vars {
+  key: "BUILD_SANITIZER"
+  value: "tsan"
+}
diff --git a/kokoro/ubuntu/presubmit.sh b/kokoro/ubuntu/presubmit.sh
new file mode 100755
index 0000000..402b814
--- /dev/null
+++ b/kokoro/ubuntu/presubmit.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+set -e # Fail on any error.
+set -x # Display commands being run.
+
+BUILD_ROOT=$PWD
+
+cd github/cppdap
+
+git submodule update --init
+
+if [ "$BUILD_SYSTEM" == "cmake" ]; then
+    mkdir build
+    cd build
+
+    build_and_run() {
+        cmake .. -DCPPDAP_BUILD_EXAMPLES=1 -DCPPDAP_BUILD_TESTS=1 -DCPPDAP_WARNINGS_AS_ERRORS=1 $1
+        make --jobs=$(nproc)
+
+        ./cppdap-unittests
+    }
+
+    if [ "$BUILD_SANITIZER" == "asan" ]; then
+        build_and_run "-DCPPDAP_ASAN=1"
+    elif [ "$BUILD_SANITIZER" == "msan" ]; then
+        build_and_run "-DCPPDAP_MSAN=1"
+    elif [ "$BUILD_SANITIZER" == "tsan" ]; then
+        build_and_run "-DCPPDAP_TSAN=1"
+    else
+        build_and_run
+    fi
+else
+    echo "Unknown build system: $BUILD_SYSTEM"
+    exit 1
+fi
\ No newline at end of file
diff --git a/kokoro/windows/msvc-14.14-x64/cmake/presubmit.cfg b/kokoro/windows/msvc-14.14-x64/cmake/presubmit.cfg
new file mode 100644
index 0000000..70acce5
--- /dev/null
+++ b/kokoro/windows/msvc-14.14-x64/cmake/presubmit.cfg
@@ -0,0 +1,19 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Location of the continuous bash script in Git.
+build_file: "cppdap/kokoro/windows/presubmit.bat"
+
+env_vars {
+  key: "BUILD_SYSTEM"
+  value: "cmake"
+}
+
+env_vars {
+  key: "BUILD_GENERATOR"
+  value: "Visual Studio 15 2017 Win64"
+}
+
+env_vars {
+  key: "BUILD_TARGET_ARCH"
+  value: "x64"
+}
diff --git a/kokoro/windows/msvc-14.14-x86/cmake/presubmit.cfg b/kokoro/windows/msvc-14.14-x86/cmake/presubmit.cfg
new file mode 100644
index 0000000..5c6902c
--- /dev/null
+++ b/kokoro/windows/msvc-14.14-x86/cmake/presubmit.cfg
@@ -0,0 +1,19 @@
+# Format: //devtools/kokoro/config/proto/build.proto
+
+# Location of the continuous bash script in Git.
+build_file: "cppdap/kokoro/windows/presubmit.bat"
+
+env_vars {
+  key: "BUILD_SYSTEM"
+  value: "cmake"
+}
+
+env_vars {
+  key: "BUILD_GENERATOR"
+  value: "Visual Studio 15 2017"
+}
+
+env_vars {
+  key: "BUILD_TARGET_ARCH"
+  value: "x86"
+}
diff --git a/kokoro/windows/presubmit.bat b/kokoro/windows/presubmit.bat
new file mode 100644
index 0000000..7d0a825
--- /dev/null
+++ b/kokoro/windows/presubmit.bat
@@ -0,0 +1,32 @@
+@echo on
+
+SETLOCAL ENABLEDELAYEDEXPANSION
+
+SET BUILD_ROOT=%cd%
+SET PATH=C:\python36;C:\Program Files\cmake\bin;%PATH%
+SET SRC=%cd%\github\cppdap
+
+cd %SRC%
+if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
+
+git submodule update --init
+if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
+
+SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild"
+SET CONFIG=Release
+
+mkdir %SRC%\build
+cd %SRC%\build
+if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
+
+IF /I "%BUILD_SYSTEM%"=="cmake" (
+    cmake .. -G "%BUILD_GENERATOR%" "-DCPPDAP_BUILD_TESTS=1" "-DCPPDAP_BUILD_EXAMPLES=1" "-DCPPDAP_WARNINGS_AS_ERRORS=1"
+    if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
+    %MSBUILD% /p:Configuration=%CONFIG% cppdap.sln
+    if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
+    Release\cppdap-unittests.exe
+    if !ERRORLEVEL! neq 0 exit !ERRORLEVEL!
+) ELSE (
+    echo "Unknown build system: %BUILD_SYSTEM%"
+    exit /b 1
+)