#!/bin/sh

. "$(dirname $0)/common.sh"

prepare

cd "$AUTOPKGTEST_TMP"

# skip failing tests on specific architectures
if [ "$(dpkg-architecture -qDEB_BUILD_ARCH)" = "armhf" ]; then
    sed -i '/^\s\+it "put_u\?long_long(/a    skip "skip for autopkgtest"' spec/ffi/buffer_spec.rb
    sed -i '/^\s\+it "Struct#layout works with :name, :type, offset tuples" do/a    skip "skip for autopkgtest"' spec/ffi/struct_spec.rb
    sed -i '/^\s\+it "Struct#layout works with mixed :name,:type and :name,:type,offset" do/a    skip "skip for autopkgtest"' spec/ffi/struct_spec.rb
fi

# run the rspec testsuite
jruby -S rake spec:ffi
