source: mod_gnutls/test/newtest @ 1b07bd1

asyncio
Last change on this file since 1b07bd1 was 1b07bd1, checked in by Fiona Klute <fiona.klute@…>, 8 months ago

newtest: Let the user amend the test name if rejected

  • Property mode set to 100755
File size: 821 bytes
Line 
1#!/bin/bash
2
3tname="${1// /_}"
4
5confirmed=0
6
7while [ "$confirmed" -eq 0 ]; do
8    read -e -p "describe your new test briefly: " -i "${tname}" TEST_NAME
9    tname="${TEST_NAME// /_}"
10
11    declare -i newnum=0
12    while [ -d tests/$(printf "%02d_*" "${newnum}") ]; do
13        newnum=$((newnum + 1))
14    done
15    newname="$(printf "%02d_%s" "${newnum}" "$tname")"
16
17    read -p "your new test will be named tests/$newname. OK? [Y/n]"
18    if [ "$REPLY" == "" ] || [ "${REPLY/Y/y}" == "y" ]; then
19        confirmed=1
20    fi
21done
22
23cp -a tests/00_basic "tests/$newname"
24# derive script name, the actual script will be generated by make
25newscript="test-${newname}.bash"
26
27echo "You can now edit ${newname}."
28echo "Run the test with TESTS=\"${newscript}\" make -e check."
29echo "When ready, add ${newscript} to test_scripts in Makefile.am."
Note: See TracBrowser for help on using the repository browser.