#!/bin/sh

set -e

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

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

using namespace cvc5;

int main ()
{
    Solver slv;
    Term helloworld = slv.mkConst(slv.getBooleanSort(), "Hello World!");
    std::cout << helloworld << " is " << slv.checkSatAssuming(helloworld)
              << std::endl;
    return 0;
}
EOF

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

./hello-world > output
echo "|Hello World!| is sat" > expected
diff expected output
