File: module-scripts

package info (click to toggle)
python-coverage 6.5.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,580 kB
  • sloc: python: 25,471; ansic: 1,152; javascript: 1,104; makefile: 253; sh: 107; xml: 48
file content (47 lines) | stat: -rw-r--r-- 1,240 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /bin/bash
#
# debian/tests/module-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 module scripts.

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

COMMAND_TEMPLATE='%s -m coverage'

interpreter_name=(
        'python3'
        $(py3versions --supported)
)

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 "Module script: ‘%s’\n" "$command"
    $command run "$test_input_path"
    printf "\n"
done


# Copyright © 2016–2022 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 :