#!/bin/sh -efux

cwd="$(readlink -ev "${0%/*}")"

cd "$cwd"

rc=0
temp="$(mktemp "@BUILDDIR@/temp.XXXXXXXXX")"

datadir="@DATADIR@"

./libkeymap-bkeymap "$datadir/"../data/keymaps/i386/qwerty/defkeymap.map > "$temp" || rc=$?
cmp -s "$datadir/data/dumpkeys-bkeymap/bkeymap.bin" "$temp" || rc=$?

if [ "$rc" != 0 ]; then
	printf 'failed\n'
else
	rm -f -- "$temp"
fi

exit $rc
