diff --git a/Code/Mantid/Algorithms/Algorithms.vcproj b/Code/Mantid/Algorithms/Algorithms.vcproj index d5153ccfcf4984b1ffbfb62d94f49c5498262b29..c9da4694064f2273a039952b606113c1d1e17d22 100644 --- a/Code/Mantid/Algorithms/Algorithms.vcproj +++ b/Code/Mantid/Algorithms/Algorithms.vcproj @@ -41,7 +41,7 @@ Optimization="0" AdditionalIncludeDirectories="../../Third_Party/include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" - RuntimeLibrary="1" + RuntimeLibrary="3" DebugInformationFormat="3" /> <Tool diff --git a/Code/Mantid/DataHandling/DataHandling.vcproj b/Code/Mantid/DataHandling/DataHandling.vcproj index fc5fbcb5e48c31e2a9def8b9e392bace4321e47f..560995387892b100bef33708472ae764ec1a40b1 100644 --- a/Code/Mantid/DataHandling/DataHandling.vcproj +++ b/Code/Mantid/DataHandling/DataHandling.vcproj @@ -41,7 +41,7 @@ Optimization="0" AdditionalIncludeDirectories="../../Third_Party/include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" - RuntimeLibrary="1" + RuntimeLibrary="3" DebugInformationFormat="3" /> <Tool diff --git a/Code/Mantid/DataObjects/DataObjects.vcproj b/Code/Mantid/DataObjects/DataObjects.vcproj index c756c6d30a4db4d3187f6e40b20011f52a972c80..22aefc79dcd5fd5f84a7f7b4752156a182f63808 100644 --- a/Code/Mantid/DataObjects/DataObjects.vcproj +++ b/Code/Mantid/DataObjects/DataObjects.vcproj @@ -41,7 +41,7 @@ Optimization="0" AdditionalIncludeDirectories="../../Third_Party/include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" - RuntimeLibrary="1" + RuntimeLibrary="3" DebugInformationFormat="3" /> <Tool diff --git a/Code/Mantid/Kernel/Kernel.vcproj b/Code/Mantid/Kernel/Kernel.vcproj index fb4cb66be5bde89b705facebdfc16bc634301f45..7cbedf0cee94adc16faef3013c7e0c268a9951b5 100644 --- a/Code/Mantid/Kernel/Kernel.vcproj +++ b/Code/Mantid/Kernel/Kernel.vcproj @@ -41,7 +41,7 @@ Optimization="0" AdditionalIncludeDirectories="inc;../../Third_Party/include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;POCO_DLL;WINVER=0x0500" - RuntimeLibrary="1" + RuntimeLibrary="3" DebugInformationFormat="3" /> <Tool diff --git a/Code/Mantid/Kernel/inc/Exception.h b/Code/Mantid/Kernel/inc/Exception.h index 7777dec5a54ba927d6e0858ceb4f74a36b79f700..939a0741d3632d10309335085321328199981008 100644 --- a/Code/Mantid/Kernel/inc/Exception.h +++ b/Code/Mantid/Kernel/inc/Exception.h @@ -79,6 +79,7 @@ class DLLExport FileError : public std::runtime_error { private: const std::string fileName; + std::string outMessage; public: FileError(const std::string&,const std::string&); @@ -91,7 +92,7 @@ class DLLExport FileError : public std::runtime_error /// Marks code as not implemented yet. class DLLExport NotImplementedError : public std::logic_error -{ +{ public: NotImplementedError(const std::string&); NotImplementedError(const NotImplementedError& A); @@ -106,6 +107,7 @@ class DLLExport NotFoundError : public std::runtime_error { private: const std::string objectName; + std::string outMessage; public: NotFoundError(const std::string&,const std::string&); @@ -121,6 +123,7 @@ class DLLExport ExistsError : public std::runtime_error { private: const std::string objectName; + std::string outMessage; public: ExistsError(const std::string&,const std::string&); diff --git a/Code/Mantid/Kernel/src/Exception.cpp b/Code/Mantid/Kernel/src/Exception.cpp index 5d3ec8584c8b69507d6f88da1bdc5afc9e5b76b3..3cc16141a98a0bd3151c74fb9bf48662f6db9435 100644 --- a/Code/Mantid/Kernel/src/Exception.cpp +++ b/Code/Mantid/Kernel/src/Exception.cpp @@ -19,7 +19,9 @@ namespace Exception */ FileError::FileError(const std::string& Desc,const std::string& FName) : std::runtime_error(Desc),fileName(FName) -{} +{ + outMessage = std::string(std::runtime_error::what()) + " in " + fileName; +} /// Copy constructor FileError::FileError(const FileError& A) : @@ -31,9 +33,7 @@ FileError::FileError(const FileError& A) : */ const char* FileError::what() const throw() { - std::stringstream cx; - cx<<std::runtime_error::what()<<" in "<<fileName; - return cx.str().c_str(); + return outMessage.c_str(); } //------------------------- @@ -56,9 +56,7 @@ NotImplementedError::NotImplementedError(const NotImplementedError& A) : */ const char* NotImplementedError::what() const throw() { - std::stringstream cx; - cx<<std::logic_error::what(); - return cx.str().c_str(); + return std::logic_error::what(); } //------------------------- @@ -70,7 +68,9 @@ const char* NotImplementedError::what() const throw() */ NotFoundError::NotFoundError(const std::string& Desc,const std::string& ObjectName) : std::runtime_error(Desc),objectName(ObjectName) -{} +{ + outMessage = std::string(std::runtime_error::what()) + " search object " + objectName; +} /// Copy constructor NotFoundError::NotFoundError(const NotFoundError& A) : @@ -82,9 +82,7 @@ NotFoundError::NotFoundError(const NotFoundError& A) : */ const char* NotFoundError::what() const throw() { - std::stringstream cx; - cx<<std::runtime_error::what()<<" search object "<<objectName;; - return cx.str().c_str(); + return outMessage.c_str(); } //------------------------- @@ -96,7 +94,9 @@ const char* NotFoundError::what() const throw() */ ExistsError::ExistsError(const std::string& Desc,const std::string& ObjectName) : std::runtime_error(Desc),objectName(ObjectName) -{} +{ + outMessage = std::string(std::runtime_error::what()) + " search object " + objectName; +} /// Copy constructor ExistsError::ExistsError(const ExistsError& A) : @@ -108,9 +108,7 @@ ExistsError::ExistsError(const ExistsError& A) : */ const char* ExistsError::what() const throw() { - std::stringstream cx; - cx<<std::runtime_error::what()<<" search object "<<objectName;; - return cx.str().c_str(); + return outMessage.c_str(); } } // namespace Exception diff --git a/Code/Mantid/Kernel/test/ConfigSvcTest.h b/Code/Mantid/Kernel/test/ConfigSvcTest.h index 4491f01526991d5fffe4c4cb17fd820b7d8de3e9..91e65c0645e922b5a2895820af10b9a656f85bdb 100644 --- a/Code/Mantid/Kernel/test/ConfigSvcTest.h +++ b/Code/Mantid/Kernel/test/ConfigSvcTest.h @@ -6,6 +6,7 @@ #include "../inc/ConfigSvc.h" #include "../inc/Logger.h" #include <string> +#include <iostream> using namespace Mantid::Kernel; @@ -39,7 +40,7 @@ public: TS_ASSERT(log1.is(Logger::PRIO_ERROR)); //error TS_ASSERT(log1.is(Logger::PRIO_CRITICAL)); //critical TS_ASSERT(log1.is(Logger::PRIO_FATAL)); //fatal - + } void TestSystemValues() @@ -68,6 +69,7 @@ public: int retVal = configSvc->getValue("mantid.legs",value); double dblValue; retVal = configSvc->getValue("mantid.legs",dblValue); + std::cerr << std::endl << "mantid.legs=" << dblValue << std::endl; TS_ASSERT_EQUALS(value, 6); TS_ASSERT_EQUALS(dblValue, 6.0); diff --git a/Code/Mantid/Kernel/test/MantidTest.properties b/Code/Mantid/Kernel/test/MantidTest.properties index 400867a5324241485d474750b6c7a3e3c58c65d3..9b8d826db23427cdc57948ee88e019b83c77f59d 100644 --- a/Code/Mantid/Kernel/test/MantidTest.properties +++ b/Code/Mantid/Kernel/test/MantidTest.properties @@ -7,4 +7,4 @@ logging.loggers.root.channel = fileChannel logging.channels.fileChannel.class = FileChannel logging.channels.fileChannel.path = sample.log logging.channels.fileChannel.formatter.class = PatternFormatter -logging.channels.fileChannel.formatter.pattern = %s: {%p} %t +logging.channels.fileChannel.formatter.pattern = %Y-%m-%d %H:%M:%S,%i [%I] %p %s - %t diff --git a/Code/Mantid/Kernel/test/runTests.bat b/Code/Mantid/Kernel/test/runTests.bat index be53c526a2d8df961b68909447b7269488b70e53..33cc5f4e027858e3ea07b97208c499a4ad71ae69 100644 --- a/Code/Mantid/Kernel/test/runTests.bat +++ b/Code/Mantid/Kernel/test/runTests.bat @@ -8,10 +8,20 @@ REM REM Author: Nick Draper, 19/10/07 REM echo "Generating the source from the test header files..." +IF "%1" == "" GOTO BUILD_ALL ELSE GOTO BUILD_ONE +:BUILD_ONE +ECHO Building only %1 +python ..\..\..\Third_Party\src\cxxtest\cxxtestgen.py --error-printer -o runner.cpp %1 +GOTO COMPILE + +:BUILD_ALL +ECHO Building all .h files python ..\..\..\Third_Party\src\cxxtest\cxxtestgen.py --error-printer -o runner.cpp *.h +GOTO COMPILE +:COMPILE echo "Compiling the test executable..." -cl runner.cpp /I "..\..\..\Third_Party\include" /I "..\.." /EHsc /MTd /W3 /nologo /c /ZI /TP +cl runner.cpp /I "..\..\..\Third_Party\include" /I "..\.." /EHsc /MDd /W3 /nologo /c /ZI /TP link /OUT:"runner.exe" /NOLOGO /LIBPATH:"../../Debug" /LIBPATH:"../../../Third_Party/lib/win32" /DEBUG /PDB:".\runner.pdb" kernel.lib runner.obj