Skip to content

Commit

Permalink
Re #7692. Add comments stating where helpers can & can't be used.
Browse files Browse the repository at this point in the history
The test helpers should not be used in a way that breaks our package
dependency hierarchy, but this has been happening on occasion.
These comments give guidance on that and will hopefully be spotted
when someone is about to do something they shouldn't!
  • Loading branch information
RussellTaylor committed Aug 7, 2013
1 parent 6427891 commit d90ff8c
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 21 deletions.
@@ -1,3 +1,8 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY ONLY be included from a test in the MDAlgorithms package.
*********************************************************************************/
#ifndef MANTID_MDALGORITHMS_BINARYOPERATIONMDTESTHELPER_H_
#define MANTID_MDALGORITHMS_BINARYOPERATIONMDTESTHELPER_H_

Expand Down
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below API
* (e.g. Kernel, Geometry).
* Conversely, this file MAY NOT be modified to use anything from a package higher
* than API (e.g. any algorithm or concrete workspace), even if via the factory.
*********************************************************************************/
#ifndef MANTID_TESTHELPERS_BOXCONTROLLER_DUMMUY_IO_H
#define MANTID_TESTHELPERS_BOXCONTROLLER_DUMMUY_IO_H

Expand Down Expand Up @@ -100,4 +108,4 @@ namespace MantidTestHelpers
};

}
#endif
#endif
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below Geometry
* (e.g. Kernel).
* Conversely, this file (and its cpp) MAY NOT be modified to use anything from a
* package higher than Geometry (e.g. API, DataObjects, ...)
*********************************************************************************/
#ifndef COMPONENTCREATIONHELPER_H_
#define COMPONENTCREATIONHELPER_H_

Expand Down
@@ -1,3 +1,8 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This file MAY NOT be modified to use anything from a package other than Kernel.
*********************************************************************************/
#ifndef TESTHELPERS_FACILITYHELPER_H_
#define TESTHELPERS_FACILITYHELPER_H_

Expand Down
@@ -1,27 +1,17 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below Geometry
* (i.e. Kernel).
* Conversely, this file MAY NOT be modified to use anything from a package higher
* than API (e.g. any algorithm or concrete workspace), even if via the factory.
*********************************************************************************/
#ifndef FAKEGMOCKOBJECTS_H_
#define FAKEGMOCKOBJECTS_H_

/*
* FakeObjects.h: Fake Tester objects for APITest
*
* Created on: Jul 5, 2011
* Author: Janik Zikovsky
*/

#include "MantidAPI/ISpectrum.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidKernel/cow_ptr.h"
#include "MantidAPI/NumericAxis.h"
#include "MantidGeometry/Instrument.h"
#include "MantidGeometry/Instrument/DetectorGroup.h"
#include "MantidGeometry/Instrument/INearestNeighboursFactory.h"
#include "gmock/gmock.h"
#include <iostream>
#include <fstream>
#include <map>

using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace Mantid;


Expand Down
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below API
* (e.g. Kernel, Geometry).
* Conversely, this file MAY NOT be modified to use anything from a package higher
* than API (e.g. any algorithm or concrete workspace), even if via the factory.
*********************************************************************************/
#ifndef FAKEOBJECTS_H_
#define FAKEOBJECTS_H_

Expand Down
@@ -1,3 +1,9 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below the level of
* MDEvents (e.g. Kernel, Geometry, API, DataObjects).
*********************************************************************************/
#ifndef MDEVENTSTEST_HELPER_H
#define MDEVENTSTEST_HELPER_H

Expand Down
@@ -1,3 +1,10 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below the level of
* DataHandling (e.g. Kernel, Geometry, API, DataObjects).
* I.e. It can only be used by plugin/algorithm-level packages (e.g. DataHandling)
*********************************************************************************/
#ifndef SANSINSTRUMENTCREATIONHELPER_H_
#define SANSINSTRUMENTCREATIONHELPER_H_

Expand Down
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This header MAY NOT be included in any test from a package below DataObjects
* (e.g. Kernel, Geometry, API).
* Conversely, this file (and its cpp) MAY NOT be modified to use anything from a
* package higher than DataObjects (e.g. any algorithm), even if via the factory.
*********************************************************************************/
#ifndef WORKSPACECREATIONHELPER_H_
#define WORKSPACECREATIONHELPER_H_
//------------------------------------------------------------------------------
Expand Down
@@ -1,4 +1,8 @@

/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* These functions MAY ONLY be used in a test in the MDAlgorithms package.
*********************************************************************************/
#include "MantidAPI/IMDEventWorkspace.h"
#include "MantidDataObjects/WorkspaceSingleValue.h"
#include "MantidKernel/System.h"
Expand Down
10 changes: 9 additions & 1 deletion Code/Mantid/Framework/TestHelpers/src/BoxControllerDummyIO.cpp
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This collection of functions MAY NOT be used in any test from a package below
* API (e.g. Kernel, Geometry).
* Conversely, this file MAY NOT be modified to use anything from a package higher
* than API (e.g. any algorithm or concrete workspace), even if via the factory.
*********************************************************************************/
#include "MantidTestHelpers/BoxControllerDummyIO.h"
#include "MantidKernel/Exception.h"

Expand Down Expand Up @@ -160,4 +168,4 @@ namespace MantidTestHelpers
this->closeFile();
}

}
}
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This collection of functions MAY NOT be used in any test from a package below
* Geometry (e.g. Kernel).
* Conversely, this file MAY NOT be modified to use anything from a package
* higher than Geometry (e.g. API, DataObjects, ...)
*********************************************************************************/
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
Expand Down
7 changes: 7 additions & 0 deletions Code/Mantid/Framework/TestHelpers/src/MDEventsTestHelper.cpp
@@ -1,3 +1,10 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This collection of functions MAY NOT be used in any test from a package below
* the level of MDEvents (e.g. Kernel, Geometry, API, DataObjects).
*********************************************************************************/

#include "MantidAPI/MatrixWorkspace.h"
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidDataObjects/EventWorkspace.h"
Expand Down
@@ -1,3 +1,10 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This collection of functions MAY NOT be used in any test from a package below
* the level of DataHandling (e.g. Kernel, Geometry, API, DataObjects).
* I.e. It can only be used by plugin/algorithm-level packages (e.g. DataHandling)
*********************************************************************************/
#include "MantidTestHelpers/SANSInstrumentCreationHelper.h"
#include "MantidTestHelpers/WorkspaceCreationHelper.h"
#include "MantidAPI/AnalysisDataService.h"
Expand Down
@@ -1,3 +1,11 @@
/*********************************************************************************
* PLEASE READ THIS!!!!!!!
*
* This collection of functions MAY NOT be used in any test from a package below
* DataObjects (e.g. Kernel, Geometry, API).
* Conversely, this file MAY NOT be modified to use anything from a package higher
* than DataObjects (e.g. any algorithm), even if going via the factory.
*********************************************************************************/
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
Expand Down

0 comments on commit d90ff8c

Please sign in to comment.