summaryrefslogtreecommitdiff
path: root/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp')
-rw-r--r--src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp b/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp
new file mode 100644
index 0000000..93c0b13
--- /dev/null
+++ b/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp
@@ -0,0 +1,48 @@
+// //////////////////////////////////////////////////////////////////////////
+// Implementation file TestPlugInRunnerModel.cpp for class TestPlugInRunnerModel
+// (c)Copyright 2000, Baptiste Lepilleur.
+// Created: 2001/06/24
+// //////////////////////////////////////////////////////////////////////////
+
+#include "StdAfx.h"
+#include "TestPlugInRunnerModel.h"
+#include <cppunit/TestSuite.h>
+#include "TestPlugIn.h"
+
+
+TestPlugInRunnerModel::TestPlugInRunnerModel() :
+ TestRunnerModel( new CppUnit::TestSuite( "Default" ) ),
+ m_plugIn( new TestPlugIn( "default plug-in" ) )
+{
+}
+
+
+TestPlugInRunnerModel::~TestPlugInRunnerModel()
+{
+ delete m_plugIn;
+}
+
+
+void
+TestPlugInRunnerModel::setPlugIn( TestPlugIn *plugIn )
+{
+ delete m_plugIn;
+ m_plugIn = plugIn;
+ reloadPlugIn();
+}
+
+
+void
+TestPlugInRunnerModel::reloadPlugIn()
+{
+ try
+ {
+ setRootTest( m_plugIn->makeTest() );
+ }
+ catch (...)
+ {
+ setRootTest( new CppUnit::TestSuite( "Default" ) );
+ loadHistory();
+ throw;
+ }
+}