diff --git a/Tests/Functional/Core/CoreStandardTest.cpp b/Tests/Functional/Core/CoreStandardTest.cpp index 301ea5f88ccd2d3b125a5c053ec5fec5d8526fb6..edf2aed4427a550867d3c53e40277b1055200f48 100644 --- a/Tests/Functional/Core/CoreStandardTest.cpp +++ b/Tests/Functional/Core/CoreStandardTest.cpp @@ -16,6 +16,7 @@ #include "IStandardTest.h" #include "CoreTest.h" +//! Provides a CoreTest through a callback mechanism explained in IStandardTest.h. class CoreStandardTest : public IStandardTest { public: @@ -24,7 +25,7 @@ public: getTestName(), getTestDescription(), getSimulation(), getTestThreshold() ); } }; -//! The main function of CoreStandardTest, to run functional tests +//! Runs CoreTest on a standard simulation indicated by argv[1]. int main(int argc, char** argv) { return CoreStandardTest().execute(argc, argv); diff --git a/Tests/Functional/Core/CoreTest.h b/Tests/Functional/Core/CoreTest.h index 4a517f0b9ba3c19cdbc13a8673c719b44c0d112c..6f9a3a3092c3f84070d55a399fcb077f64221488 100644 --- a/Tests/Functional/Core/CoreTest.h +++ b/Tests/Functional/Core/CoreTest.h @@ -23,8 +23,9 @@ class GISASSimulation; //! @class CoreTest //! @ingroup standard_samples -//! @brief Core functional test compares results of the standard simulation with -//! reference intensity data. Normally invoked by FunctionalMultiTest. +//! @brief A functional test of BornAgain/Core. +//! Performs a given standard simulation, and compares results with reference data. +//! Invoked from CoreStandardTest. class CoreTest : public IFunctionalTest { diff --git a/Tests/Functional/GUI/GUIStandardTest.cpp b/Tests/Functional/GUI/GUIStandardTest.cpp index d2821e849d3bd5fa20926bf9bb7ac9941c0af587..f6a2da827ba8aeaf96bafe4fad6c7c87cd4fb1a1 100644 --- a/Tests/Functional/GUI/GUIStandardTest.cpp +++ b/Tests/Functional/GUI/GUIStandardTest.cpp @@ -17,6 +17,7 @@ #include "IStandardTest.h" #include "GUITest.h" +//! Provides a GUITest through a callback mechanism explained in IStandardTest.h. class GUIStandardTest : public IStandardTest { public: @@ -25,7 +26,7 @@ public: getTestName(), getTestDescription(), getSimulation(), getTestThreshold()); } }; -//! The main function of GUITestStandardTest, to run functional tests +//! Runs GUITest on a standard simulation indicated by argv[1]. int main(int argc, char** argv) { return GUIStandardTest().execute(argc, argv); diff --git a/Tests/Functional/GUI/GUITest.h b/Tests/Functional/GUI/GUITest.h index d73c91e4f3b21a7016cb3d462ab9c958960d81f6..118c7aa9729209f7614538074eec8d2fe01ef80b 100644 --- a/Tests/Functional/GUI/GUITest.h +++ b/Tests/Functional/GUI/GUITest.h @@ -24,9 +24,10 @@ class GISASSimulation; //! @class GUITest //! @ingroup standard_samples -//! @brief GUI functional test compares results of the reference simulation with -//! the one obtained through domain->GUI->domain convertion. Normally invoked by -//! FunctionalMultiTest. +//! @brief A functional test of the BornAgain GUI. +//! Performs a given standard simulation directly, and through domain->GUI->domain, +//! and compares results. +//! Invoked by GUIStandardTest. class GUITest : public IFunctionalTest { diff --git a/Tests/Functional/PyCore/suite/CMakeLists.txt b/Tests/Functional/PyCore/suite/CMakeLists.txt index 93f2c1c89803e3aa4c869d48f4c47262632d805e..b6941be2b3d36138deacd57e851180c811501128 100644 --- a/Tests/Functional/PyCore/suite/CMakeLists.txt +++ b/Tests/Functional/PyCore/suite/CMakeLists.txt @@ -59,7 +59,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../TestMachinery ) -add_executable(PyCoreStandardTest PyCoreStandardTest.cpp PySuiteTest.h PySuiteTest.cpp) +add_executable(PyCoreStandardTest PyCoreStandardTest.cpp PyCoreTest.h PyCoreTest.cpp) target_link_libraries(PyCoreStandardTest BornAgainCore BornAgainTestMachinery) foreach(test_case ${test_cases}) add_test(PyCoreStandardTest/${test_case} diff --git a/Tests/Functional/PyCore/suite/PyCoreStandardTest.cpp b/Tests/Functional/PyCore/suite/PyCoreStandardTest.cpp index 6811c6c0e551b63587762b146255d1b7bd05a763..60cfc42b4b601f82d3f26c876b415e332ee5be94 100644 --- a/Tests/Functional/PyCore/suite/PyCoreStandardTest.cpp +++ b/Tests/Functional/PyCore/suite/PyCoreStandardTest.cpp @@ -14,17 +14,18 @@ // ************************************************************************** // #include "IStandardTest.h" -#include "PySuiteTest.h" +#include "PyCoreTest.h" +//! Provides a PyCoreTest through a callback mechanism explained in IStandardTest.h. class PyCoreStandardTest : public IStandardTest { public: PyCoreStandardTest() : IStandardTest("PySuite") {} - IFunctionalTest* getTest() const { return new PySuiteTest( + IFunctionalTest* getTest() const { return new PyCoreTest( getTestName(), getTestDescription(), getSimulation(), getTestThreshold()); } }; -//! The main function of PySuite, to run functional tests +//! Runs PyCoreTest on a standard simulation indicated by argv[1]. int main(int argc, char** argv) { return PyCoreStandardTest().execute(argc, argv); diff --git a/Tests/Functional/PyCore/suite/PySuiteTest.cpp b/Tests/Functional/PyCore/suite/PyCoreTest.cpp similarity index 88% rename from Tests/Functional/PyCore/suite/PySuiteTest.cpp rename to Tests/Functional/PyCore/suite/PyCoreTest.cpp index c4869bb5224d18a97a94a577de54b3189600a629..9e73a456ed6140473973d485b076a3dd5f57db15 100644 --- a/Tests/Functional/PyCore/suite/PySuiteTest.cpp +++ b/Tests/Functional/PyCore/suite/PyCoreTest.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file Core/TestMachinery/PySuiteTest.cpp -//! @brief Implements class PySuiteTest +//! @file Core/TestMachinery/PyCoreTest.cpp +//! @brief Implements class PyCoreTest //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -13,7 +13,7 @@ // // ************************************************************************** // -#include "PySuiteTest.h" +#include "PyCoreTest.h" #include "BAPython.h" #include "FileSystem.h" #include "GISASSimulation.h" @@ -25,7 +25,7 @@ #include "Utils.h" #include <fstream> -PySuiteTest::PySuiteTest( +PyCoreTest::PyCoreTest( const std::string& name, const std::string& description, GISASSimulation* reference_simulation, double threshold) : IFunctionalTest(name, description) @@ -38,20 +38,20 @@ PySuiteTest::PySuiteTest( { } -PySuiteTest::~PySuiteTest() +PyCoreTest::~PyCoreTest() { delete m_reference_simulation; delete m_domain_simulation; } -void PySuiteTest::runTest() +void PyCoreTest::runTest() { assert(m_reference_simulation); m_reference_simulation->runSimulation(); // Generate contents of Python script std::ostringstream ostr; - ostr << "# Functional test settings, generated by PySuiteTest::runTest():\n" + ostr << "# Functional test settings, generated by PyCoreTest::runTest():\n" << "import sys, os\n" << "sys.path.append('" << BUILD_LIB_DIR << "')\n\n" // << "sys.path.append(os.path.abspath(os.path.join(os.path.split(\n" @@ -71,7 +71,7 @@ void PySuiteTest::runTest() (void)script_result; // ignore return value } -int PySuiteTest::analyseResults() +int PyCoreTest::analyseResults() { const std::unique_ptr<OutputData<double> > P_domain_data( IntensityDataIOFactory::readOutputData(m_output_filename+".int")); @@ -87,7 +87,7 @@ int PySuiteTest::analyseResults() return m_result; } -void PySuiteTest::printResults(std::ostream& ostr) const +void PyCoreTest::printResults(std::ostream& ostr) const { ostr << getFormattedInfoString(); ostr << Utils::String::getScientificDoubleString(m_difference); @@ -95,7 +95,7 @@ void PySuiteTest::printResults(std::ostream& ostr) const ostr << "--> " << getPySuiteFileNameAndPath(); } -std::string PySuiteTest::getPySuiteFileNameAndPath() const +std::string PyCoreTest::getPySuiteFileNameAndPath() const { std::string result = Utils::FileSystem::GetJoinPath(FAILED_TESTS_DIR, m_pyscript_filename); diff --git a/Tests/Functional/PyCore/suite/PySuiteTest.h b/Tests/Functional/PyCore/suite/PyCoreTest.h similarity index 74% rename from Tests/Functional/PyCore/suite/PySuiteTest.h rename to Tests/Functional/PyCore/suite/PyCoreTest.h index c63e0946505ea3a67d62a512c3e79f2d7811a37b..fbc658057e5ce84db621c1d5b463dcf40ecbcd41 100644 --- a/Tests/Functional/PyCore/suite/PySuiteTest.h +++ b/Tests/Functional/PyCore/suite/PyCoreTest.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit scattering at grazing incidence // -//! @file Core/TestMachinery/PySuiteTest.h -//! @brief Declares class PySuiteTest +//! @file Core/TestMachinery/PyCoreTest.h +//! @brief Declares class PyCoreTest //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -19,16 +19,18 @@ #include "IFunctionalTest.h" // inheriting from #include "OutputData.h" -//! @class PySuiteTest +//! @class PyCoreTest //! @ingroup standard_samples -//! @brief Test whether Python dumps yields the same image as a direct computation. +//! @brief A functional test of PyCore (the Python wrapper of BornAgain/Core). +//! Performs a given standard simulation, both directly and from a Python dump. +//! Invoked from PyCoreStandardTest. -class PySuiteTest : public IFunctionalTest +class PyCoreTest : public IFunctionalTest { public: - PySuiteTest(const std::string& name, const std::string& description, + PyCoreTest(const std::string& name, const std::string& description, class GISASSimulation* reference_simulation, double threshold); - virtual ~PySuiteTest(); + virtual ~PyCoreTest(); virtual void runTest(); virtual int analyseResults(); diff --git a/Tests/Functional/TestMachinery/IFunctionalTest.h b/Tests/Functional/TestMachinery/IFunctionalTest.h index 3d24284ddd9c07b8ddc9f50a5dcf845a2f07741d..20a5222e454d29d0d6ea409c9998b0516e460160 100644 --- a/Tests/Functional/TestMachinery/IFunctionalTest.h +++ b/Tests/Functional/TestMachinery/IFunctionalTest.h @@ -21,7 +21,7 @@ //! @class IFunctionalTest //! @ingroup standard_samples -//! @brief Base class for all functional tests +//! @brief Base class for all functional tests. class IFunctionalTest : public INamed { diff --git a/Tests/Functional/TestMachinery/SimulationInfo.h b/Tests/Functional/TestMachinery/SimulationInfo.h index 1a2a41a7febac4afe8619a8118bd808c3b0ea81a..d8e199e76b7dfb5876d97c23921196466ca4a863 100644 --- a/Tests/Functional/TestMachinery/SimulationInfo.h +++ b/Tests/Functional/TestMachinery/SimulationInfo.h @@ -20,7 +20,8 @@ //! @class SimulationInfo //! @ingroup standard_samples -//! @brief Contains all necessary information to compose functional test +//! @brief Parameter set to describe a simulation example. +//! Used for communication from StandardSimulationsRegistry to IStandardTest. class SimulationInfo { diff --git a/Tests/Functional/TestMachinery/StandardSimulationsRegistry.h b/Tests/Functional/TestMachinery/StandardSimulationsRegistry.h index 12a0221e94803dd029878d150440886ff8266ea1..a4400e5d41103b79b43e8c8f627a5e5bca299df6 100644 --- a/Tests/Functional/TestMachinery/StandardSimulationsRegistry.h +++ b/Tests/Functional/TestMachinery/StandardSimulationsRegistry.h @@ -22,7 +22,7 @@ //! @class StandardSimulationsRegistry //! @ingroup standard_samples -//! @brief Handles info on subtests (= standard simulations), and contains hard-coded list of them. +//! @brief Handles simulation infos, and contains hard-coded list of standard simulations. class StandardSimulationsRegistry : public ISingleton<StandardSimulationsRegistry> {