diff options
| author | Bastiaan Bakker <bastiaan.bakker@lifeline.nl> | 2001-04-29 13:09:16 +0000 |
|---|---|---|
| committer | Bastiaan Bakker <bastiaan.bakker@lifeline.nl> | 2001-04-29 13:09:16 +0000 |
| commit | b08ecaecc1e39b7b01e02b7b73559d8b34ff46a5 (patch) | |
| tree | bf1ed1e3680cb0256e73336e22fb70c692524fcb /include/msvc6/testrunner | |
| parent | 5ce1a68589aa3ea4f9ee255cfecc94cc1730c6fa (diff) | |
| download | cppunit-b08ecaecc1e39b7b01e02b7b73559d8b34ff46a5.tar.gz | |
Merged Baptiste Lepilleurs CppUnitW 1.2.
Some differences:
TypeInfo stuff (in TestSuite) compiled in only if USE_TYPEINFO is set.
TestSuite.getTests now returns a const ref instead of taking a ref as param.
Removed auto_ptr stuff from TestFactoryRegistry: auto_ptr cannot be used in
containers.
Diffstat (limited to 'include/msvc6/testrunner')
| -rw-r--r-- | include/msvc6/testrunner/TestRunner.h | 40 | ||||
| -rw-r--r-- | include/msvc6/testrunner/TestRunnerDlg.h | 129 |
2 files changed, 40 insertions, 129 deletions
diff --git a/include/msvc6/testrunner/TestRunner.h b/include/msvc6/testrunner/TestRunner.h new file mode 100644 index 0000000..97f92c6 --- /dev/null +++ b/include/msvc6/testrunner/TestRunner.h @@ -0,0 +1,40 @@ +// ////////////////////////////////////////////////////////////////////////// +// Header file TestRunner.h for class TestRunner +// (c)Copyright 2000, Baptiste Lepilleur. +// Created: 2001/04/26 +// ////////////////////////////////////////////////////////////////////////// +#ifndef TESTRUNNER_TESTRUNNER_H +#define TESTRUNNER_TESTRUNNER_H + + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +#include <vector> +#include <cppunit/TestSuite.h> + + +// A Wrapper +class AFX_CLASS_EXPORT TestRunner +{ +public: + TestRunner (); + ~TestRunner (); + + void run (); + + void addTest (CppUnit::Test *test); + + void addTests (const std::vector<CppUnit::Test *> &tests); + +protected: + CppUnit::Test * getRootTest(); + + CppUnit::TestSuite *m_suite; + + typedef std::vector<CppUnit::Test *> Tests; + Tests m_tests; +}; + +#endif // TESTRUNNER_TESTRUNNER_H diff --git a/include/msvc6/testrunner/TestRunnerDlg.h b/include/msvc6/testrunner/TestRunnerDlg.h deleted file mode 100644 index 7ec1cab..0000000 --- a/include/msvc6/testrunner/TestRunnerDlg.h +++ /dev/null @@ -1,129 +0,0 @@ -#if !defined(AFX_TESTRUNNERDLG_H) -#define AFX_TESTRUNNERDLG_H - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// TestRunnerDlg.h : header file -// - -#include <vector> - -#ifndef CPPUNIT_TEST_H -#include <cppunit/Test.h> -#endif - -#ifndef CPPUNIT_EXCEPTION_H -#include <cppunit/Exception.h> -#endif - - -class ProgressBar; -class ActiveTest; - - -///////////////////////////////////////////////////////////////////////////// -// TestRunnerDlg dialog - -class AFX_CLASS_EXPORT TestRunnerDlg : public CDialog -{ -// Construction -public: - TestRunnerDlg (CWnd* pParent = NULL); - ~TestRunnerDlg (); - - void setTests (std::vector<CppUnit::Test *> *test); - - void addError (CppUnit::TestResult *result, CppUnit::Test *test, CppUnit::Exception *e); - void addFailure (CppUnit::TestResult *result, CppUnit::Test *test, CppUnit::Exception *e); - void endTest (CppUnit::TestResult *result, CppUnit::Test *test); - -// Dialog Data - //{{AFX_DATA(TestRunnerDlg) - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(TestRunnerDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(TestRunnerDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnRun(); - afx_msg void OnStop(); - virtual void OnOK(); - afx_msg void OnSelchangeComboTest(); - afx_msg void OnPaint(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - - ProgressBar *m_testsProgress; - std::vector<CppUnit::Test *> *m_tests; - CppUnit::Test *m_selectedTest; - ActiveTest *m_activeTest; - CppUnit::TestResult *m_result; - int m_testsRun; - int m_errors; - int m_failures; - DWORD m_testStartTime; - DWORD m_testEndTime; - - void addListEntry (std::string type, CppUnit::TestResult *result, CppUnit::Test *test, CppUnit::Exception *e); - void beIdle (); - void beRunning (); - void beRunDisabled (); - void reset (); - void freeState (); - void updateCountsDisplay (); - -}; - - -inline void TestRunnerDlg::setTests (std::vector<CppUnit::Test *> *tests) -{ m_tests = tests; } - - - - -///////////////////////////////////////////////////////////////////////////// -// A Wrapper - - -class AFX_CLASS_EXPORT TestRunner -{ - std::vector<CppUnit::Test *> m_tests; - -public: - TestRunner () {} - ~TestRunner () - { - for (std::vector<CppUnit::Test *>::iterator it = m_tests.begin (); it != m_tests.end (); ++it) - delete *it; - } - - void run () - { - TestRunnerDlg dlg; - - dlg.setTests (&m_tests); - dlg.DoModal (); - } - - void addTest (CppUnit::Test *test) - { m_tests.push_back (test); } - - -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_TESTRUNNERDLG_H) |
