From 20466a763750cf8d1ad9c4aaf685e998f2bb3841 Mon Sep 17 00:00:00 2001 From: Levente Orban Date: Thu, 30 Mar 2017 10:29:32 +0200 Subject: [PATCH] Add missing test for debugger (#1692) JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu --- tests/debugger/do_dump.cmd | 2 -- tests/debugger/do_dump.expected | 12 ---------- tests/debugger/do_next.cmd | 3 +++ tests/debugger/do_next.expected | 8 +++++++ tests/debugger/do_next.js | 28 +++++++++++++++++++++++ tests/debugger/do_quit.cmd | 1 + tests/debugger/do_quit.expected | 3 +++ tests/debugger/{do_dump.js => do_quit.js} | 21 ++--------------- 8 files changed, 45 insertions(+), 33 deletions(-) delete mode 100644 tests/debugger/do_dump.cmd delete mode 100644 tests/debugger/do_dump.expected create mode 100644 tests/debugger/do_next.cmd create mode 100644 tests/debugger/do_next.expected create mode 100644 tests/debugger/do_next.js create mode 100644 tests/debugger/do_quit.cmd create mode 100644 tests/debugger/do_quit.expected rename tests/debugger/{do_dump.js => do_quit.js} (78%) diff --git a/tests/debugger/do_dump.cmd b/tests/debugger/do_dump.cmd deleted file mode 100644 index 9d8cc0fd1..000000000 --- a/tests/debugger/do_dump.cmd +++ /dev/null @@ -1,2 +0,0 @@ -dump -c diff --git a/tests/debugger/do_dump.expected b/tests/debugger/do_dump.expected deleted file mode 100644 index e22a8fcd2..000000000 --- a/tests/debugger/do_dump.expected +++ /dev/null @@ -1,12 +0,0 @@ -Connecting to: localhost:5001 -Stopped at tests/debugger/do_dump.js:15 -(jerry-debugger) dump -{60: Function(byte_code_cp:0x3c, source_name:"tests/debugger/do_dump.js", name:"", line:54, column: 8 { Breakpoint(line:58, offset:12, active_index:-1) }), - 64: Function(byte_code_cp:0x40, source_name:"tests/debugger/do_dump.js", name:"func", line:34, column: 1 { Breakpoint(line:36, offset:16, active_index:-1) }), - 79: Function(byte_code_cp:0x4f, source_name:"tests/debugger/do_dump.js", name:"f1", line:17, column: 1 { Breakpoint(line:30, offset:23, active_index:-1) }), - 100: Function(byte_code_cp:0x64, source_name:"tests/debugger/do_dump.js", name:"g2", line:26, column: 5 { Breakpoint(line:26, offset:12, active_index:-1) }), - 102: Function(byte_code_cp:0x66, source_name:"tests/debugger/do_dump.js", name:"f2", line:19, column: 3 { Breakpoint(line:27, offset:26, active_index:-1) }), - 109: Function(byte_code_cp:0x6d, source_name:"tests/debugger/do_dump.js", name:"g1", line:21, column: 5 { Breakpoint(line:22, offset:18, active_index:-1),Breakpoint(line:23, offset:23, active_index:-1) }), - 128: Function(byte_code_cp:0x80, source_name:"tests/debugger/do_dump.js", name:"", line:1, column: 1 { Breakpoint(line:41, offset:47, active_index:-1),Breakpoint(line:51, offset:57, active_index:-1),Breakpoint(line:49, offset:52, active_index:-1),Breakpoint(line:54, offset:62, active_index:-1),Breakpoint(line:15, offset:42, active_index:-1) })} -(jerry-debugger) c -Connection closed. diff --git a/tests/debugger/do_next.cmd b/tests/debugger/do_next.cmd new file mode 100644 index 000000000..f507eef63 --- /dev/null +++ b/tests/debugger/do_next.cmd @@ -0,0 +1,3 @@ +next +next +c diff --git a/tests/debugger/do_next.expected b/tests/debugger/do_next.expected new file mode 100644 index 000000000..71c93d8c3 --- /dev/null +++ b/tests/debugger/do_next.expected @@ -0,0 +1,8 @@ +Connecting to: localhost:5001 +Stopped at tests/debugger/do_next.js:15 +(jerry-debugger) next +Stopped at tests/debugger/do_next.js:17 +(jerry-debugger) next +Stopped at tests/debugger/do_next.js:18 +(jerry-debugger) c +Connection closed. diff --git a/tests/debugger/do_next.js b/tests/debugger/do_next.js new file mode 100644 index 000000000..e35a8131f --- /dev/null +++ b/tests/debugger/do_next.js @@ -0,0 +1,28 @@ +// Copyright JS Foundation and other contributors, http://js.foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +print("next test"); + +print ("var cat"); +var cat = 'cat'; + +function test() +{ + function f() + { + return 0; + } +} + +test(); diff --git a/tests/debugger/do_quit.cmd b/tests/debugger/do_quit.cmd new file mode 100644 index 000000000..ff604669b --- /dev/null +++ b/tests/debugger/do_quit.cmd @@ -0,0 +1 @@ +quit diff --git a/tests/debugger/do_quit.expected b/tests/debugger/do_quit.expected new file mode 100644 index 000000000..de1ca1cdb --- /dev/null +++ b/tests/debugger/do_quit.expected @@ -0,0 +1,3 @@ +Connecting to: localhost:5001 +Stopped at tests/debugger/do_quit.js:15 +(jerry-debugger) quit diff --git a/tests/debugger/do_dump.js b/tests/debugger/do_quit.js similarity index 78% rename from tests/debugger/do_dump.js rename to tests/debugger/do_quit.js index 8304b9f4e..afdda5d0f 100644 --- a/tests/debugger/do_dump.js +++ b/tests/debugger/do_quit.js @@ -12,24 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -print("first line of code"); - -function f1() -{ - function f2() - { - function g1() { - a = 4; - return print("funciton f3"); - } - - function g2() { } - } - - var - x = - 6; -} +print("quit test"); function func() { 'use strict'; @@ -38,7 +21,7 @@ function func() { { { - print("Y"); + print("quit"); } }