#! /bin/bash
#
# debian/tests/entry-point-scripts
# Part of Debian ‘python-coverage’ package.
#
# This is free software, and you are welcome to redistribute it under
# certain conditions; see the end of this file for copyright
# information, grant of license, and disclaimer of warranty.

# Simple test for entry-point scripts.

set -o errexit
set -o errtrace
set -o nounset

COMMAND_TEMPLATE='%s-coverage'

interpreter_names=(
        'python'
        'python3' 'python2'
)

test_input_path="$(mktemp -t --suffix=".py")"
cat > "$test_input_path" <<_EOF_
print("Hello, world!")
_EOF_

for interpreter_name in "${interpreter_names[@]}" ; do
    command="$(printf "$COMMAND_TEMPLATE" "$interpreter_name")"
    printf "Entry point script: ‘%s’\n" "$command"
    $command run "$test_input_path"
    printf "\n"
done


# Copyright © 2016–2018 Ben Finney <bignose@debian.org>
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 3 of that license or any later version.
# No warranty expressed or implied.


# Local variables:
# coding: utf-8
# mode: shell-script
# End:
# vim: fileencoding=utf-8 filetype=sh :
