~helene-verhaeghe27/cairo-dock-core/bugfix

« back to all changes in this revision

Viewing changes to tests/main.py

  • Committer: Fabrice Rey
  • Date: 2013-06-28 23:44:28 UTC
  • Revision ID: fabounet03@gmail.com-20130628234428-cwsvh6mexcfm0063
Added a test framework, and several tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
#
 
3
# Note: these tests need to be run with the default theme.
 
4
# The best way to do that is:
 
5
#   rm -rf ~/test
 
6
#   unset DESKTOP_SESSION
 
7
#   cairo-dock -T -d ~/test
 
8
#
 
9
# Usage: ./main.y [name of a test]
 
10
# In 'config.py', you can adjust some variables to fit your environment
 
11
 
 
12
import sys  # argv
 
13
 
 
14
from TestLauncher import TestLauncher
 
15
from TestCustomLauncher import TestCustomLauncher
 
16
from TestDockManager import TestDockManager
 
17
from TestModules import TestModules
 
18
from TestRootDock import TestRootDock, TestRootDock2
 
19
from TestSeparatorIcon import TestSeparatorIcon
 
20
from TestStackIcon import TestStackIcon
 
21
from TestTaskbar import TestTaskbar, TestTaskbar2
 
22
from TestIconManager import TestIconManager
 
23
 
 
24
from CairoDock import CairoDock
 
25
dock = CairoDock()
 
26
 
 
27
 
 
28
if __name__ == '__main__':
 
29
        if len(sys.argv) > 1:  # run the selected test
 
30
                if sys.argv[1] == "TestLauncher":
 
31
                        TestLauncher(dock).run()
 
32
                elif sys.argv[1] == "TestCustomLauncher":
 
33
                        TestCustomLauncher(dock).run()
 
34
                elif sys.argv[1] == "TestModules":
 
35
                        TestModules(dock).run()
 
36
                elif sys.argv[1] == "TestStackIcon":
 
37
                        TestStackIcon(dock).run()
 
38
                elif sys.argv[1] == "TestSeparatorIcon":
 
39
                        TestSeparatorIcon(dock).run()
 
40
                elif sys.argv[1] == "TestRootDock":
 
41
                        TestRootDock(dock).run()
 
42
                elif sys.argv[1] == "TestRootDock2":
 
43
                        TestRootDock2(dock).run()
 
44
                elif sys.argv[1] == "TestTaskbar":
 
45
                        TestTaskbar(dock).run()
 
46
                elif sys.argv[1] == "TestTaskbar2":
 
47
                        TestTaskbar2(dock).run()
 
48
                elif sys.argv[1] == "TestDockManager":
 
49
                        TestDockManager(dock).run()
 
50
                elif sys.argv[1] == "TestIconManager":
 
51
                        TestIconManager(dock).run()
 
52
                else:
 
53
                        print ("Unknown test")
 
54
        else:  # run them all
 
55
                TestLauncher(dock).run()
 
56
                TestCustomLauncher(dock).run()
 
57
                TestModules(dock).run()
 
58
                TestStackIcon(dock).run()
 
59
                TestSeparatorIcon(dock).run()
 
60
                TestRootDock(dock).run()
 
61
                TestRootDock2(dock).run()
 
62
                TestTaskbar(dock).run()
 
63
                TestTaskbar2(dock).run()
 
64
                TestDockManager(dock).run()
 
65
                TestIconManager(dock).run()
 
66