Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
testing.tools.test_runner._TestCaseRunner Class Reference
+ Collaboration diagram for testing.tools.test_runner._TestCaseRunner:

Public Member Functions

 __init__ (self, test_case)
 
 __enter__ (self)
 
 __exit__ (self, exc_type, exc_value, traceback)
 
 options (self)
 
 test_id (self)
 
 working_dir (self)
 
 IsResultSuppressed (self)
 
 IsImageDiffSuppressed (self)
 
 GetImageMatchingAlgorithm (self)
 
 RunCommand (self, command, stdout=None)
 
 GenerateAndTest (self, test_function)
 
 Generate (self)
 
 TestText (self)
 
 TestPixel (self)
 

Public Attributes

 test_case = test_case
 
 test_result = None
 
int duration_start = 0
 
 source_dir = os.path.join(_per_process_state.font_dir, 'ahem')
 
 input_filename
 
 pdf_path = os.path.join(self.working_dir, f'{self.test_id}.pdf')
 
 actual_images = None
 
int test_result = time.perf_counter_ns() - self.duration_start
 
 working_dir
 
list actual_images
 

Protected Member Functions

 _RegenerateIfNeeded (self)
 
 _VerifyEmptyText (self, txt_path)
 
 _NewImageArtifact (self, *, image_path, md5_hash)
 
 _CleanupPixelTest (self)
 

Detailed Description

Runner for a single test case.

Definition at line 517 of file test_runner.py.

Constructor & Destructor Documentation

◆ __init__()

testing.tools.test_runner._TestCaseRunner.__init__ ( self,
test_case )

Definition at line 520 of file test_runner.py.

Member Function Documentation

◆ __enter__()

testing.tools.test_runner._TestCaseRunner.__enter__ ( self)

◆ __exit__()

testing.tools.test_runner._TestCaseRunner.__exit__ ( self,
exc_type,
exc_value,
traceback )

◆ _CleanupPixelTest()

testing.tools.test_runner._TestCaseRunner._CleanupPixelTest ( self)
protected

◆ _NewImageArtifact()

testing.tools.test_runner._TestCaseRunner._NewImageArtifact ( self,
* ,
image_path,
md5_hash )
protected

Definition at line 801 of file test_runner.py.

References ImageWithBindOptions.options, language::SignalSlot.options, PrintOut::Box.options, QAbstractFileIconEngine.options(), QAbstractFileIconProvider.options(), QAbstractFileIconProviderPrivate.options, QAbstractPrintDialogPrivate.options, QAuthenticator.options(), QAuthenticatorPrivate.options, QCocoaIntegration.options(), QColorDialog.options, QColorDialog.options(), QColorDialogOptionsPrivate.options, QColorDialogPrivate.options, QFileDialog.options, QFileDialog.options(), QFileDialogArgs.options, QFileDialogOptions.options(), QFileDialogOptionsPrivate.options, QFileDialogPrivate.options, QFileSystemModel.options, QFileSystemModel.options(), QFontDialog.options, QFontDialog.options(), QFontDialogOptions.options(), QFontDialogOptionsPrivate.options, QFontDialogPrivate.options, QInputDialog.options(), QMdiAreaPrivate.options, QMdiSubWindowPrivate.options, QMessageBox.options, QMessageBox.options(), QMessageBoxPrivate.options, QMessageDialogOptions.options(), QMessageDialogOptionsPrivate.options, QMinimalIntegration.options(), QOpenGLCachedTexture.options(), QPdfPageRendererPrivate::PageRequest.options, QPlatformColorDialogHelper.options(), QPlatformFileDialogHelper.options(), QPlatformFontDialogHelper.options(), QPlatformMessageDialogHelper.options(), QPrintDialog.options, QPrintDialog.options(), QPrintDialogPrivate.options, QQmlJS::Dom::AstDumper.options, QQmlJS::Dom::ConstantData.options(), QQmlJS::Dom::DomEnvironment.options(), QQmlJS::Dom::FormatPartialStatus.options, QQmlJS::Dom::LineWriter.options(), QQnxIntegration.options(), QQuickColorDialog.options, QQuickColorDialog.options(), QQuickColorDialogImpl.options(), QQuickColorDialogImplPrivate.options, QQuickFileDialog.options, QQuickFileDialog.options(), QQuickFileDialogImpl.options(), QQuickFileDialogImplPrivate.options, QQuickFileNameFilter.options(), QQuickFolderDialog.options, QQuickFolderDialog.options(), QQuickFolderDialogImpl.options(), QQuickFolderDialogImplPrivate.options, QQuickFontDialog.options, QQuickFontDialog.options(), QQuickFontDialogImpl.options(), QQuickFontDialogImplPrivate.options, QQuickLabsPlatformColorDialog.options, QQuickLabsPlatformColorDialog.options(), QQuickLabsPlatformFileDialog.options, QQuickLabsPlatformFileDialog.options(), QQuickLabsPlatformFileNameFilter.options(), QQuickLabsPlatformFolderDialog.options, QQuickLabsPlatformFolderDialog.options(), QQuickLabsPlatformFontDialog.options, QQuickLabsPlatformFontDialog.options(), QQuickMessageDialogImpl.options(), QQuickMessageDialogImplPrivate.options, QQuickPixmapKey.options, QSSGBufferManager::MeshData.options, QSSGQmlUtilities::OutputContext.options, QStorageIterator.options(), QSurfaceFormat.options(), QSvgHandler.options(), QSvgRenderer.options, QSvgRenderer.options(), QSvgRendererPrivate.options, QSvgTinyDocument.options(), QSvgWidget.options(), QWaylandKeymap.options, QWaylandKeymap.options(), QWindowsIntegration.options(), QWindowsOpenGLContextFormat.options, QWindowsTabletSupport.options(), QWizard.options, QWizard.options(), testing.tools.test_runner._PerProcessConfig.options, testing.tools.test_runner._PerProcessState.options, testing.tools.test_runner._TestCaseRunner.options(), and testing.tools.test_runner.TestRunner.options().

◆ _RegenerateIfNeeded()

testing.tools.test_runner._TestCaseRunner._RegenerateIfNeeded ( self)
protected

Definition at line 631 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner.input_filename, testing.tools.suppressor.Suppressor.IsImageDiffSuppressed(), testing.tools.test_runner._TestCaseRunner.IsImageDiffSuppressed(), testing.tools.suppressor.Suppressor.IsResultSuppressed(), testing.tools.test_runner._TestCaseRunner.IsResultSuppressed(), testing.tools.test_runner.TestRunner.IsResultSuppressed(), ImageWithBindOptions.options, language::SignalSlot.options, PrintOut::Box.options, QAbstractFileIconEngine.options(), QAbstractFileIconProvider.options(), QAbstractFileIconProviderPrivate.options, QAbstractPrintDialogPrivate.options, QAuthenticator.options(), QAuthenticatorPrivate.options, QCocoaIntegration.options(), QColorDialog.options, QColorDialog.options(), QColorDialogOptionsPrivate.options, QColorDialogPrivate.options, QFileDialog.options, QFileDialog.options(), QFileDialogArgs.options, QFileDialogOptions.options(), QFileDialogOptionsPrivate.options, QFileDialogPrivate.options, QFileSystemModel.options, QFileSystemModel.options(), QFontDialog.options, QFontDialog.options(), QFontDialogOptions.options(), QFontDialogOptionsPrivate.options, QFontDialogPrivate.options, QInputDialog.options(), QMdiAreaPrivate.options, QMdiSubWindowPrivate.options, QMessageBox.options, QMessageBox.options(), QMessageBoxPrivate.options, QMessageDialogOptions.options(), QMessageDialogOptionsPrivate.options, QMinimalIntegration.options(), QOpenGLCachedTexture.options(), QPdfPageRendererPrivate::PageRequest.options, QPlatformColorDialogHelper.options(), QPlatformFileDialogHelper.options(), QPlatformFontDialogHelper.options(), QPlatformMessageDialogHelper.options(), QPrintDialog.options, QPrintDialog.options(), QPrintDialogPrivate.options, QQmlJS::Dom::AstDumper.options, QQmlJS::Dom::ConstantData.options(), QQmlJS::Dom::DomEnvironment.options(), QQmlJS::Dom::FormatPartialStatus.options, QQmlJS::Dom::LineWriter.options(), QQnxIntegration.options(), QQuickColorDialog.options, QQuickColorDialog.options(), QQuickColorDialogImpl.options(), QQuickColorDialogImplPrivate.options, QQuickFileDialog.options, QQuickFileDialog.options(), QQuickFileDialogImpl.options(), QQuickFileDialogImplPrivate.options, QQuickFileNameFilter.options(), QQuickFolderDialog.options, QQuickFolderDialog.options(), QQuickFolderDialogImpl.options(), QQuickFolderDialogImplPrivate.options, QQuickFontDialog.options, QQuickFontDialog.options(), QQuickFontDialogImpl.options(), QQuickFontDialogImplPrivate.options, QQuickLabsPlatformColorDialog.options, QQuickLabsPlatformColorDialog.options(), QQuickLabsPlatformFileDialog.options, QQuickLabsPlatformFileDialog.options(), QQuickLabsPlatformFileNameFilter.options(), QQuickLabsPlatformFolderDialog.options, QQuickLabsPlatformFolderDialog.options(), QQuickLabsPlatformFontDialog.options, QQuickLabsPlatformFontDialog.options(), QQuickMessageDialogImpl.options(), QQuickMessageDialogImplPrivate.options, QQuickPixmapKey.options, QSSGBufferManager::MeshData.options, QSSGQmlUtilities::OutputContext.options, QStorageIterator.options(), QSurfaceFormat.options(), QSvgHandler.options(), QSvgRenderer.options, QSvgRenderer.options(), QSvgRendererPrivate.options, QSvgTinyDocument.options(), QSvgWidget.options(), QWaylandKeymap.options, QWaylandKeymap.options(), QWindowsIntegration.options(), QWindowsOpenGLContextFormat.options, QWindowsTabletSupport.options(), QWizard.options, QWizard.options(), testing.tools.test_runner._PerProcessConfig.options, testing.tools.test_runner._PerProcessState.options, testing.tools.test_runner._TestCaseRunner.options(), testing.tools.test_runner.TestRunner.options(), testing.tools.test_runner._PerProcessState.source_dir, and testing.tools.test_runner._TestCaseRunner.source_dir.

◆ _VerifyEmptyText()

testing.tools.test_runner._TestCaseRunner._VerifyEmptyText ( self,
txt_path )
protected

Definition at line 695 of file test_runner.py.

References open(), and testing.tools.test_runner._TestCaseRunner.test_case.

Referenced by testing.tools.test_runner._TestCaseRunner.TestText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Generate()

testing.tools.test_runner._TestCaseRunner.Generate ( self)

Definition at line 642 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner.pdf_path, testing.tools.test_runner._TestCaseRunner.RunCommand(), testing.tools.test_runner._PerProcessState.source_dir, testing.tools.test_runner._TestCaseRunner.source_dir, and testing.tools.test_runner._TestCaseRunner.test_case.

Referenced by testing.tools.test_runner._TestCaseRunner.GenerateAndTest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateAndTest()

testing.tools.test_runner._TestCaseRunner.GenerateAndTest ( self,
test_function )
Generate test input and run pdfium_test.

Definition at line 623 of file test_runner.py.

References Config.Generate, CPP::WriteInitialization::Item::ItemData.Generate, and testing.tools.test_runner._TestCaseRunner.Generate().

+ Here is the call graph for this function:

◆ GetImageMatchingAlgorithm()

testing.tools.test_runner._TestCaseRunner.GetImageMatchingAlgorithm ( self)

◆ IsImageDiffSuppressed()

testing.tools.test_runner._TestCaseRunner.IsImageDiffSuppressed ( self)

Definition at line 557 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner.input_filename.

Referenced by testing.tools.test_runner._TestCaseRunner._RegenerateIfNeeded().

+ Here is the caller graph for this function:

◆ IsResultSuppressed()

testing.tools.test_runner._TestCaseRunner.IsResultSuppressed ( self)

Definition at line 553 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner.input_filename.

Referenced by testing.tools.test_runner._TestCaseRunner._RegenerateIfNeeded(), testing.tools.test_runner.TestRunner._SuppressStatus(), testing.tools.test_runner.TestRunner.HandleResult(), and testing.tools.test_runner._TestCaseRunner.TestText().

+ Here is the caller graph for this function:

◆ options()

◆ RunCommand()

testing.tools.test_runner._TestCaseRunner.RunCommand ( self,
command,
stdout = None )
Runs a test command.

Args:
  command: The list of command arguments.
  stdout: Optional `file`-like object to send standard output.

Returns:
  The test result.

Definition at line 565 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner.test_case.

Referenced by testing.tools.test_runner._TestCaseRunner.Generate(), and testing.tools.test_runner._TestCaseRunner.TestText().

+ Here is the caller graph for this function:

◆ test_id()

testing.tools.test_runner._TestCaseRunner.test_id ( self)

Definition at line 546 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner.test_case.

Referenced by testing.tools.test_runner.TestCase.NewResult().

+ Here is the caller graph for this function:

◆ TestPixel()

testing.tools.test_runner._TestCaseRunner.TestPixel ( self)

Definition at line 709 of file test_runner.py.

◆ TestText()

testing.tools.test_runner._TestCaseRunner.TestText ( self)

Definition at line 659 of file test_runner.py.

References testing.tools.test_runner._TestCaseRunner._VerifyEmptyText(), testing.tools.suppressor.Suppressor.IsResultSuppressed(), testing.tools.test_runner._TestCaseRunner.IsResultSuppressed(), testing.tools.test_runner.TestRunner.IsResultSuppressed(), open(), ImageWithBindOptions.options, language::SignalSlot.options, PrintOut::Box.options, QAbstractFileIconEngine.options(), QAbstractFileIconProvider.options(), QAbstractFileIconProviderPrivate.options, QAbstractPrintDialogPrivate.options, QAuthenticator.options(), QAuthenticatorPrivate.options, QCocoaIntegration.options(), QColorDialog.options, QColorDialog.options(), QColorDialogOptionsPrivate.options, QColorDialogPrivate.options, QFileDialog.options, QFileDialog.options(), QFileDialogArgs.options, QFileDialogOptions.options(), QFileDialogOptionsPrivate.options, QFileDialogPrivate.options, QFileSystemModel.options, QFileSystemModel.options(), QFontDialog.options, QFontDialog.options(), QFontDialogOptions.options(), QFontDialogOptionsPrivate.options, QFontDialogPrivate.options, QInputDialog.options(), QMdiAreaPrivate.options, QMdiSubWindowPrivate.options, QMessageBox.options, QMessageBox.options(), QMessageBoxPrivate.options, QMessageDialogOptions.options(), QMessageDialogOptionsPrivate.options, QMinimalIntegration.options(), QOpenGLCachedTexture.options(), QPdfPageRendererPrivate::PageRequest.options, QPlatformColorDialogHelper.options(), QPlatformFileDialogHelper.options(), QPlatformFontDialogHelper.options(), QPlatformMessageDialogHelper.options(), QPrintDialog.options, QPrintDialog.options(), QPrintDialogPrivate.options, QQmlJS::Dom::AstDumper.options, QQmlJS::Dom::ConstantData.options(), QQmlJS::Dom::DomEnvironment.options(), QQmlJS::Dom::FormatPartialStatus.options, QQmlJS::Dom::LineWriter.options(), QQnxIntegration.options(), QQuickColorDialog.options, QQuickColorDialog.options(), QQuickColorDialogImpl.options(), QQuickColorDialogImplPrivate.options, QQuickFileDialog.options, QQuickFileDialog.options(), QQuickFileDialogImpl.options(), QQuickFileDialogImplPrivate.options, QQuickFileNameFilter.options(), QQuickFolderDialog.options, QQuickFolderDialog.options(), QQuickFolderDialogImpl.options(), QQuickFolderDialogImplPrivate.options, QQuickFontDialog.options, QQuickFontDialog.options(), QQuickFontDialogImpl.options(), QQuickFontDialogImplPrivate.options, QQuickLabsPlatformColorDialog.options, QQuickLabsPlatformColorDialog.options(), QQuickLabsPlatformFileDialog.options, QQuickLabsPlatformFileDialog.options(), QQuickLabsPlatformFileNameFilter.options(), QQuickLabsPlatformFolderDialog.options, QQuickLabsPlatformFolderDialog.options(), QQuickLabsPlatformFontDialog.options, QQuickLabsPlatformFontDialog.options(), QQuickMessageDialogImpl.options(), QQuickMessageDialogImplPrivate.options, QQuickPixmapKey.options, QSSGBufferManager::MeshData.options, QSSGQmlUtilities::OutputContext.options, QStorageIterator.options(), QSurfaceFormat.options(), QSvgHandler.options(), QSvgRenderer.options, QSvgRenderer.options(), QSvgRendererPrivate.options, QSvgTinyDocument.options(), QSvgWidget.options(), QWaylandKeymap.options, QWaylandKeymap.options(), QWindowsIntegration.options(), QWindowsOpenGLContextFormat.options, QWindowsTabletSupport.options(), QWizard.options, QWizard.options(), testing.tools.test_runner._PerProcessConfig.options, testing.tools.test_runner._PerProcessState.options, testing.tools.test_runner._TestCaseRunner.options(), testing.tools.test_runner.TestRunner.options(), testing.tools.test_runner._TestCaseRunner.pdf_path, testing.tools.test_runner._TestCaseRunner.RunCommand(), testing.tools.test_runner._PerProcessState.source_dir, testing.tools.test_runner._TestCaseRunner.source_dir, testing.tools.test_runner._PerProcessState.working_dir, testing.tools.test_runner._TestCaseRunner.working_dir(), and testing.tools.test_runner._TestCaseRunner.working_dir.

◆ working_dir()

testing.tools.test_runner._TestCaseRunner.working_dir ( self)

Definition at line 550 of file test_runner.py.

Referenced by testing.tools.test_runner._TestCaseRunner.TestText().

+ Here is the caller graph for this function:

Member Data Documentation

◆ actual_images [1/2]

testing.tools.test_runner._TestCaseRunner.actual_images = None

◆ actual_images [2/2]

list testing.tools.test_runner._TestCaseRunner.actual_images
Initial value:
= [
_per_process_state.pdfium_test_path, '--send-events', '--png', '--md5',
f'--time={TEST_SEED_TIME}'
]

Definition at line 711 of file test_runner.py.

Referenced by testing.tools.test_runner._TestCaseRunner._CleanupPixelTest().

◆ duration_start

int testing.tools.test_runner._TestCaseRunner.duration_start = 0

Definition at line 523 of file test_runner.py.

Referenced by testing.tools.test_runner._TestCaseRunner.__enter__().

◆ input_filename

◆ pdf_path

testing.tools.test_runner._TestCaseRunner.pdf_path = os.path.join(self.working_dir, f'{self.test_id}.pdf')

◆ source_dir

testing.tools.test_runner._TestCaseRunner.source_dir = os.path.join(_per_process_state.font_dir, 'ahem')

◆ test_case

◆ test_result [1/2]

testing.tools.test_runner._TestCaseRunner.test_result = None

Definition at line 522 of file test_runner.py.

Referenced by testing.tools.test_runner._TestCaseRunner.__exit__().

◆ test_result [2/2]

int testing.tools.test_runner._TestCaseRunner.test_result = time.perf_counter_ns() - self.duration_start

Definition at line 536 of file test_runner.py.

Referenced by testing.tools.test_runner._TestCaseRunner.__exit__().

◆ working_dir

testing.tools.test_runner._TestCaseRunner.working_dir

Definition at line 639 of file test_runner.py.

Referenced by testing.tools.test_runner._TestCaseRunner.TestText().


The documentation for this class was generated from the following file: