Commit 3679ddc1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Dridi Boukelmoune

Make "vtest" an alias for "varnishtest" in the first line.

parent e51b6d7e
......@@ -43,6 +43,7 @@ CMD(shell)
CMD(syslog)
CMD(varnish)
CMD(varnishtest)
CMD(vtest)
#undef CMD
/*lint -restore */
......@@ -10,7 +10,7 @@ shell {
echo 'shell "exit 9"' >> _.vtc
}
shell -exit 2 -expect {doesn't start with 'varnishtest'} {
shell -exit 2 -expect {doesn't start with 'vtest' or 'varnishtest'} {
varnishtest -v _.vtc
}
......
varnishtest "Test Teken terminal emulator"
vtest "Test Teken terminal emulator"
feature cmd "vttest --version 2>&1 | grep -q Usage"
......
......@@ -547,9 +547,11 @@ read_file(const char *fn, int ntest)
return (2);
}
if (strncmp(q, "varnishtest", 11) || !isspace(q[11])) {
if ((strncmp(q, "varnishtest", 11) || !isspace(q[11])) &&
(strncmp(q, "vtest", 5) || !isspace(q[5]))) {
fprintf(stderr,
"File \"%s\" doesn't start with 'varnishtest'\n", fn);
"File \"%s\" doesn't start with"
" 'vtest' or 'varnishtest'\n", fn);
free(p);
vtc_skip++;
return(2);
......
......@@ -49,17 +49,39 @@
#include "vre.h"
#include "vtim.h"
/* SECTION: varnishtest varnishtest
/* SECTION: vtest vtest
*
* This should be the first command in your vtc as it will identify the test
* case with a short yet descriptive sentence. It takes exactly one argument, a
* string, eg::
*
* varnishtest "Check that varnishtest is actually a valid command"
* vtest "Check that vtest is actually a valid command"
*
* It will also print that string in the log.
*/
void v_matchproto_(cmd_f)
cmd_vtest(CMD_ARGS)
{
(void)priv;
(void)cmd;
(void)vl;
if (av == NULL)
return;
AZ(strcmp(av[0], "vtest"));
vtc_log(vl, 1, "TEST %s", av[1]);
AZ(av[2]);
}
/* SECTION: varnishtest varnishtest
*
* Alternate name for 'vtest', see above.
*
*/
void v_matchproto_(cmd_f)
cmd_varnishtest(CMD_ARGS)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment