source: mod_gnutls/test/newtest @ 9d10997

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

Fill gaps in numbering when creating new tests

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