#!/bin/sh

set -e

tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT

cat > "$tmpdir/test.cpp" <<'EOF'
#include <bdsg/hash_graph.hpp>
#include <bdsg/packed_graph.hpp>

int main() {
    bdsg::HashGraph hash_graph;
    auto hash_handle = hash_graph.create_handle("ACGT");
    if (hash_graph.get_sequence(hash_handle) != "ACGT") {
        return 1;
    }

    bdsg::PackedGraph packed_graph;
    auto packed_handle = packed_graph.create_handle("ACGT");
    if (packed_graph.get_sequence(packed_handle) != "ACGT") {
        return 1;
    }

    return 0;
}
EOF

g++ -std=c++20 -fopenmp "$tmpdir/test.cpp" -o "$tmpdir/test" -lbdsg -lhandlegraph -lsdsl
"$tmpdir/test"
