<https://bugs.webkit.org/show_bug.cgi?id=62666>
[WebKit-https.git] / Tools / BuildSlaveSupport / kill-old-processes
1 #!/usr/bin/python\r
2 \r
3 # Copyright (C) 2010 Apple Inc.  All rights reserved.\r
4 #\r
5 # Redistribution and use in source and binary forms, with or without\r
6 # modification, are permitted provided that the following conditions\r
7 # are met:\r
8 #\r
9 # 1.  Redistributions of source code must retain the above copyright\r
10 #     notice, this list of conditions and the following disclaimer. \r
11 # 2.  Redistributions in binary form must reproduce the above copyright\r
12 #     notice, this list of conditions and the following disclaimer in the\r
13 #     documentation and/or other materials provided with the distribution. \r
14 #\r
15 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY\r
16 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
17 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
18 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\r
19 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
20 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
21 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
22 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
23 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
24 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
25 \r
26 import os, sys\r
27 \r
28 def main():\r
29 \r
30     tasksToKillWin = [ "cl.exe", \r
31                                         "devenv.com", \r
32                                         "devenv.exe", \r
33                                         "DumpRenderTree.exe", \r
34                                         "DumpRenderTree_debug.exe",\r
35                                         "httpd.exe", \r
36                                         "imagediff.exe", \r
37                                         "imagediff_debug.exe", \r
38                                         "jsc.exe", \r
39                                         "jsc_debug.exe",\r
40                                         "LightTPD.exe", \r
41                                         "link.exe", \r
42                                         "midl.exe", \r
43                                         "perl.exe", \r
44                                         "Safari.exe", \r
45                                         "svn.exe", \r
46                                         "testapi.exe", \r
47                                         "testapi_debug.exe", \r
48                                         "VcBuildHelper.exe", \r
49                                         "wdiff.exe", \r
50                                         "WebKit2WebProcess.exe", \r
51                                         "WebKit2WebProcess_debug.exe", \r
52                                         "WebKitTestRunner.exe", \r
53                                         "WebKitTestRunner_debug.exe" ]\r
54 \r
55     tasksToKillMac = [ "DumpRenderTree", \r
56                                         "make",\r
57                                         "perl", \r
58                                         "per5.12",\r
59                                         "ruby",\r
60                                         "Safari", \r
61                                         "Safari Web Content",\r
62                                         "WebProcess"\r
63                                         "svn", \r
64                                         "WebKitTestRunner",\r
65                                         "WebKitTestRunner Web Content",\r
66                                         "TestWebKitAPI",\r
67                                         "TestWebKitAPI Web Content",\r
68                                         "jsc",\r
69                                         "Problem Reporter",\r
70                                         "WebKitPluginAgen" ]\r
71 \r
72     if sys.platform == 'darwin':\r
73         for task in tasksToKillMac:\r
74             os.system("killall -9 -v -m " + task)\r
75     elif sys.platform == 'cygwin' or sys.platform == 'win32':\r
76         for task in tasksToKillWin:\r
77             os.system("taskkill /t /f /im " + task)\r
78     else:\r
79         raise Exception("Have not implemented kill-old-processes for this platform")  \r
80 \r
81 if __name__ == '__main__':\r
82     sys.exit(main())\r