~s-cecilio/lenmus/v5.3

« back to all changes in this revision

Viewing changes to include/lenmus_test_runner.h

  • Committer: cecilios
  • Date: 2011-06-12 17:25:18 UTC
  • Revision ID: svn-v4:2587a929-2f0e-0410-ae78-fe6f687d5efe:branches/TRY-5.0:687
Initial update for v5.0 first working core using lomse

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------------------
 
2
//    LenMus Phonascus: The teacher of music
 
3
//    Copyright (c) 2002-2011 LenMus project
 
4
//
 
5
//    This program is free software; you can redistribute it and/or modify it under the
 
6
//    terms of the GNU General Public License as published by the Free Software Foundation,
 
7
//    either version 3 of the License, or (at your option) any later version.
 
8
//
 
9
//    This program is distributed in the hope that it will be useful, but WITHOUT ANY
 
10
//    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
11
//    PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 
12
//
 
13
//    You should have received a copy of the GNU General Public License along with this
 
14
//    program. If not, see <http://www.gnu.org/licenses/>.
 
15
//
 
16
//    For any comment, suggestion or feature request, please contact the manager of
 
17
//    the project at cecilios@users.sourceforge.net
 
18
//
 
19
//---------------------------------------------------------------------------------------
 
20
 
 
21
#ifndef __LENMUS_TEST_RUNNER_CLASS_H__        //to avoid nested includes
 
22
#define __LENMUS_TEST_RUNNER_CLASS_H__
 
23
 
 
24
#include <iostream>
 
25
 
 
26
#include <UnitTest++.h>
 
27
#include <TestReporter.h>
 
28
 
 
29
 
 
30
 
 
31
class wxWindow;
 
32
 
 
33
 
 
34
 
 
35
//a reporter for using a file stream
 
36
namespace UnitTest
 
37
{
 
38
 
 
39
    class MyTestReporter : public TestReporter
 
40
    {
 
41
    public:
 
42
        MyTestReporter(std::ofstream& outstream);
 
43
    private:
 
44
        virtual void ReportTestStart(TestDetails const& test);
 
45
        virtual void ReportFailure(TestDetails const& test, char const* failure);
 
46
        virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed);
 
47
        virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
 
48
 
 
49
        std::ofstream&   m_outstream;
 
50
    };
 
51
 
 
52
}
 
53
 
 
54
namespace lenmus
 
55
{
 
56
 
 
57
//---------------------------------------------------------------------------------------
 
58
class MyTestRunner
 
59
{
 
60
public:
 
61
    MyTestRunner(wxWindow* parent);
 
62
 
 
63
    void RunTests();
 
64
 
 
65
private:
 
66
    wxWindow*   m_pParent;
 
67
 
 
68
};
 
69
 
 
70
 
 
71
}   //namespace lenmus
 
72
 
 
73
#endif  // __LENMUS_TEST_RUNNER_CLASS_H__