From c807eef1681b832cf3eb2985f8b9c60026c3e59c Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Wed, 25 Nov 2020 17:46:02 +0100 Subject: [PATCH] + Tests/README.md; repaired spec scan export --- Core/Export/SimulationToPython.cpp | 8 +-- Tests/README.md | 33 ++++++++++++ auto/Wrap/doxygenBase.i | 81 ------------------------------ 3 files changed, 37 insertions(+), 85 deletions(-) create mode 100644 Tests/README.md diff --git a/Core/Export/SimulationToPython.cpp b/Core/Export/SimulationToPython.cpp index 7ae241c2869..376c136879f 100644 --- a/Core/Export/SimulationToPython.cpp +++ b/Core/Export/SimulationToPython.cpp @@ -93,12 +93,12 @@ std::string defineAngularSpecScan(const AngularSpecScan& scan) { result << defineFootprintFactor(*scan.footprintFactor()); result << indent() << "scan.setFootprintFactor(footprint)\n"; } - if (scan.angleResolution()) { - result << defineScanResolution(*scan.angleResolution()) << "\n"; + if (const auto* r = scan.angleResolution(); r && r->distribution()) { + result << defineScanResolution(*r) << "\n"; result << indent() << "scan.setAngleResolution(resolution)\n"; } - if (scan.wavelengthResolution()) { - result << defineScanResolution(*scan.wavelengthResolution()) << "\n"; + if (const auto* r = scan.wavelengthResolution(); r && r->distribution()) { + result << defineScanResolution(*r) << "\n"; result << indent() << "scan.setWavelengthResolution(resolution)\n"; } return result.str(); diff --git a/Tests/README.md b/Tests/README.md new file mode 100644 index 00000000000..6e4f9b116c5 --- /dev/null +++ b/Tests/README.md @@ -0,0 +1,33 @@ +#### BornAgain tests + +All tests are under CTest control. + +We usually run them with the command + +``` +ctest +``` + +There is little advantage in running ctest multi-threaded (flag `-j<n>`) +because each single simulation test uses multi-threading internally. + +## How to debug + +To find out how CTest is running a specific test, use + +``` +ctest -V -N -R <test_name> +``` + +The answer typically looks like + +``` +<build>/bin/<test_binary> --gtest_filter=<test_name>" <minor_options> +``` + +So we start the debugger with + +``` +gdb <build>/bin/<test_binary> +run --gtest_filter=<test_name> +``` diff --git a/auto/Wrap/doxygenBase.i b/auto/Wrap/doxygenBase.i index 08b65977e12..39a6eaf65d8 100644 --- a/auto/Wrap/doxygenBase.i +++ b/auto/Wrap/doxygenBase.i @@ -240,13 +240,6 @@ C++ includes: IntegratorMCMiser.h "; -// File: classExceptions_1_1ClassInitializationException.xml -%feature("docstring") Exceptions::ClassInitializationException ""; - -%feature("docstring") Exceptions::ClassInitializationException::ClassInitializationException "Exceptions::ClassInitializationException::ClassInitializationException(const std::string &message) -"; - - // File: classCloneableVector.xml %feature("docstring") CloneableVector " @@ -396,27 +389,6 @@ Increments inner counter; at regular intervals updates progress handler. "; -// File: classExceptions_1_1DomainErrorException.xml -%feature("docstring") Exceptions::DomainErrorException ""; - -%feature("docstring") Exceptions::DomainErrorException::DomainErrorException "Exceptions::DomainErrorException::DomainErrorException(const std::string &message) -"; - - -// File: classExceptions_1_1FileIsBadException.xml -%feature("docstring") Exceptions::FileIsBadException ""; - -%feature("docstring") Exceptions::FileIsBadException::FileIsBadException "Exceptions::FileIsBadException::FileIsBadException(const std::string &message) -"; - - -// File: classExceptions_1_1FileNotIsOpenException.xml -%feature("docstring") Exceptions::FileNotIsOpenException ""; - -%feature("docstring") Exceptions::FileNotIsOpenException::FileNotIsOpenException "Exceptions::FileNotIsOpenException::FileNotIsOpenException(const std::string &message) -"; - - // File: classFixedBinAxis.xml %feature("docstring") FixedBinAxis " @@ -496,13 +468,6 @@ Creates a new clipped axis. "; -// File: classExceptions_1_1FormatErrorException.xml -%feature("docstring") Exceptions::FormatErrorException ""; - -%feature("docstring") Exceptions::FormatErrorException::FormatErrorException "Exceptions::FormatErrorException::FormatErrorException(const std::string &message) -"; - - // File: classIAxis.xml %feature("docstring") IAxis " @@ -704,34 +669,6 @@ C++ includes: IPixel.h "; -// File: classExceptions_1_1LogicErrorException.xml -%feature("docstring") Exceptions::LogicErrorException ""; - -%feature("docstring") Exceptions::LogicErrorException::LogicErrorException "Exceptions::LogicErrorException::LogicErrorException(const std::string &message) -"; - - -// File: classExceptions_1_1NotImplementedException.xml -%feature("docstring") Exceptions::NotImplementedException ""; - -%feature("docstring") Exceptions::NotImplementedException::NotImplementedException "Exceptions::NotImplementedException::NotImplementedException(const std::string &message) -"; - - -// File: classExceptions_1_1NullPointerException.xml -%feature("docstring") Exceptions::NullPointerException ""; - -%feature("docstring") Exceptions::NullPointerException::NullPointerException "Exceptions::NullPointerException::NullPointerException(const std::string &message) -"; - - -// File: classExceptions_1_1OutOfBoundsException.xml -%feature("docstring") Exceptions::OutOfBoundsException ""; - -%feature("docstring") Exceptions::OutOfBoundsException::OutOfBoundsException "Exceptions::OutOfBoundsException::OutOfBoundsException(const std::string &message) -"; - - // File: classPointwiseAxis.xml %feature("docstring") PointwiseAxis " @@ -893,13 +830,6 @@ C++ includes: Integrator.h "; -// File: classExceptions_1_1RuntimeErrorException.xml -%feature("docstring") Exceptions::RuntimeErrorException ""; - -%feature("docstring") Exceptions::RuntimeErrorException::RuntimeErrorException "Exceptions::RuntimeErrorException::RuntimeErrorException(const std::string &message) -"; - - // File: classSafePointerVector.xml %feature("docstring") SafePointerVector " @@ -1244,11 +1174,6 @@ Returns the concatenation of two std::vectors. "; -// File: namespaceExceptions.xml -%feature("docstring") Exceptions::LogExceptionMessage "void Exceptions::LogExceptionMessage(const std::string &) -"; - - // File: namespaceFileSystemUtils.xml %feature("docstring") FileSystemUtils::extension "std::string FileSystemUtils::extension(const std::string &path) @@ -1716,12 +1641,6 @@ Returns exp(I*z), where I is the imaginary unit. "; -// File: Exceptions_8cpp.xml - - -// File: Exceptions_8h.xml - - // File: ICloneable_8h.xml -- GitLab