pqCoreTestUtility.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
5 #ifndef pqCoreTestUtility_h
6 #define pqCoreTestUtility_h
7 
8 #include "pqCoreModule.h"
9 #include "pqTestUtility.h"
10 #include <QSize>
11 #include <QStringList>
12 #include <vtkIOStream.h>
13 
14 class pqEventPlayer;
15 class pqEventTranslator;
16 class pqView;
17 class QString;
18 class vtkImageData;
19 class vtkRenderWindow;
20 
24 class PQCORE_EXPORT pqCoreTestUtility : public pqTestUtility
25 {
26  Q_OBJECT
27  typedef pqTestUtility Superclass;
28 
29 public:
30  pqCoreTestUtility(QObject* parent = nullptr);
31  ~pqCoreTestUtility() override;
32 
37  static QString fixPath(const QString& path);
38 
43  static QString DataRoot();
44 
49  static QString TestDirectory();
50 
55  static QString BaselineDirectory();
56 
61  static bool SaveScreenshot(vtkRenderWindow* RenderWindow, const QString& File);
62 
67  static bool CompareImage(vtkRenderWindow* renderWindow, const QString& referenceImage,
68  double threshold, ostream& output, const QString& tempDirectory,
69  const QSize& size = QSize(300, 300));
70 
75  static bool CompareImage(vtkImageData* testImage, const QString& ReferenceImage, double Threshold,
76  ostream& Output, const QString& TempDirectory);
77 
78  static bool CompareImage(const QString& testPNGImage, const QString& ReferenceImage,
79  double Threshold, ostream& Output, const QString& TempDirectory);
80 
85  static bool CompareImage(QWidget* widget, const QString& referenceImage, double threshold,
86  ostream& output, const QString& tempDirectory, const QSize& size = QSize(300, 300));
87 
88  static bool CompareView(pqView* curView, const QString& referenceImage, double threshold,
89  const QString& tempDirectory, const QSize& size = QSize());
90 
91  static const char* PQ_COMPAREVIEW_PROPERTY_NAME;
92 
93  static bool CompareTile(QWidget* widget, int rank, int tdx, int tdy, const QString& baseline,
94  double threshold, ostream& output, const QString& tempDirectory);
95  static bool CompareTile(pqView* widget, int rank, int tdx, int tdy, const QString& baseline,
96  double threshold, ostream& output, const QString& tempDirectory);
97 
101  static QString cleanPath(const QString&);
102 
107  bool supportsDashboardMode() override { return true; };
108 
109 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
115  void setDashboardMode(bool value) override;
116 
121  void updatePlayers() override;
122 
127  void updateTranslators() override;
128 
129 private:
130  QStringList TestFilenames;
131 };
132 
133 #endif // !pqCoreTestUtility_h
bool supportsDashboardMode() override
Reimplemented to inform this test utility supports dashboard mode always returns true.
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
int Threshold(vtkDataSet *input, vtkUnstructuredGrid *output, vtkDataArray *field, double lower, double upper)
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
size
static const char * PQ_COMPAREVIEW_PROPERTY_NAME
value
Provides ParaView-specific functionality for regression testing.