From 4f3ac657dc238cbc630b2281edef91190708a3fa Mon Sep 17 00:00:00 2001
From: Peter Peterson <petersonpf@ornl.gov>
Date: Wed, 12 Jan 2011 20:54:52 +0000
Subject: [PATCH] KernelTest no longer depends on TestHelpers. Refs #1881.

---
 Code/Mantid/Framework/Kernel/CMakeLists.txt               | 8 ++++++--
 .../inc/MantidKernel}/TestChannel.h                       | 8 +++-----
 .../Framework/{TestHelpers => Kernel}/src/TestChannel.cpp | 6 +-----
 Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h     | 4 ++--
 Code/Mantid/Framework/Kernel/test/FilterChannelTest.h     | 4 ++--
 Code/Mantid/Framework/TestHelpers/CMakeLists.txt          | 6 ++----
 6 files changed, 16 insertions(+), 20 deletions(-)
 rename Code/Mantid/Framework/{TestHelpers/inc/MantidTestHelpers => Kernel/inc/MantidKernel}/TestChannel.h (93%)
 rename Code/Mantid/Framework/{TestHelpers => Kernel}/src/TestChannel.cpp (87%)

diff --git a/Code/Mantid/Framework/Kernel/CMakeLists.txt b/Code/Mantid/Framework/Kernel/CMakeLists.txt
index e90419cd4aa..a81da970ff7 100644
--- a/Code/Mantid/Framework/Kernel/CMakeLists.txt
+++ b/Code/Mantid/Framework/Kernel/CMakeLists.txt
@@ -39,6 +39,7 @@ set ( SRC_FILES src/ArrayBoundedValidator.cpp
 		src/SupportBasic.cpp
                 src/SupportKernel.cpp
 		src/System.cpp
+                src/TestChannel.cpp
                 src/ThreadSafeLogStream.cpp
 		src/Timer.cpp
                 src/TimeSeriesProperty.cpp
@@ -128,6 +129,7 @@ set ( INC_FILES inc/MantidKernel/ArrayBoundedValidator.h
 		inc/MantidKernel/Support.h
 		inc/MantidKernel/SupportTempCode.h
 		inc/MantidKernel/System.h
+		inc/MantidKernel/TestChannel.h
 		inc/MantidKernel/ThreadSafeLogStream.h
 		inc/MantidKernel/Timer.h
 		inc/MantidKernel/TimeSeriesProperty.h
@@ -189,14 +191,16 @@ set_target_properties ( Kernel PROPERTIES OUTPUT_NAME MantidKernel
                                           COMPILE_DEFINITIONS IN_MANTID_KERNEL )
 # Add to the 'Framework' group in VS
 set_property ( TARGET Kernel PROPERTY FOLDER "Framework" )
+set_property ( TARGET Kernel PROPERTY PRIVATE_HEADER inc/MantidKernel/TestChannel.h )
 
 target_link_libraries ( Kernel ${MANTIDLIBS} )
 
 
 if ( CXXTEST_FOUND )
   cxxtest_add_test ( KernelTest ${TEST_FILES} )
-  include_directories ( ../TestHelpers/inc )
-  target_link_libraries( KernelTest Kernel TestHelpers)
+  include_directories ( inc test )
+  target_link_libraries( KernelTest Kernel)
+  add_dependencies ( KernelTest test/TestChannel.cpp )
   add_dependencies ( FrameworkTests KernelTest )
 
   add_custom_command ( TARGET KernelTest POST_BUILD 
diff --git a/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/TestChannel.h b/Code/Mantid/Framework/Kernel/inc/MantidKernel/TestChannel.h
similarity index 93%
rename from Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/TestChannel.h
rename to Code/Mantid/Framework/Kernel/inc/MantidKernel/TestChannel.h
index 1dadaf8a1f7..4b6f6cd5af1 100644
--- a/Code/Mantid/Framework/TestHelpers/inc/MantidTestHelpers/TestChannel.h
+++ b/Code/Mantid/Framework/Kernel/inc/MantidKernel/TestChannel.h
@@ -35,7 +35,7 @@
 #ifndef TESTCHANNEL_H_
 #define TESTCHANNEL_H_
 
-#include "MantidTestHelpers/DLLExport.h"
+#include "MantidKernel/DllExport.h"
 
 #include "Poco/Channel.h"
 #include "Poco/Message.h"
@@ -43,10 +43,9 @@
 
 namespace Mantid
 {
-  namespace TestHelpers
-  {
 
-    class DLL_TESTHELPERS TestChannel: public Poco::Channel
+//    class DLL_EXPORT TestChannel: public Poco::Channel
+    class TestChannel: public Poco::Channel
     {
     public:
       typedef std::list<Poco::Message> MsgList;
@@ -61,7 +60,6 @@ namespace Mantid
       MsgList _msgList;
     };
 
-  }
 }
 
 #endif // TESTCHANNEL_H_
diff --git a/Code/Mantid/Framework/TestHelpers/src/TestChannel.cpp b/Code/Mantid/Framework/Kernel/src/TestChannel.cpp
similarity index 87%
rename from Code/Mantid/Framework/TestHelpers/src/TestChannel.cpp
rename to Code/Mantid/Framework/Kernel/src/TestChannel.cpp
index a710ce799c5..508e370a386 100644
--- a/Code/Mantid/Framework/TestHelpers/src/TestChannel.cpp
+++ b/Code/Mantid/Framework/Kernel/src/TestChannel.cpp
@@ -1,14 +1,11 @@
 //------------------------------------------------------------------------------
 // Includes
 //------------------------------------------------------------------------------
-#include "MantidTestHelpers/TestChannel.h"
+#include "MantidKernel/TestChannel.h"
 
 namespace Mantid
 {
 
-  namespace TestHelpers
-  {
-
     TestChannel::TestChannel()
     {
     }
@@ -32,5 +29,4 @@ namespace Mantid
       _msgList.clear();
     }
 
-  }
 }
diff --git a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h
index 5b6ec37beb6..f354bb4e6d8 100644
--- a/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h
+++ b/Code/Mantid/Framework/Kernel/test/ConfigServiceTest.h
@@ -8,14 +8,14 @@
 #include "Poco/Path.h"
 #include "Poco/File.h"
 #include "boost/shared_ptr.hpp"
-#include "MantidTestHelpers/TestChannel.h"
+#include "MantidKernel/TestChannel.h"
 #include <string>
 #include <fstream>
 
 #include <Poco/NObserver.h>
 
 using namespace Mantid::Kernel;
-using Mantid::TestHelpers::TestChannel;
+using Mantid::TestChannel;
 
 class ConfigServiceTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/Kernel/test/FilterChannelTest.h b/Code/Mantid/Framework/Kernel/test/FilterChannelTest.h
index e57cffca9c9..2ee40fbb3b1 100644
--- a/Code/Mantid/Framework/Kernel/test/FilterChannelTest.h
+++ b/Code/Mantid/Framework/Kernel/test/FilterChannelTest.h
@@ -5,17 +5,17 @@
 
 #include "MantidKernel/FilterChannel.h"
 #include "MantidKernel/ConfigService.h"
+#include "MantidKernel/TestChannel.h"
 #include "Poco/Channel.h"
 #include "Poco/Message.h"
 #include "Poco/LoggingFactory.h"
 #include "Poco/LoggingRegistry.h"
 #include "boost/shared_ptr.hpp"
-#include "MantidTestHelpers/TestChannel.h"
 #include <map>
 #include <string>
 
 using namespace Mantid::Kernel;
-using Mantid::TestHelpers::TestChannel;
+using Mantid::TestChannel;
 
 class FilterChannelTest : public CxxTest::TestSuite
 {
diff --git a/Code/Mantid/Framework/TestHelpers/CMakeLists.txt b/Code/Mantid/Framework/TestHelpers/CMakeLists.txt
index 31e642391e2..33b62188d13 100644
--- a/Code/Mantid/Framework/TestHelpers/CMakeLists.txt
+++ b/Code/Mantid/Framework/TestHelpers/CMakeLists.txt
@@ -1,11 +1,9 @@
 set ( SRC_FILES src/WorkspaceCreationHelper.cpp 
-		src/ComponentCreationHelper.cpp 
-		src/TestChannel.cpp )
+		src/ComponentCreationHelper.cpp )
 
 set ( INC_FILES inc/MantidTestHelpers/DLLExport.h
 		inc/MantidTestHelpers/WorkspaceCreationHelper.h
-		inc/MantidTestHelpers/ComponentCreationHelper.h 
-		inc/MantidTestHelpers/TestChannel.h )
+		inc/MantidTestHelpers/ComponentCreationHelper.h )
 
 # Requires DataHandling for a load call
 include_directories (../DataHandling/inc)
-- 
GitLab