main
Last change
on this file was
59328d0,
checked in by Fiona Klute <fiona.klute@…>, 2 years ago
|
newtest: Style cleanup
|
-
Property mode set to
100755
|
File size:
823 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | tname="${1// /_}" |
---|
4 | |
---|
5 | confirmed=0 |
---|
6 | |
---|
7 | while [ "${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 [ -z "${REPLY}" ] || [ "${REPLY,}" == "y" ]; then |
---|
19 | confirmed=1 |
---|
20 | fi |
---|
21 | done |
---|
22 | |
---|
23 | cp -a tests/00_basic "tests/${newname}" |
---|
24 | # derive script name, the actual script will be generated by make |
---|
25 | newscript="test-${newname}.bash" |
---|
26 | |
---|
27 | echo "You can now edit ${newname}." |
---|
28 | echo "Run the test with TESTS=\"${newscript}\" make -e check." |
---|
29 | echo "When ready, add ${newscript} to test_scripts in Makefile.am." |
---|
Note: See
TracBrowser
for help on using the repository browser.