Actual source code: ex54.c

  1: static char help[] = "Tests options file parsing.\n\n";

  3: #include <petscsys.h>

  5: int main(int argc, char **argv)
  6: {
  7:   /* this is listed first so that it gets into the database before the errors are created */
  8:   PetscCall(PetscOptionsSetValue(NULL, "-error_output_stdout", NULL));
  9:   PetscFunctionBeginUser;
 10:   PetscCall(PetscInitialize(&argc, &argv, "ex54options", help));
 11:   PetscCall(PetscFinalize());
 12:   return 0;
 13: }

 15: /*TEST

 17:    test:
 18:       suffix: 0
 19:       localrunfiles: ex54options
 20:       args: -options_left 0 -options_view

 22:    testset:
 23:       TODO: occasionally randomly produces errors in CI, very difficult to debug, the wasted time out-weighs keeping this test in the CI
 24:       args: -options_left 0 -options_view
 25:       test:
 26:         suffix: 1
 27:         localrunfiles: ex54options ex54options_1a_wrong ex54options_1b_wrong ex54options_1c_wrong ex54options_1d_wrong ex54options_1e_wrong ex54options_1f_wrong ex54options_1g_wrong
 28:         args: -options_file {{ex54options_1a_wrong ex54options_1b_wrong ex54options_1c_wrong ex54options_1d_wrong ex54options_1e_wrong ex54options_1f_wrong ex54options_1g_wrong}separate output}
 29:         # Some machines use the fullpath in the program name, so filter with " ex54options" and not "ex54options"
 30:         filter: Error: grep -E " ex54options"
 31:       test:
 32:         suffix: 1_options_file-ex54options_1h
 33:         localrunfiles: ex54options ex54options_1h
 34:         args: -options_file ex54options_1h

 36: TEST*/