#!/bin/bash

set -e # Fail on any error.
set -x # Display commands being run.

cd github/marl

git submodule update --init

mkdir build
cd build

build_and_run() {
    cmake .. -DMARL_BUILD_EXAMPLES=1 $1
    make --jobs=$(nproc)

    ./marl-unittests
    ./fractal
}

build_and_run ""
build_and_run "-DMARL_ASAN=1"
build_and_run "-DMARL_MSAN=1"
#!/bin/bash

set -e # Fail on any error.
set -x # Display commands being run.

cd github/marl

git submodule update --init

mkdir build
cd build
cmake .. -DMARL_BUILD_EXAMPLES=1
make --jobs=$(nproc)

./marl-unittests

./fractal

--- 
+++ 
@@ -9,9 +9,15 @@
 
 mkdir build
 cd build
-cmake .. -DMARL_BUILD_EXAMPLES=1
-make --jobs=$(nproc)
 
-./marl-unittests
+build_and_run() {
+    cmake .. -DMARL_BUILD_EXAMPLES=1 $1
+    make --jobs=$(nproc)
 
-./fractal
+    ./marl-unittests
+    ./fractal
+}
+
+build_and_run ""
+build_and_run "-DMARL_ASAN=1"
+build_and_run "-DMARL_MSAN=1"
kokoro: Build and run with sanitizers
