#!/bin/bash

set -euo pipefail

if [ -z $PLATFORM ]; then
    echo "PLATFORM must be set."
    exit 1
fi

if [ -z $COVERAGE ]; then
    COVERAGE=OFF
fi

cmake -H. -Bbuild -DPLATFORM=$PLATFORM -DCOVERAGE=$COVERAGE
cmake --build build

# Test on iOS is still unsupported.
if [[ $(perl -e "print lc('$PLATFORM');") != "ios" ]]; then
   cd build
   ctest --output-on-failure
fi

#!/bin/bash

set -euo pipefail

[[ "${COVERAGE:-}" ]] || COVERAGE=OFF

cmake -H. -Bbuild -DPLATFORM=$PLATFORM -DCOVERAGE=$COVERAGE
cmake --build build

# Test on iOS is still unsupported.
if [[ $(perl -e "print lc('$PLATFORM');") != "ios" ]]; then
   cd build
   ctest --output-on-failure
fi

Fix the way unbound variable is checked
CI: Fix the way unbound variable is checked
