Skip canaries/simpleflexapp.as in performance suite while Dan Schaffer investigates...
[tamarin-stm.git] / test / cmdline / testDebugger.py
blob1628298801bf589c368e01c592df4ba4e379f3df
1 #!/usr/bin/env python
3 #!/usr/bin/env python
5 #* ***** BEGIN LICENSE BLOCK *****
6 #* Version: MPL 1.1/GPL 2.0/LGPL 2.1
7 #*
8 #* The contents of this file are subject to the Mozilla Public License Version
9 #* 1.1 (the "License"); you may not use this file except in compliance with
10 #* the License. You may obtain a copy of the License at
11 #* http://www.mozilla.org/MPL/
13 #* Software distributed under the License is distributed on an "AS IS" basis,
14 #* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
15 #* for the specific language governing rights and limitations under the
16 #* License.
18 #* The Original Code is [Open Source Virtual Machine.].
20 #* The Initial Developer of the Original Code is
21 #* Adobe System Incorporated.
22 #* Portions created by the Initial Developer are Copyright (C) 2009
23 #* the Initial Developer. All Rights Reserved.
25 #* Contributor(s):
26 #* Adobe AS3 Team
28 #* Alternatively, the contents of this file may be used under the terms of
29 #* either the GNU General Public License Version 2 or later (the "GPL"), or
30 #* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 #* in which case the provisions of the GPL or the LGPL are applicable instead
32 #* of those above. If you wish to allow use of your version of this file only
33 #* under the terms of either the GPL or the LGPL, and not to allow others to
34 #* use your version of this file under the terms of the MPL, indicate your
35 #* decision by deleting the provisions above and replace them with the notice
36 #* and other provisions required by the GPL or the LGPL. If you do not delete
37 #* the provisions above, a recipient may use your version of this file under
38 #* the terms of any one of the MPL, the GPL or the LGPL.
40 #* ***** END LICENSE BLOCK ***** */
44 from cmdutils import *
45 import os
47 def run():
48 r=RunTestLib()
49 if r.avmrd==None:
50 print "environment variable 'AVMRD' is not set"
51 print "SKIPPED all tests"
52 return
54 r.run_test(
55 'debugger basic',
56 '%s -d testdata/debug.abc'%r.avmrd,
57 input='quit\n',
58 expectedout=['40: public class debug','(asdb)']
61 r.run_test(
62 'debugger list',
63 '%s -d testdata/debug.abc'%r.avmrd,
64 input='list\nlist 40\nquit\n',
65 expectedout=['44: public function pubfunc','46:[ ]+privfunc\(\);']
68 r.run_test(
69 'debugger break',
70 '%s -d testdata/debug.abc'%r.avmrd,
71 input='break 45\ninfo break\nquit\n',
72 expectedout=['Breakpoint 1: file testdata.debug.as, 45.']
75 r.run_test(
76 'debugger stacktrace',
77 '%s -d testdata/debug.abc'%r.avmrd,
78 input='bt\nquit\n',
79 expectedout=['#0 global.*global\$init']
82 r.run_test(
83 'debugger break2',
84 '%s -d testdata/debug.abc'%r.avmrd,
85 input='break 45\ndelete 1\nbreak 1\nbreak 49\ninfo break\ncontinue\nquit\n',
86 expectedout=['Breakpoint 1 deleted.','2 at testdata.debug.as:49','Could not locate specified line.']
89 r.run_test(
90 'debugger next',
91 '%s -d testdata/debug.abc'%r.avmrd,
92 input='break 42\ncontinue\nnext\nstep\nquit\n',
93 expectedout=['42:.*print\("in constructor\(\)"\);','43:.*}']
96 r.run_test(
97 'debugger locals',
98 '%s -d testdata/debug.abc'%r.avmrd,
99 input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nquit\n',
100 expectedout=['local1 = undefined','local2 = 10','local2 = 15']
103 r.run_test(
104 'debugger arguments',
105 '%s -d testdata/debug.abc'%r.avmrd,
106 input='break 53\ncontinue\nnext\ninfo arguments\nquit\n',
107 expectedout=['arg1 = 110','arg2 = 115']
110 r.run_test(
111 'debugger exception',
112 '%s -d testdata/debug.abc'%r.avmrd,
113 input='continue\nquit\n',
114 expectedout=['Exception has been thrown:']
117 r.run_test(
118 'debugger where',
119 '%s -d testdata/debug.abc'%r.avmrd,
120 input='break 53\ncontinue\nwhere\nquit\n',
121 expectedout=['locals\(arg1=110,arg2=115\) at testdata.debug.as:53','init\(\) at testdata.debug.as:73']
123 r.run_test(
124 'debugger bt',
125 '%s -d testdata/debug.abc'%r.avmrd,
126 input='break 53\ncontinue\nbt\nquit\n',
127 expectedout=['locals\(arg1=110,arg2=115\) at testdata.debug.as:53','init\(\) at testdata.debug.as:73']
130 r.run_test(
131 'debugger finish',
132 '%s -d testdata/debug.abc'%r.avmrd,
133 input='break 53\ncontinue\nfinish\nwhere\nquit\n',
134 expectedout=['#0 global@[0-9a-z]+.global\$init\(\) at testdata.debug.as:73']
137 r.run_test(
138 'debugger set',
139 '%s -d testdata/debug.abc'%r.avmrd,
140 input='break 53\ncontinue\nnext\nset local2 = 5\ninfo locals\nquit\n',
141 expectedout=['local2 = 5']
144 if __name__ == '__main__':
145 r=RunTestLib()
146 r.compile("testdata/debug.as",None,"-d")
147 run()