Ticket #1899 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Write a helper class that constructs an example instrument for use in unit tests

Reported by: Russell Taylor Owned by: Janik Zikovsky
Priority: critical Milestone: Iteration 26
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Russell Taylor

Description

This will be used in any test of an algorithm that requires an instrument to be defined on the workspace, in place of loading a data file or even an instrument xml file.

The class should directly construct a dummy instrument from the Geometry C++ API. This should include source, sample and monitor(s) in sensible positions and a selection of detectors/banks of various types/shapes. It could be configurable such that the calling client could choose the distances and types of detectors.

Once complete, methods could be added to WorkspaceHelper.hh to construct a full workspace including an instrument and a spectraDetectorMap. However, this should not be made the default because we want to keep our unit tests as lean as possible and plenty of them do not require any instrument information.

Change History

comment:1 Changed 10 years ago by Nick Draper

  • Status changed from new to assigned
  • Owner set to Russell Taylor

comment:2 Changed 10 years ago by Janik Zikovsky

  • Owner changed from Russell Taylor to Janik Zikovsky
  • Status changed from assigned to accepted

comment:3 Changed 10 years ago by Janik Zikovsky

Create in Geometry/test/....hh

comment:4 Changed 10 years ago by Janik Zikovsky

(In [7580]) Refs #1899: Extended the ComponentCreationHelpers class

comment:5 Changed 10 years ago by Janik Zikovsky

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:6 Changed 10 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:7 Changed 10 years ago by Russell Taylor

  • Status changed from verifying to closed

This turned out to be mostly already there in Geometry/test/ComponentCreationHelpers.hh. Janik extended it for his needs and others can do the same as required. Wiki updated.

comment:8 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2746

Note: See TracTickets for help on using tickets.