source: mod_gnutls/test/newtest @ 73b0bf0

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since 73b0bf0 was e78bc78, checked in by Thomas Klute <thomas2.klute@…>, 5 years ago

Adjust test tools and documentation to split tests and moved test dir

Paths, descriptions and an error message were adjusted in README and
setup. A bigger change was needed in the "newtest" script, which now
creates a script for "make check" to call. This script is not
automatically added to the list of tests in Makefile.am, but the user is
advised to add it when ready.

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