Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

TestSuite.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Lamp : Open source game middleware
00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //------------------------------------------------------------------------------
00019 
00020 /** @file
00021  * テストスィートヘッダ
00022  * @author Junpee
00023  */
00024 
00025 #ifndef TEST_SUITE_H_
00026 #define TEST_SUITE_H_
00027 
00028 #include <LampUnit/Test.h>
00029 #include <Core/Container/ArrayList.h>
00030 
00031 namespace LampUnit{
00032 
00033 //------------------------------------------------------------------------------
00034 /**
00035  * テストスィート
00036  */
00037 class TestSuite : public Test{
00038 public:
00039     /**
00040      * コンストラクタ
00041      */
00042     TestSuite(Lamp::String name);
00043 
00044     /**
00045      * デストラクタ
00046      */
00047     virtual ~TestSuite();
00048 
00049     /**
00050      * テストの追加
00051      * @param test 追加するテスト
00052      */
00053     virtual void addTest(Test* test);
00054 
00055     /**
00056      * テストを実行する
00057      * @param result [out] テスト結果
00058      */
00059     virtual void run(TestResult* result);
00060 
00061     /**
00062      * テストケースの個数を取得
00063      * @return テストケースの個数
00064      */
00065     virtual int getCountTestCases() const;
00066 
00067     /**
00068      * テストの名前を取得
00069      * @return テストの名前
00070      */
00071     virtual const Lamp::String& getName() const{ return name_; }
00072 
00073     /**
00074      * テストを文字列に変換
00075      * @return テストの文字列表記
00076      */
00077     virtual const Lamp::String& toString() const{ return string_; }
00078 
00079 private:
00080     // コピーコンストラクタの隠蔽
00081     TestSuite(const TestSuite& copy);
00082 
00083     // 代入コピーの隠蔽
00084     void operator =(const TestSuite& copy);
00085 
00086     // 名前
00087     const Lamp::String name_;
00088     // 文字列
00089     const Lamp::String string_;
00090     /// テスト配列型
00091     typedef Lamp::ArrayList<Test*> Tests;
00092     /// テスト配列
00093     Tests tests_;
00094 };
00095 
00096 //------------------------------------------------------------------------------
00097 } // End of namespace LampUnit
00098 #endif // End of TEST_SUITE_H_
00099 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:54 2005 for LampUnit by doxygen 1.3.2