591 {
593 "Numerical testing interface\n");
594 try {
595 moab::Core moab_core;
597 std::unique_ptr<TestingInterface> owned_testing(
601 "Factory-created testing interface cannot be queried");
602 CHKERR owned_testing->checkValue<TestType::SCALAR>(
603 "factory-created interface", 1., 1., {0., 0.});
604 auto calls = std::make_shared<int>(0);
606 CHKERR PetscOptionsSetValue(
nullptr,
"-registry_test_nb",
"2");
607 CHKERR owned_testing->getOptions(
"registry_");
608 CHKERR owned_testing->addTestCommandLine(
"registry_", 1,
"first",
hook);
609 CHKERR owned_testing->addTestCommandLine(
"registry_", 2,
"second",
hook);
610 CHKERR owned_testing->runTests();
611 CHKERR owned_testing->checkValue<TestType::SCALAR>(
612 "number selection", *calls, 1., {0., 0.});
613 CHKERR PetscOptionsClearValue(
nullptr,
"-registry_test_nb");
614 CHKERR PetscOptionsSetValue(
nullptr,
"-registry_test_name",
"second");
615
616 CHKERR owned_testing->runTestCommandLine(
"registry_");
617 CHKERR owned_testing->getOptions(
"registry_");
618 CHKERR owned_testing->runTestCommandLine(
"registry_");
619 CHKERR owned_testing->checkValue<TestType::SCALAR>(
620 "cached and named selection", *calls, 3., {0., 0.});
621 CHKERR PetscOptionsClearValue(
nullptr,
"-registry_test_name");
622 CHKERR checkSelection(mofem_core);
623 CHKERR checkSelectedExecution(mofem_core);
624 CHKERR runTests(mofem_core);
625 }
628 return 0;
629}
#define CATCH_ERRORS
Catch errors.
@ MOFEM_ATOM_TEST_INVALID
#define CHKERR
Inline error check.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
TestingInterface * createInterface< TestingInterface >(const Core &core)
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.