Actual source code: ex54.c

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

  3: #include <petscsys.h>
  4: #include <petscviewer.h>

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

 16: /*TEST

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

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

 37: TEST*/