summaryrefslogtreecommitdiff
path: root/src/msvc6/testrunner/MostRecentTests.h
blob: 339c3b7ebe993817778bcb86d51fab9e826d56ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// //////////////////////////////////////////////////////////////////////////
// Header file MostRecentTests.h for class MostRecentTests
// (c)Copyright 2000, Baptiste Lepilleur.
// Created: 2001/06/27
// //////////////////////////////////////////////////////////////////////////
#ifndef MOSTRECENTTESTS_H
#define MOSTRECENTTESTS_H

#include <cppunit/Test.h>
#include <deque>
#include <utility>


/*! \class MostRecentTests
 * \brief This class represents a list of the tests most recently run.
 */
class MostRecentTests
{
public:
  /*! Constructs a MostRecentTests object.
   */
  MostRecentTests();

  /*! Destructor.
   */
  virtual ~MostRecentTests();

  void setLastTestRun( CPPUNIT_NS::Test *test );
  CPPUNIT_NS::Test *lastTestRun() const;

  int getRunCount() const;
  CPPUNIT_NS::Test *getTestAt( int indexTest ) const;
  std::string getTestNameAt( int indexTest ) const;


private:
  /// Prevents the use of the copy constructor.
  MostRecentTests( const MostRecentTests &copy );

  /// Prevents the use of the copy operator.
  void operator =( const MostRecentTests &copy );

private:
  typedef std::pair<std::string, CPPUNIT_NS::Test *> TestRun;
  typedef std::deque<TestRun> TestRuns;
  TestRuns m_runs;
};


#endif  // MOSTRECENTTESTS_H