#!/usr/bin/env bash

# Copyright (C) Lightbend Inc. <https://www.lightbend.com>

# shellcheck source=scripts/scriptLib
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/scriptLib"

cd "$BASEDIR"

# Don't build first, let sbt automatically build any dependencies that
# are needed when we run the microbenchmarks. This should be quicker
# than doing an explicit publish step.

start validate "VALIDATING MICROBENCHMARKS"

# Just run single iteration of microbenchmark to test that they
# run properly. The results will be inaccurate, but this ensures that
# the microbenchmarks at least compile and run.

# We are using double-double quotes here so that the command
# is passed to runSbt as a single command and internally be
# passed to sbt as a single command too.
# foe = FailOnError http://mail.openjdk.java.net/pipermail/jmh-dev/2015-February/001685.html
runSbt "Play-Microbenchmark/jmh:run -i 1 -wi 0 -f 1 -t 1 -foe=true"

end validate "BENCHMARKS VALIDATED"
