xref: /haiku/src/tests/servers/app/harness/harness.h (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1 /*
2  * Copyright 2014 Stephan Aßmus <superstippi@gmx.de>
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 
6 
7 #include <List.h>
8 #include <String.h>
9 #include <View.h>
10 #include <Window.h>
11 
12 
13 class BMenuField;
14 class TestView;
15 
16 
17 class Test {
18 public:
19 								Test(const char* name);
20 	virtual						~Test();
21 
22 			const char*			Name() const
23 									{ return fName.String(); }
24 
25 	virtual	void				Draw(BView* view, BRect updateRect) = 0;
26 
27 private:
28 			BString				fName;
29 };
30 
31 
32 class TestWindow : public BWindow {
33 public:
34 								TestWindow(const char* title);
35 	virtual						~TestWindow();
36 
37 	virtual	void				MessageReceived(BMessage* message);
38 
39 			void				AddTest(Test* test);
40 			void				SetToTest(int32 index);
41 
42 private:
43 			TestView*			fTestView;
44 
45 			BMenuField*			fTestSelectionField;
46 
47 			BList				fTests;
48 };
49 
50 
51