Skip to content
Snippets Groups Projects
Commit 169800bf authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Modify tests to support new option syntax.

Add --usage to sattach to quiet test16.1.
parent deccee52
No related branches found
No related tags found
No related merge requests found
...@@ -239,12 +239,13 @@ void set_options(const int argc, char **argv) ...@@ -239,12 +239,13 @@ void set_options(const int argc, char **argv)
int opt_char, option_index = 0; int opt_char, option_index = 0;
static struct option long_options[] = { static struct option long_options[] = {
{"help", no_argument, 0, 'h'}, {"help", no_argument, 0, 'h'},
{"quiet", no_argument, 0, 'Q'}, {"quiet", no_argument, 0, 'q'},
{"usage", no_argument, 0, 'u'},
{"verbose", no_argument, 0, 'v'}, {"verbose", no_argument, 0, 'v'},
{"version", no_argument, 0, 'V'}, {"version", no_argument, 0, 'V'},
{NULL} {NULL}
}; };
char *opt_string = "+hQvV"; char *opt_string = "+hquvV";
opt.progname = xbasename(argv[0]); opt.progname = xbasename(argv[0]);
optind = 0; optind = 0;
...@@ -260,9 +261,12 @@ void set_options(const int argc, char **argv) ...@@ -260,9 +261,12 @@ void set_options(const int argc, char **argv)
case 'h': case 'h':
_help(); _help();
exit(0); exit(0);
case 'Q': case 'q':
opt.quiet++; opt.quiet++;
break; break;
case 'u':
_usage();
exit(0);
case 'v': case 'v':
opt.verbose++; opt.verbose++;
break; break;
...@@ -391,8 +395,8 @@ static void _help(void) ...@@ -391,8 +395,8 @@ static void _help(void)
printf( printf(
"Help options:\n" "Help options:\n"
" -h, --help show this help message\n" " -h, --help show this help message\n"
" --usage display brief usage message\n" " -u, --usage display brief usage message\n"
"\n" "\n"
"Other options:\n" "Other options:\n"
" -V, --version output version information and exit\n" " -V, --version output version information and exit\n"
......
...@@ -53,7 +53,7 @@ make_bash_script $file_in " ...@@ -53,7 +53,7 @@ make_bash_script $file_in "
# Submit a slurm job that will execute 'pwd' # Submit a slurm job that will execute 'pwd'
# #
set job_id 0 set job_id 0
spawn $sbatch -N1 --output=$file_out --chdir=$tmp_dir -t1 $file_in spawn $sbatch -N1 --output=$file_out --workdir=$tmp_dir -t1 $file_in
expect { expect {
-re "Submitted batch job ($number)" { -re "Submitted batch job ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
......
...@@ -78,7 +78,7 @@ expect { ...@@ -78,7 +78,7 @@ expect {
# #
set job_id 0 set job_id 0
set matches 0 set matches 0
spawn $salloc -t1 -v $slaunch --slaunch-error=none -t1 $bin_sleep aaa spawn $salloc -t1 -v $slaunch --task-error=/dev/null $bin_sleep aaa
expect { expect {
-re "Pending job allocation ($number)" { -re "Pending job allocation ($number)" {
set job_id $expect_out(1,string) set job_id $expect_out(1,string)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment