File: vtkTestingRenderingDriver.cmake

package info (click to toggle)
vtk9 9.5.2%2Bdfsg4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,616 kB
  • sloc: cpp: 2,340,827; ansic: 327,116; python: 114,881; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; javascript: 1,261; makefile: 189; objc: 153; tcl: 59
file content (102 lines) | stat: -rw-r--r-- 2,827 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
SET(_VTK_FLT_EXCEPTIONS "vtkFloatingPointExceptions::Enable()")
IF(${DISABLE_FLOATING_POINT_EXCEPTIONS})
  SET(_VTK_FLT_EXCEPTIONS "vtkFloatingPointExceptions::Disable()")
ENDIF()

SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN
"
    vtksys::SystemInformation::SetStackTraceOnError(1);
#ifndef NDEBUG
    ${_VTK_FLT_EXCEPTIONS};
#endif

    // Set defaults
    vtkTestingInteractor::ValidBaseline = \"Use_-V_for_Baseline\";
    vtkTestingInteractor::TempDirectory =
      std::string(\"${_vtk_build_TEST_OUTPUT_DIRECTORY}\");
    vtkTestingInteractor::DataDirectory = std::string(\"Use_-D_for_Data\");

    int interactive = 0;
    for (int ii = 0; ii < ac; ++ii)
    {
      if (strcmp(av[ii], \"-I\") == 0)
      {
        interactive = 1;
        continue;
      }
      if (ii < ac-1 && strcmp(av[ii], \"-V\") == 0)
      {
        vtkTestingInteractor::ValidBaseline = std::string(av[++ii]);
        continue;
      }
      if (ii < ac-1 && strcmp(av[ii], \"-T\") == 0)
      {
        vtkTestingInteractor::TempDirectory = std::string(av[++ii]);
        continue;
      }
      if (ii < ac-1 && strcmp(av[ii], \"-D\") == 0)
      {
        vtkTestingInteractor::DataDirectory = std::string(av[++ii]);
        continue;
      }
      if (ii < ac-1 && strcmp(av[ii], \"-E\") == 0)
      {
        vtkTestingInteractor::ErrorThreshold = atof(av[++ii]);
        continue;
      }
      if (ii < ac-1 && strcmp(av[ii], \"-v\") == 0)
      {
        vtkLogger::SetStderrVerbosity(static_cast<vtkLogger::Verbosity>(atoi(av[++ii])));
        continue;
      }
    }

    // init logging
    vtkLogger::Init(ac, av, nullptr);

    // turn on windows stack traces if applicable
    vtkWindowsTestUtilitiesSetupForTesting();

    vtkSmartPointer<vtkTestingObjectFactory> factory = vtkSmartPointer<vtkTestingObjectFactory>::New();
    if (!interactive)
    {
      // Disable any other overrides before registering our factory.
      vtkObjectFactoryCollection *collection = vtkObjectFactory::GetRegisteredFactories();
      collection->InitTraversal();
      vtkObjectFactory *f = collection->GetNextItem();
      while (f)
      {
        f->Disable(\"vtkRenderWindowInteractor\");
        f = collection->GetNextItem();
      }
      vtkObjectFactory::RegisterFactory(factory);
    }
"
)

SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN
"
  if (result == VTK_SKIP_RETURN_CODE)
  {
    printf(\"Unsupported runtime configuration: Test returned \"
           \"VTK_SKIP_RETURN_CODE. Skipping test.\\n\");
    return result;
  }

  if (!interactive)
  {
    if (vtkTestingInteractor::TestReturnStatus != -1)
    {
      if (vtkTestingInteractor::TestReturnStatus != vtkTesting::PASSED)
      {
        result = EXIT_FAILURE;
      }
      else
      {
        result = EXIT_SUCCESS;
      }
    }
    vtkObjectFactory::UnRegisterFactory(factory);
  }
"
)