#!/bin/sh

set -e

# cd to the directory containing this crate's Cargo.toml so that we don't need
# to pass --manifest-path to every `cargo` command.
cd "$(dirname "$0")"

cargo build --verbose
(cd ctest && \
    "${CC:-cc}" -o test solidity_capi_test.c -Wall -I../include -L../../../target/debug -lsolar_capi && \
    LD_LIBRARY_PATH=../../../target/debug ./test)
