summaryrefslogtreecommitdiffstats
path: root/lang/python/python-cffi/test.sh
blob: 63aea5972955a13e735213e1d09efb3318e1a744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

[ "$1" = python3-cffi ] || exit 0

# cffi's cffi-gen-src CLI has no version flag, so assert the version here and
# build an FFI object to exercise the compiled C extension.
python3 - "$2" << 'EOF'
import sys
import cffi
from cffi import FFI

assert cffi.__version__ == sys.argv[1], (cffi.__version__, sys.argv[1])
ffibuilder = FFI()
EOF