#!/bin/sh

echo "${TEST_NAME} -- test whether Python wrapper works when copied (instead of symlinked)"

set -- ${PYTHON_IMPLS}

while true; do
	if [ ${#} -lt 1 ]; then
		echo 'No Python implementation installed (?!)' >&2
		do_exit 77
	fi

	# we have to have the proper Python version installed
	if "${1}" --version >&2; then
		break
	fi
	shift
done

export EPYTHON=${1}

write_impl "${EPYTHON}" "import sys; sys.exit(0)"

# replace with a copy
rm "${TEST_DIR}/${TEST_TMP}"
cp "${TEST_DIR}/python-exec2" "${TEST_DIR}/${TEST_TMP}"

do_test "${EPYTHON}" "${TEST_TMP}"
