#!/bin/sh

set -e

TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
cd $TMPDIR

cat <<EOF > hello-world.cc
#include <iostream>
#include <cvc4/cvc4.h>

using namespace CVC4;

int main ()
{
    ExprManager em;
    Expr helloWorld = em.mkVar ("Hello world!", em.booleanType ());
    SmtEngine smt (&em);

    std::cout << helloWorld << " is " << smt.query (helloWorld) << std::endl;
    return 0;
}
EOF

c++ -o hello-world hello-world.cc -lcvc4 -Wno-deprecated
[ -x hello-world ]

./hello-world > output
echo "Hello world! is invalid" > expected
diff expected output
