From a05f0d5839186a498ee1b8cf74e8a01c26c90539 Mon Sep 17 00:00:00 2001 From: Verena Reimund <reimund@ill.eu> Date: Wed, 7 Nov 2018 16:03:34 +0100 Subject: [PATCH] Add test parameter file Refs #23947 --- Framework/Algorithms/CMakeLists.txt | 1 + .../Algorithms/test/SampleLogsBehaviourTest.h | 50 +++++++++++++++++++ .../SampleLogsBehaviour_Parameters.xml | 47 +++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 Framework/Algorithms/test/SampleLogsBehaviourTest.h create mode 100644 instrument/IDFs_for_UNIT_TESTING/SampleLogsBehaviour_Parameters.xml diff --git a/Framework/Algorithms/CMakeLists.txt b/Framework/Algorithms/CMakeLists.txt index 00b6f25d0e4..006777990fe 100644 --- a/Framework/Algorithms/CMakeLists.txt +++ b/Framework/Algorithms/CMakeLists.txt @@ -935,6 +935,7 @@ set ( TEST_FILES ResizeRectangularDetectorTest.h RingProfileTest.h RunCombinationHelperTest.h + SampleLogsBehaviourTest.h SANSCollimationLengthEstimatorTest.h SassenaFFTTest.h ScaleTest.h diff --git a/Framework/Algorithms/test/SampleLogsBehaviourTest.h b/Framework/Algorithms/test/SampleLogsBehaviourTest.h new file mode 100644 index 00000000000..f5e92a8aad4 --- /dev/null +++ b/Framework/Algorithms/test/SampleLogsBehaviourTest.h @@ -0,0 +1,50 @@ +// Mantid Repository : https://github.com/mantidproject/mantid +// +// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI, +// NScD Oak Ridge National Laboratory, European Spallation Source +// & Institut Laue - Langevin +// SPDX - License - Identifier: GPL - 3.0 + +#ifndef MANTID_ALGORITHMS_SAMPLELOGSBEHAVIOURTEST_H_ +#define MANTID_ALGORITHMS_SAMPLELOGSBEHAVIOURTEST_H_ + +#include <cxxtest/TestSuite.h> + +#include "MantidAPI/FrameworkManager.h" +#include "MantidAlgorithms/RunCombinationHelpers/SampleLogsBehaviour.h" + +#include "MantidAPI/Axis.h" +#include "MantidAPI/ITableWorkspace.h" +#include "MantidAPI/MatrixWorkspace.h" +#include "MantidAPI/WorkspaceFactory.h" +#include "MantidAlgorithms/CreateSampleWorkspace.h" +#include "MantidAlgorithms/GroupWorkspaces.h" +#include "MantidGeometry/Instrument/DetectorInfo.h" +#include "MantidHistogramData/HistogramDx.h" +#include "MantidKernel/UnitFactory.h" +#include "MantidKernel/make_cow.h" +#include "MantidTestHelpers/WorkspaceCreationHelper.h" + +using Mantid::Algorithms::CreateSampleWorkspace; +using Mantid::Algorithms::GroupWorkspaces; +using Mantid::Algorithms::SampleLogsBehaviour; +using namespace Mantid::API; +using namespace Mantid::DataObjects; +using namespace Mantid::HistogramData; +using namespace Mantid::Kernel; +using namespace WorkspaceCreationHelper; + +class SampleLogsBehaviourTest : public CxxTest::TestSuite { +public: + // This pair of boilerplate methods prevent the suite being created statically + // This means the constructor isn't called when running other tests + static SampleLogsBehaviourTest *createSuite() { + return new SampleLogsBehaviourTest(); + } + static void destroySuite(SampleLogsBehaviourTest *suite) { delete suite; } + + +private: + +}; + +#endif /* MANTID_ALGORITHMS_SAMPLELOGSBEHAVIOURTEST_H_ */ diff --git a/instrument/IDFs_for_UNIT_TESTING/SampleLogsBehaviour_Parameters.xml b/instrument/IDFs_for_UNIT_TESTING/SampleLogsBehaviour_Parameters.xml new file mode 100644 index 00000000000..08aba75b5ac --- /dev/null +++ b/instrument/IDFs_for_UNIT_TESTING/SampleLogsBehaviour_Parameters.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<parameter-file instrument="FIGARO" valid-from="2018-11-07 12:00:00"> + + <component-link name="FIGARO"> + <!-- MergeRuns behavior when merging sample logs. --> + <parameter name="sample_logs_sum" type="string"> + <value val="" /> + </parameter> + <parameter name="sample_logs_time_series" type="string"> + <value val="" /> + </parameter> + <parameter name="sample_logs_warn" type="string"> + <value val="" /> + </parameter> + <parameter name="sample_logs_warn_tolerances" type="string"> + <value val="" /> + </parameter> + <parameter name="sample_logs_fail" type="string"> + <value val="A, B, C" /> + </parameter> + <parameter name="sample_logs_fail_tolerances" type="string"> + <value val="0" /> + </parameter> + <!-- ConjoinXRuns behavior when merging sample logs when using Stitch1D or Stitch1DMany. --> + <parameter name="conjoin_sample_logs_sum" type="string"> + <value val="" /> + </parameter> + <parameter name="conjoin_sample_logs_time_series" type="string"> + <value val="" /> + </parameter> + <parameter name="conjoin_sample_logs_list" type="string"> + <value val="A, B, C" /> + </parameter> + <parameter name="conjoin_sample_logs_warn" type="string"> + <value val="" /> + </parameter> + <parameter name="conjoin_sample_logs_warn_tolerances" type="string"> + <value val="" /> + </parameter> + <parameter name="conjoin_sample_logs_fail" type="string"> + <value val="" /> + </parameter> + <parameter name="conjoin_sample_logs_fail_tolerances" type="string"> + <value val="" /> + </parameter> + </component-link> +</parameter-file> -- GitLab