aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'lib/debugger')
-rw-r--r--lib/debugger/Makefile2
-rw-r--r--lib/debugger/doc/src/Makefile4
-rw-r--r--lib/debugger/doc/src/book.xml3
-rw-r--r--lib/debugger/doc/src/debugger.xml26
-rw-r--r--lib/debugger/doc/src/debugger_chapter.xml858
-rw-r--r--lib/debugger/doc/src/i.xml138
-rw-r--r--lib/debugger/doc/src/int.xml334
-rw-r--r--lib/debugger/doc/src/introduction.xml63
-rw-r--r--lib/debugger/doc/src/notes.xml65
-rw-r--r--lib/debugger/doc/src/part.xml12
-rw-r--r--lib/debugger/doc/src/ref_man.xml9
-rw-r--r--lib/debugger/priv/Makefile2
-rw-r--r--lib/debugger/src/Makefile2
-rw-r--r--lib/debugger/src/dbg_debugged.erl7
-rw-r--r--lib/debugger/src/dbg_icmd.erl14
-rw-r--r--lib/debugger/src/dbg_idb.erl2
-rw-r--r--lib/debugger/src/dbg_ieval.erl6
-rw-r--r--lib/debugger/src/dbg_ieval.hrl4
-rw-r--r--lib/debugger/src/dbg_iload.erl4
-rw-r--r--lib/debugger/src/dbg_iserver.erl59
-rw-r--r--lib/debugger/src/dbg_istk.erl2
-rw-r--r--lib/debugger/src/dbg_wx_break.erl2
-rw-r--r--lib/debugger/src/dbg_wx_break_win.erl36
-rw-r--r--lib/debugger/src/dbg_wx_code.erl12
-rw-r--r--lib/debugger/src/dbg_wx_filedialog_win.erl18
-rw-r--r--lib/debugger/src/dbg_wx_filedialog_win.hrl2
-rw-r--r--lib/debugger/src/dbg_wx_interpret.erl2
-rw-r--r--lib/debugger/src/dbg_wx_mon.erl6
-rw-r--r--lib/debugger/src/dbg_wx_mon_win.erl26
-rw-r--r--lib/debugger/src/dbg_wx_settings.erl2
-rw-r--r--lib/debugger/src/dbg_wx_src_view.erl4
-rw-r--r--lib/debugger/src/dbg_wx_trace.erl23
-rw-r--r--lib/debugger/src/dbg_wx_trace_win.erl59
-rw-r--r--lib/debugger/src/dbg_wx_view.erl14
-rw-r--r--lib/debugger/src/dbg_wx_win.erl20
-rw-r--r--lib/debugger/src/dbg_wx_winman.erl6
-rw-r--r--lib/debugger/src/debugger.appup.src2
-rw-r--r--lib/debugger/src/debugger.erl2
-rw-r--r--lib/debugger/src/i.erl4
-rw-r--r--lib/debugger/src/int.erl44
-rw-r--r--lib/debugger/test/Makefile4
-rw-r--r--lib/debugger/test/andor_SUITE.erl185
-rw-r--r--lib/debugger/test/bs_bincomp_SUITE.erl71
-rw-r--r--lib/debugger/test/bs_construct_SUITE.erl264
-rw-r--r--lib/debugger/test/bs_match_bin_SUITE.erl75
-rw-r--r--lib/debugger/test/bs_match_int_SUITE.erl125
-rw-r--r--lib/debugger/test/bs_match_misc_SUITE.erl227
-rw-r--r--lib/debugger/test/bs_match_tail_SUITE.erl71
-rw-r--r--lib/debugger/test/bs_utf_SUITE.erl81
-rw-r--r--lib/debugger/test/bug_SUITE.erl56
-rw-r--r--lib/debugger/test/bug_SUITE_data/Makefile.src2
-rw-r--r--lib/debugger/test/bug_SUITE_data/otp2163.erl2
-rw-r--r--lib/debugger/test/bug_SUITE_data/otp4845.erl2
-rw-r--r--lib/debugger/test/cleanup.erl15
-rw-r--r--lib/debugger/test/dbg_ui_SUITE.erl126
-rw-r--r--lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl2
-rw-r--r--lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl2
-rw-r--r--lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl2
-rw-r--r--lib/debugger/test/debugger_SUITE.erl62
-rw-r--r--lib/debugger/test/debugger_test.erl2
-rw-r--r--lib/debugger/test/erl_eval_SUITE.erl1004
-rw-r--r--lib/debugger/test/exception_SUITE.erl295
-rw-r--r--lib/debugger/test/fun_SUITE.erl146
-rw-r--r--lib/debugger/test/guard_SUITE.erl1491
-rw-r--r--lib/debugger/test/int_SUITE.erl257
-rw-r--r--lib/debugger/test/int_SUITE_data/Emakefile1
-rw-r--r--lib/debugger/test/int_SUITE_data/Makefile.src40
-rw-r--r--lib/debugger/test/int_SUITE_data/guards.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/lists1.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/my_lists.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/ordsets1.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/test.erl2
-rw-r--r--lib/debugger/test/int_SUITE_data/test1.erl2
-rw-r--r--lib/debugger/test/int_break_SUITE.erl49
-rw-r--r--lib/debugger/test/int_break_SUITE_data/Makefile.src2
-rw-r--r--lib/debugger/test/int_break_SUITE_data/ordsets1.erl2
-rw-r--r--lib/debugger/test/int_eval_SUITE.erl249
-rw-r--r--lib/debugger/test/int_eval_SUITE_data/Makefile.src2
-rw-r--r--lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl2
-rw-r--r--lib/debugger/test/lc_SUITE.erl69
-rw-r--r--lib/debugger/test/line_number_SUITE.erl20
-rw-r--r--lib/debugger/test/map_SUITE.erl56
-rw-r--r--lib/debugger/test/record_SUITE.erl215
-rw-r--r--lib/debugger/test/test_lib.erl2
-rw-r--r--lib/debugger/test/trycatch_SUITE.erl571
-rw-r--r--lib/debugger/vsn.mk2
86 files changed, 3855 insertions, 3908 deletions
diff --git a/lib/debugger/Makefile b/lib/debugger/Makefile
index 9c761d216b..8c8b617831 100644
--- a/lib/debugger/Makefile
+++ b/lib/debugger/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2009. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/doc/src/Makefile b/lib/debugger/doc/src/Makefile
index 226dbe5b44..0f724b6f17 100644
--- a/lib/debugger/doc/src/Makefile
+++ b/lib/debugger/doc/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -114,7 +114,7 @@ release_docs_spec: docs
$(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
$(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
$(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
- (/bin/cp -rf $(HTMLDIR) "$(RELSYSDIR)/doc")
+ ($(CP) -rf $(HTMLDIR) "$(RELSYSDIR)/doc")
$(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
$(INSTALL_DIR) "$(RELEASE_PATH)/man/man3"
$(INSTALL_DATA) $(MAN3DIR)/* "$(RELEASE_PATH)/man/man3"
diff --git a/lib/debugger/doc/src/book.xml b/lib/debugger/doc/src/book.xml
index 071a04eb61..10356e14d0 100644
--- a/lib/debugger/doc/src/book.xml
+++ b/lib/debugger/doc/src/book.xml
@@ -4,7 +4,7 @@
<book xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -47,4 +47,3 @@
<index/>
</book>
-
diff --git a/lib/debugger/doc/src/debugger.xml b/lib/debugger/doc/src/debugger.xml
index 15d498d5ae..1ecdbcd064 100644
--- a/lib/debugger/doc/src/debugger.xml
+++ b/lib/debugger/doc/src/debugger.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2002</year><year>2013</year>
+ <year>2002</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,7 +29,7 @@
<rev></rev>
</header>
<module>debugger</module>
- <modulesummary>Erlang Debugger</modulesummary>
+ <modulesummary>Erlang Debugger.</modulesummary>
<description>
<p>Erlang Debugger for debugging and testing of Erlang programs.</p>
</description>
@@ -48,14 +48,14 @@
<desc>
<p>Starts Debugger.</p>
- <p>If given a file name as argument, Debugger will try to load
- its settings from this file. Refer to Debugger User's Guide
- for more information about settings.</p>
+ <p>If a filename is specified as argument, Debugger tries to load
+ its settings from this file. For details about settings, see
+ the User's Guide.</p>
- <p>If given <c>local</c> as argument, Debugger will interpret
- code only at the current node. If given <c>global</c> as
- argument, Debugger will interpret code at all known nodes,
- this is the default.</p>
+ <p>If <c>local</c> is specified as argument, Debugger interprets
+ code only at the current node. If <c>global</c> is specified as
+ argument, Debugger interprets code at all known nodes, this
+ is the default.</p>
</desc>
</func>
@@ -67,11 +67,9 @@
<v>Args = [term()]</v>
</type>
<desc>
- <p>This function can be used to debug a single process.
- The module <c>Module</c> is interpreted and
- <c>apply(Module,Name,Args)</c> is called. This will open an
- Attach Process window, refer to Debugger User's Guide for
- more information.</p>
+ <p>Debugs a single process. The module <c>Module</c> is interpreted
+ and <c>apply(Module,Name,Args)</c> is called. This opens an
+ Attach Process window. For details, see the User's Guide.</p>
</desc>
</func>
</funcs>
diff --git a/lib/debugger/doc/src/debugger_chapter.xml b/lib/debugger/doc/src/debugger_chapter.xml
index 98fe4ae377..45dfdb3776 100644
--- a/lib/debugger/doc/src/debugger_chapter.xml
+++ b/lib/debugger/doc/src/debugger_chapter.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -31,97 +31,92 @@
</header>
<section>
- <title>Introduction</title>
+ <title>Getting Started</title>
- <p><em>Debugger</em> is a graphical user interface for the Erlang
- interpreter, which can be used for debugging and testing of
- Erlang programs. For example, breakpoints can be set, code can be
- single stepped and variable values can be displayed and changed.
- </p>
+ <p>To use Debugger, the basic steps are as follows:</p>
- <p>The Erlang interpreter can also be accessed via the interface
- module <c>int</c>, see <seealso marker="int">int(3)</seealso>.
- </p>
+ <p><em>Step 1.</em> Start Debugger by calling
+ <c>debugger:start()</c>.</p>
- <p><em>Warning:</em> Note that the Debugger at some point might
- start tracing on the processes which execute the interpreted
- code. This means that a conflict will occur if tracing by other
- means is started on any of these processes.</p>
- </section>
+ <p>The <seealso marker="#monitor">Monitor window</seealso> is
+ displayed with information about all debugged processes,
+ interpreted modules, and selected options. Initially there are
+ normally no debugged processes. First, it must be specified which
+ modules that are to be <em>debugged</em> (also called
+ <em>interpreted</em>). Proceed as follows:</p>
- <section>
- <title>Getting Started with Debugger</title>
+ <p><em>Step 2.</em> Select <em>Module > Interpret...</em> in the
+ Monitor window.</p>
- <p>Start Debugger by calling <c>debugger:start()</c>. It will start
- the <seealso marker="#monitor">Monitor window</seealso> showing
- information about all debugged processes, interpreted modules and
- selected options.</p>
+ <p>The <seealso marker="#interpret">Interpret Modules window</seealso>
+ is displayed.</p>
- <p>Initially there are normally no debugged processes. First, it
- must be specified which modules should be <em>debugged</em>, or
- <em>interpreted</em> as it is also called. This is done by
- choosing <em>Module->Interpret...</em> in the Monitor window and
- then selecting the appropriate modules from the
- <seealso marker="#interpret">Interpret Dialog window</seealso>.
- </p>
+ <p><em>Step 3.</em> Select the appropriate modules from the Interpret
+ Dialog window.</p>
<note>
- <p>Only modules compiled with the option <c>debug_info</c> set
- can be interpreted. Non-interpretable modules are shown within
- parenthesis in the Interpret Dialog window.</p>
+ <p>Only modules compiled with option <c>debug_info</c> set can be
+ interpreted. Non-interpretable modules are displayed within
+ parenthesis in the Interpret Modules window.</p>
</note>
- <p>When a module is interpreted, it can be viewed in a
- <seealso marker="#view">View Module window</seealso>. This is done
- by selecting the module from the <em>Module->module->View</em>
- menu. The contents of the source file is shown and it is possible
- to set <seealso marker="#breakpoints">breakpoints</seealso>.</p>
-
- <p>Now the program that should be debugged can be started. This is
- done the normal way from the Erlang shell. All processes executing
- code in interpreted modules will be displayed in the Monitor
- window. It is possible to <em>attach</em> to one of these
- processes, by double-clicking it, or by selecting the process and
- then choosing <em>Process->Attach</em>.</p>
-
- <p>Attaching to a process will result in a
- <seealso marker="#attach">Attach Process window</seealso> being
- opened for this process. From the Attach Process window, it is
- possible to control the process execution, inspect variable
- values, set breakpoints etc.</p>
+ <p><em>Step 4.</em> In the Monitor window, select
+ <em>Module > the module to be interpreted > View</em>.</p>
+
+ <p>The contents of the source file is displayed in the
+ <seealso marker="#view">View Module window</seealso>.</p>
+
+ <p><em>Step 5.</em> Set the
+ <seealso marker="#breakpoints">breakpoints</seealso>, if any.</p>
+
+ <p><em>Step 6.</em> Start the program to be debugged. This is done
+ the normal way from the Erlang shell.</p>
+
+ <p>All processes executing code in interpreted modules are displayed
+ in the Monitor window.</p>
+
+ <p><em>Step 7.</em> To <em>attach</em> to one of these processes,
+ double-click it, or select the process and then choose
+ <em>Process > Attach</em>. Attaching to a process opens an
+ <seealso marker="#attach">Attach Process window</seealso> for this
+ process.</p>
+
+ <p><em>Step 8.</em> From the Attach Process window, you can control
+ the process execution, inspect variable values, set breakpoints,
+ and so on.</p>
</section>
<section>
<marker id="breakpoints"/>
- <title>Breakpoints and Break Dialogue Windows</title>
+ <title>Breakpoints and Break Dialog Windows</title>
<p>Once the appropriate modules are interpreted, breakpoints can
be set at relevant locations in the source code. Breakpoints are
specified on a line basis. When a process reaches a breakpoint,
- it stops and waits for commands (step, skip, continue,...) from
- the user.</p>
+ it stops and waits for commands (<em>Step</em>, <em>Skip</em>,
+ <em>Continue</em> ...) from the user.</p>
<note>
<p>When a process reaches a breakpoint, only that process is
- stopped. Other processes are not affected.</p>
+ stopped. Other processes are not affected.</p>
</note>
- <p>Breakpoints are created and deleted using the Break menu of
- the Monitor window, View Module window and Attach Process window.
- </p>
+ <p>Breakpoints are created and deleted using the <em>Break</em> menu of
+ either the Monitor window, View Module window, or Attach Process
+ window.</p>
<section>
<title>Executable Lines</title>
- <p>To have effect, a breakpoint must be set at an
- <em>executable line</em>, which is a line of code containing an
- executable expression such as a matching or a function call.
- A blank line or a line containing a comment, function head or
- pattern in a <c>case</c>- or <c>receive</c> statement is not
- executable.</p>
+ <p>To have an effect, a breakpoint must be set at an
+ <em>executable line</em>, which is a line of code containing an
+ executable expression such as a matching or a function call.
+ A blank line or a line containing a comment, function head, or
+ pattern in a <c>case</c> statement or <c>receive</c> statement is not
+ executable.</p>
- <p>In the example below, lines number 2, 4, 6, 8 and 11 are
- executable lines:</p>
+ <p>In the following example, lines 2, 4, 6, 8, and 11 are
+ executable lines:</p>
<pre>
1: is_loaded(Module,Compiled) ->
2: case get_file(Module,Compiled) of
@@ -141,17 +136,15 @@
<title>Status and Trigger Action</title>
<p>A breakpoint can be either <em>active</em> or
- <em>inactive</em>. Inactive breakpoints are ignored.</p>
-
- <p>Each breakpoint has a <em>trigger action</em> which specifies
- what should happen when a process has reached it (and stopped):
- </p>
- <list>
- <item><em>enable</em> Breakpoint should remain active (default).
- </item>
- <item><em>disable</em> Breakpoint should be made inactive.
- </item>
- <item><em>delete</em> Breakpoint should be deleted.</item>
+ <em>inactive</em>. Inactive breakpoints are ignored.</p>
+
+ <p>Each breakpoint has a <em>trigger action</em> that specifies
+ what is to happen when a process has reached it (and stopped):</p>
+ <list type="bulleted">
+ <item><em>Enable</em> - Breakpoint is to remain active (default).
+ </item>
+ <item><em>Disable</em> - Breakpoint is to be made inactive.</item>
+ <item><em>Delete</em> - Breakpoint is to be deleted.</item>
</list>
</section>
@@ -161,54 +154,56 @@
<p>A line breakpoint is created at a certain line in a module.</p>
<image file="images/line_break_dialog.jpg">
- <icaption>The Line Break Dialog Window.</icaption>
+ <icaption>Line Break Dialog Window</icaption>
</image>
- <p>Right-clicking the Module entry will open a popup menu from
- which the appropriate module can be selected.</p>
+ <p>Right-click the <em>Module</em> entry to open a popup menu from
+ which the appropriate module can be selected.</p>
- <p>A line breakpoint can also be created (and deleted) by
- double-clicking the line when the module is displayed in
- the View Module or Attach Process window.</p>
+ <p>A line breakpoint can also be created (and deleted) by
+ double-clicking the line when the module is displayed in
+ the View Module window or Attach Process window.</p>
</section>
<section>
<title>Conditional Breakpoints</title>
<p>A conditional breakpoint is created at a certain line in
- the module, but a process reaching the breakpoint will stop
- only if a given condition is true.</p>
+ the module, but a process reaching the breakpoint stops
+ only if a specified condition is true.</p>
<p>The condition is specified by the user as a module name
- <c>CModule</c> and a function name <c>CFunction</c>. When a
- process reaches the breakpoint,
- <c>CModule:CFunction(Bindings)</c> will be evaluated. If and
- only if this function call returns <c>true</c>, the process
- will stop. If the function call returns <c>false</c>,
- the breakpoint will be silently ignored.</p>
-
- <p><c>Bindings</c> is a list of variable bindings. Use
- the function <c>int:get_binding(Variable,Bindings)</c> to
- retrieve the value of <c>Variable</c> (given as an atom).
- The function returns <c>unbound</c> or <c>{value,Value}</c>.</p>
+ <c>CModule</c> and a function name <c>CFunction</c>. When a
+ process reaches the breakpoint,
+ <c>CModule:CFunction(Bindings)</c> is evaluated. If and
+ only if this function call returns <c>true</c>, the process
+ stops. If the function call returns <c>false</c>,
+ the breakpoint is silently ignored.</p>
+
+ <p><c>Bindings</c> is a list of variable bindings. To retrieve the
+ value of <c>Variable</c> (given as an atom), use function
+ <seealso marker="int#get_binding/2"><c>int:get_binding(Variable,Bindings)</c></seealso>.
+ The function returns <c>unbound</c> or <c>{value,Value}</c>.</p>
<image file="images/cond_break_dialog.jpg">
- <icaption>The Conditional Break Dialog Window.</icaption>
+ <icaption>Conditional Break Dialog Window</icaption>
</image>
- <p>Right-clicking the Module entry will open a popup menu from
- which the appropriate module can be selected.</p>
+ <p>Right-click the <em>Module</em> entry to open a popup menu from
+ which the appropriate module can be selected.</p>
- <p>Example: A conditional breakpoint calling
- <c>c_test:c_break/1</c> is added at line 6 in the module
+ <p><em>Example:</em></p>
+
+ <p>A conditional breakpoint calling
+ <c>c_test:c_break/1</c> is added at line 6 in module
<c>fact</c>. Each time the breakpoint is reached, the function is
- called, and when <c>N</c> is equal to 3 it returns <c>true</c>,
- and the process stops.</p>
-
+ called. When <c>N</c> is equal to 3, the function returns
+ <c>true</c> and the process stops.</p>
+
<p>Extract from <c>fact.erl</c>:</p>
<pre>
-5. fac(0) -> 1;
-6. fac(N) when N > 0, is_integer(N) -> N * fac(N-1).</pre>
+5. fac(0) -> 1;
+6. fac(N) when N > 0, is_integer(N) -> N * fac(N-1).</pre>
<p>Definition of <c>c_test:c_break/1</c>:</p>
<pre>
@@ -228,18 +223,18 @@ c_break(Bindings) ->
<title>Function Breakpoints</title>
<p>A function breakpoint is a set of line breakpoints, one at
- the first line of each clause in the given function.</p>
+ the first line of each clause in the specified function.</p>
<image file="images/function_break_dialog.jpg">
- <icaption>The Function Break Dialog Window.</icaption>
+ <icaption>Function Break Dialog Window</icaption>
</image>
- <p>Right-clicking the Module entry will open a popup menu from
- which the appropriate module can be selected.</p>
+ <p>To open a popup menu from which the appropriate module can be
+ selected, right-click the <em>Module</em> entry.</p>
- <p>Clicking the Ok button (or 'Return' or 'Tab') when a module
- name has been given, will bring up all functions of the module
- in the listbox.</p>
+ <p>To bring up all functions of the module in the listbox,
+ click the <em>OK</em> button (or press the <em>Return</em>
+ or <em>Tab</em> key) when a module name has been specified,.</p>
</section>
</section>
@@ -249,7 +244,7 @@ c_break(Bindings) ->
<p>The Erlang emulator keeps track of a <em>stack trace</em>,
information about recent function calls. This information is
- used, for example, if an error occurs:</p>
+ used if an error occurs, for example:</p>
<pre>
1> <input>catch a+1.</input>
{'EXIT',{badarith,[{erlang,'+',[a,1],[]},
@@ -259,602 +254,597 @@ c_break(Bindings) ->
{shell,eval_exprs,7,[{file,"shell.erl"},{line,629}]},
{shell,eval_loop,3,[{file,"shell.erl"},{line,614}]}]}}</pre>
- <p>See the Erlang Reference Manual,
- <seealso marker="doc/reference_manual:errors">
- Errors and Error Handling</seealso>,
- for more information about the stack trace.</p>
+ <p>For details about the stack trace, see section
+ <seealso marker="doc/reference_manual:errors">Errors and Error Handling</seealso>
+ in the Erlang Reference Manual.</p>
- <p>The Debugger emulates the stack trace by keeping track of recently
+ <p>Debugger emulates the stack trace by keeping track of recently
called interpreted functions. (The real stack trace cannot be
- used, as it shows which functions of the Debugger have been
- called, rather than which interpreted functions).</p>
+ used, as it shows which functions of Debugger have been
+ called, rather than which interpreted functions.)</p>
<p>This information can be used to traverse the chain of function
- calls, using the 'Up' and 'Down' buttons of
- <seealso marker="#attach">the Attach Process window</seealso>.
- </p>
+ calls, using the <em>Up</em> and <em>Down</em> buttons in the
+ <seealso marker="#attach">Attach Process window</seealso>.</p>
- <p>By default, the Debugger only saves information about recursive
+ <p>By default, Debugger only saves information about recursive
function calls, that is, function calls that have not yet returned
- a value (option 'Stack On, No Tail').</p>
+ a value (option <em>Stack On, No Tail</em>).</p>
<p>Sometimes, however, it can be useful to save all calls, even
- tail-recursive calls. That can be done with the 'Stack On, Tail'
- option. Note that this option will consume more memory and slow
- down execution of interpreted functions when there are many
- tail-recursive calls.
- </p>
-
- <p>It is also possible to turn off the Debugger stack trace
- facility ('Stack Off'). <em>Note:</em> If an error occurs, in this
- case the stack trace will be empty.</p>
-
- <p>See the section about <seealso marker="#monitor">the Monitor
- Window</seealso> for information about how to change the stack
- trace option.</p>
+ tail-recursive calls. This is done with option
+ <em>Stack On, Tail</em>. Notice that this option consumes more
+ memory and slows down execution of interpreted functions when there
+ are many tail-recursive calls.</p>
+
+ <p>To turn off the Debugger stack trace facility, select option
+ <em>Stack Off</em>.</p>
+
+ <note>
+ <p>If an error occurs, the stack trace becomes empty in this
+ case.</p>
+ </note>
+
+ <p>For information about how to change the stack trace option, see
+ section <seealso marker="#monitor">Monitor Window</seealso>.</p>
</section>
<section>
<marker id="monitor"/>
- <title>The Monitor Window</title>
+ <title>Monitor Window</title>
+
+ <p>The Monitor window is the main window of Debugger and displays the
+ following:</p>
- <p>The Monitor window is the main window of Debugger and shows a
- listbox containing the names of all interpreted modules
- (double-clicking a module brings up the View Module window),
- which options are selected, and information about all debugged
- processes, that is all processes which have been/are executing
- code in interpreted modules.</p>
+ <list type="bulleted">
+ <item><p>A listbox containing the names of all interpreted
+ modules</p>
+ <p>Double-clicking a module brings up the View Module window.</p>
+ </item>
+ <item><p>Which options are selected</p></item>
+ <item><p>Information about all debugged processes, that is, all
+ processes that have been or are executing code in interpreted
+ modules</p></item>
+ </list>
<image file="images/monitor.jpg">
- <icaption>The Monitor Window.</icaption>
+ <icaption>Monitor Window</icaption>
</image>
- <p>The Auto Attach buttons, Stack Trace label, Back Trace Size
- label, and Strings button show some options set, see
- <seealso marker="#options">Options Menu</seealso> for further
- information about these options.</p>
+ <p>The <em>Auto Attach</em> boxes, <em>Stack Trace</em> label,
+ <em>Back Trace Size</em> label, and <em>Strings</em> box display
+ some options set. For details about these options, see section
+ <seealso marker="#options">Options Menu</seealso>.</p>
<section>
<title>Process Grid</title>
-
<taglist>
<tag><em>Pid</em></tag>
<item><p>The process identifier.</p></item>
-
+
<tag><em>Initial Call</em></tag>
<item><p>The first call to an interpreted function by this
- process. (<c>Module:Function/Arity</c>)</p></item>
+ process. (<c>Module:Function/Arity</c>)</p></item>
<tag><em>Name</em></tag>
- <item><p>The registered name, if any. If a registered name does
- not show up, it may be that the Debugger received
- information about the process before the name had been
- registered. Try selecting <em>Edit->Refresh</em>.</p></item>
+ <item><p>The registered name, if any. If a registered name is not
+ displayed, it can be that Debugger received information about
+ the process before the name was registered. Try selecting
+ <em>Edit > Refresh</em>.</p></item>
<tag><em>Status</em></tag>
<item><p>The current status, one of the following:</p>
<taglist>
<tag><em>idle</em></tag>
- <item><p>The interpreted function call has returned a value,
- and the process is no longer executing interpreted code.
- </p></item>
+ <item><p>The interpreted function call has returned a value, and
+ the process is no longer executing interpreted code.</p></item>
<tag><em>running</em></tag>
<item><p>The process is running.</p></item>
-
+
<tag><em>waiting</em></tag>
<item><p>The process is waiting in a <c>receive</c>
- statement.</p></item>
-
+ statement.</p></item>
+
<tag><em>break</em></tag>
<item><p>The process is stopped at a breakpoint.</p></item>
-
+
<tag><em>exit</em></tag>
<item><p>The process has terminated.</p></item>
-
+
<tag><em>no_conn</em></tag>
<item><p>There is no connection to the node where
- the process is located.</p></item>
+ the process is located.</p></item>
</taglist>
</item>
<tag><em>Information</em></tag>
- <item><p>Additional information, if any. If the process is
- stopped at a breakpoint, the field contains information
- about the location <c>{Module,Line}</c>. If the process has
- terminated, the field contains the exit reason.</p></item>
+ <item><p>More information, if any. If the process is
+ stopped at a breakpoint, the field contains information
+ about the location <c>{Module,Line}</c>. If the process has
+ terminated, the field contains the exit reason.</p></item>
</taglist>
</section>
<section>
- <title>The File Menu</title>
-
+ <title>File Menu</title>
+
<taglist>
<tag><em>Load Settings...</em></tag>
- <item>
- <p>Try to load and restore Debugger settings from a file
- previously saved using <em>Save Settings...</em>, see below.
- Any errors are silently ignored.
- <em>Note:</em> Settings saved by Erlang R16B01 or later
- cannot be read by Erlang R16B or earlier.</p>
+ <item><p>Tries to load and restore Debugger settings from a file
+ previously saved using <em>Save Settings...</em> (see below).
+ Any errors are silently ignored.</p>
+ <p>Notice that settings saved by Erlang/OTP R16B01 or later
+ cannot be read by Erlang/OTP R16B or earlier.</p>
</item>
-
+
<tag><em>Save Settings...</em></tag>
- <item><p>Save Debugger settings to a file. The settings include
- the set of interpreted files, breakpoints, and the selected
- options. The settings can be restored in a later Debugger
- session using <em>Load Settings...</em>, see above.
- Any errors are silently ignored.</p>
+ <item><p>Saves Debugger settings to a file. The settings include
+ the set of interpreted files, breakpoints, and the selected
+ options. The settings can be restored in a later Debugger
+ session using <em>Load Settings...</em> (see above).
+ Any errors are silently ignored.</p>
</item>
-
+
<tag><em>Exit</em></tag>
- <item><p>Stop Debugger.</p></item>
+ <item><p>Stops Debugger.</p></item>
</taglist>
</section>
<section>
- <title>The Edit Menu</title>
+ <title>Edit Menu</title>
<taglist>
<tag><em>Refresh</em></tag>
- <item><p>Update information about debugged processes. Removes
- information about all terminated processes from the window,
- and also closes all Attach Process windows for terminated
- processes.</p></item>
+ <item><p>Updates information about debugged processes. Information
+ about all terminated processes are removed from the window. All
+ Attach Process windows for terminated processes are closed.</p></item>
<tag><em>Kill All</em></tag>
- <item><p>Terminate all processes listed in the window using
- <c>exit(Pid,kill)</c>.</p></item>
+ <item><p>Terminates all processes listed in the window using
+ <c>exit(Pid,kill)</c>.</p></item>
</taglist>
</section>
<section>
- <title>The Module Menu</title>
+ <title>Module Menu</title>
<taglist>
<tag><em>Interpret...</em></tag>
- <item><p>Open the <seealso marker="#interpret">Interpret Dialog
- window</seealso> where new modules to be interpreted can
- be specified.</p></item>
-
+ <item><p>Opens the
+ <seealso marker="#interpret">Interpret Modules window</seealso>,
+ where new modules to be interpreted can be specified.</p></item>
+
<tag><em>Delete All</em></tag>
- <item><p>Stop interpreting all modules. Processes executing in
- interpreted modules will terminate.</p></item>
+ <item><p>Stops interpreting all modules. Processes executing in
+ interpreted modules terminate.</p></item>
</taglist>
<p>For each interpreted module, a corresponding entry is added to
- the Module menu, with the following submenu:</p>
+ the <em>Module</em> menu, with the following submenu:</p>
<taglist>
<tag><em>Delete</em></tag>
- <item><p>Stop interpreting the selected module. Processes
- executing in this module will terminate.</p></item>
-
+ <item><p>Stops interpreting the selected module. Processes
+ executing in this module terminate.</p></item>
+
<tag><em>View</em></tag>
- <item><p>Open a <seealso marker="#view">View Module
- window</seealso> showing the contents of the selected
- module.</p></item>
+ <item><p>Opens a
+ <seealso marker="#view">View Module window</seealso>, displaying the
+ contents of the selected module.</p></item>
</taglist>
</section>
<section>
- <title>The Process Menu</title>
+ <title>Process Menu</title>
<p>The following menu items apply to the currently selected
- process, provided it is stopped at a breakpoint. See the chapter
- about the <seealso marker="#attach">Attach Process
- window</seealso> for more information.</p>
+ process, provided it is stopped at a breakpoint (for details, see
+ section
+ <seealso marker="#attach">Attach Process window</seealso>):</p>
<taglist>
<tag><em>Step</em></tag><item></item>
<tag><em>Next</em></tag><item></item>
<tag><em>Continue</em></tag><item></item>
<tag><em>Finish</em></tag><item></item>
</taglist>
+
<p>The following menu items apply to the currently selected
- process.</p>
+ process:</p>
<taglist>
<tag><em>Attach</em></tag>
- <item><p>Attach to the process and open a
- <seealso marker="#attach">Attach Process window</seealso>.
- </p></item>
-
+ <item><p>Attaches to the process and open an
+ <seealso marker="#attach">Attach Process window</seealso>.</p></item>
+
<tag><em>Kill</em></tag>
- <item><p>Terminate the process using <c>exit(Pid,kill)</c>.</p>
- </item>
+ <item><p>Terminates the process using <c>exit(Pid,kill)</c>.</p></item>
</taglist>
</section>
- <section>
- <title>The Break Menu</title>
- <p>The items in this menu are used to create and delete
- breakpoints.
- See the <seealso marker="#breakpoints">Breakpoints</seealso>
- chapter for more information.</p>
+ <section>
+ <title>Break Menu</title>
+ <p>The items in this menu are used to create and delete breakpoints.
+ For details, see section
+ <seealso marker="#breakpoints">Breakpoints</seealso>.</p>
+
<taglist>
<tag><em>Line Break...</em></tag>
- <item><p>Set a line breakpoint.</p></item>
+ <item><p>Sets a line breakpoint.</p></item>
<tag><em>Conditional Break...</em></tag>
- <item><p>Set a conditional breakpoint.</p></item>
+ <item><p>Sets a conditional breakpoint.</p></item>
<tag><em>Function Break...</em></tag>
- <item><p>Set a function breakpoint.</p></item>
+ <item><p>Sets a function breakpoint.</p></item>
<tag><em>Enable All</em></tag>
- <item><p>Enable all breakpoints.</p></item>
+ <item><p>Enables all breakpoints.</p></item>
<tag><em>Disable All</em></tag>
- <item><p>Disable all breakpoints.</p></item>
+ <item><p>Disables all breakpoints.</p></item>
- <tag><em>Delete All</em></tag>
- <item><p>Remove all breakpoints.</p></item>
+ <tag><em>Delete All</em></tag>
+ <item><p>Removes all breakpoints.</p></item>
</taglist>
- <p>For each breakpoint, a corresponding entry is added to
- the Break
- menu, from which it is possible to disable/enable or delete
- the breakpoint, and to change its trigger action.</p>
+ <p>For each breakpoint, a corresponding entry is added to the
+ <em>Break</em> menu, from which it is possible to disable, enable,
+ or delete the breakpoint, and to change its trigger action.</p>
</section>
<section>
<marker id="options"/>
- <title>The Options Menu</title>
+ <title>Options Menu</title>
<taglist>
<tag><em>Trace Window</em></tag>
- <item><p>Set which areas should be visible in
- an <seealso marker="#attach">Attach Process
- window</seealso>. Does not affect already existing
- Attach Process windows.</p>
+ <item><p>Sets the areas to be visible in an
+ <seealso marker="#attach">Attach Process window</seealso>.
+ Does not affect existing Attach Process windows.</p>
</item>
<tag><em>Auto Attach</em></tag>
- <item><p>Set at which events a debugged process should be
- automatically attached to. Affects existing debugged
- processes.</p>
- <list>
- <item><em>First Call</em> - the first time a process calls a
- function in an interpreted module.</item>
- <item><em>On Exit</em> - at process termination.</item>
- <item><em>On Break</em> - when a process reaches a
- breakpoint.</item>
+ <item><p>Sets the events a debugged process is to be attached
+ to automatically. Affects existing debugged processes.</p>
+ <list type="bulleted">
+ <item><p><em>First Call</em> - The first time a process calls
+ a function in an interpreted module.</p></item>
+ <item><p><em>On Exit</em> - At process termination.</p></item>
+ <item><p><em>On Break</em> - When a process reaches a
+ breakpoint.</p></item>
</list>
</item>
<tag><em>Stack Trace</em></tag>
- <item><p>Set stack trace option, see section
+ <item><p>Sets the stack trace option, see section
<seealso marker="#stack_trace">Stack Trace</seealso>. Does not
- affect already existing debugged processes.</p>
- <list>
- <item><em>Stack On, Tail</em> - save information about all
- current calls.</item>
- <item><em>Stack On, No Tail</em> - save information about
+ affect existing debugged processes.</p>
+ <list type="bulleted">
+ <item><p><em>Stack On, Tail</em> - Saves information about all
+ current calls.</p></item>
+ <item><p><em>Stack On, No Tail</em> - Saves information about
current calls, discarding previous information when a tail
- recursive call is made.</item>
- <item><em>Stack Off</em> - do not save any information about
- current calls.</item>
+ recursive call is made.</p></item>
+ <item><p><em>Stack Off</em> - Does not save any information about
+ current calls.</p></item>
</list>
</item>
<tag><em>Strings</em></tag>
- <item><p>Set which integer lists should be printed as strings.
- Does not affect already existing debugged processes.</p>
- <list>
-
- <item><em>Use range of +pc flag</em> - use the printable
- character range set by the
- <seealso marker="erts:erl#printable_character_range">
- <c>erl(1)</c></seealso> flag <c>+pc</c>.
- </item>
+ <item><p>Sets the integer lists to be printed as strings.
+ Does not affect existing debugged processes.</p>
+ <list type="bulleted">
+ <item><p><em>Use range of +pc flag</em> - Uses the printable
+ character range set by the <c>erl(1)</c> flag
+ <seealso marker="erts:erl#printable_character_range"><c>+pc</c></seealso>.</p>
+ </item>
</list>
</item>
<tag><em>Back Trace Size...</em></tag>
- <item><p>Set how many call frames should be fetched when
- inspecting the call stack from the Attach Process window.
- Does not affect already existing Attach Process windows.</p>
+ <item><p>Sets how many call frames to be fetched when
+ inspecting the call stack from the Attach Process window.
+ Does not affect existing Attach Process windows.</p>
</item>
</taglist>
</section>
<section>
- <title>The Windows Menu</title>
+ <title>Windows Menu</title>
<p>Contains a menu item for each open Debugger window. Selecting
- one of the items will raise the corresponding window.</p>
+ one of the items raises the corresponding window.</p>
</section>
<section>
- <title>The Help Menu</title>
+ <title>Help Menu</title>
<taglist>
<tag><em>Help</em></tag>
- <item><p>View the Debugger documentation. Currently this
- function requires a web browser to be up and running.</p></item>
+ <item><p>Shows the Debugger documentation. This function requires a
+ web browser.</p></item>
</taglist>
</section>
</section>
-
+
<section>
<marker id="interpret"/>
- <title>The Interpret Dialog Window</title>
+ <title>Interpret Modules Window</title>
- <p>The interpret dialog module is used for selecting which modules
- to interpret. Initially, the window shows the modules (<c>erl</c>
- files) and subdirectories of the current working directory.</p>
+ <p>The Interpret Modules window is used for selecting which modules
+ to interpret. Initially, the window displays the modules (<c>erl</c>
+ files) and subdirectories of the current working directory.</p>
- <p>Interpretable modules are modules for which a BEAM file, compiled
- with the option <c>debug_info</c> set, can be found in the same
+ <p>Interpretable modules are modules for which a <c>.beam</c> file,
+ compiled with option <c>debug_info</c> set, is located in the same
directory as the source code, or in an <c>ebin</c> directory next
to it.</p>
- <p>Modules, for which the above requirements are not fulfilled, are
- not interpretable and are therefore displayed within parentheses.
- </p>
+ <p>Modules for which these requirements are not fulfilled are
+ not interpretable and are therefore displayed within parentheses.</p>
- <p>The <c>debug_info</c> option causes <em>debug information</em> or
- <em>abstract code</em> to be added to the BEAM file. This will
- increase the size of the file, and also makes it possible to
+ <p>Option <c>debug_info</c> causes <em>debug information</em> or
+ <em>abstract code</em> to be added to the <c>.beam</c> file.
+ This increases the file size and makes it possible to
reconstruct the source code. It is therefore recommended not to
include debug information in code aimed for target systems.</p>
<p>An example of how to compile code with debug information using
- <c>erlc</c>:<br/>
- <c>% erlc +debug_info module.erl</c></p>
-
+ <c>erlc</c>:</p>
+ <pre>
+% erlc +debug_info module.erl</pre>
+
<p>An example of how to compile code with debug information from
- the Erlang shell:<br/>
- <c>4> c(module, debug_info).</c></p>
-
+ the Erlang shell:</p>
+ <pre>
+4> c(module, debug_info).</pre>
+
<image file="images/interpret.jpg">
- <icaption>The Interpret Dialog Window.</icaption>
+ <icaption>Interpret Modules Window</icaption>
</image>
- <p>Browse the file hierarchy and interpret the appropriate modules
- by selecting a module name and pressing <em>Choose</em> (or
- carriage return), or by double clicking the module name.
- Interpreted modules have the type <c>erl src</c>.
- </p>
+ <p>To browse the file hierarchy and interpret the appropriate modules,
+ either select a module name and click <em>Choose</em> (or
+ press carriage return), or double-click the module name.
+ Interpreted modules have the type <c>erl src</c>.</p>
- <p>Pressing <em>All</em> will interpret all displayed modules in
- the chosen directory.</p>
+ <p>To interpret all displayed modules in the chosen directory, click
+ <em>All</em>.</p>
- <p>Pressing <em>Done</em> will close the window.</p>
+ <p>To close the window, click <em>Done</em>.</p>
<note>
- <p>When the Debugger is started in global mode (which is
- the default, see
- <seealso marker="debugger:debugger#start/0">debugger:start/0</seealso>),
- modules added (or deleted) for interpretation will be added (or
- deleted) on all known Erlang nodes.</p>
+ <p>When Debugger is started in global mode (which is the default, see
+ <seealso marker="debugger#start/0">debugger:start/0</seealso>),
+ modules added (or deleted) for interpretation are added (or
+ deleted) on all known Erlang nodes.</p>
</note>
</section>
<section>
<marker id="attach"/>
- <title>The Attach Process Window</title>
+ <title>Attach Process Window</title>
- <p>From an Attach Process window the user can interact with a
+ <p>From an Attach Process window, you can interact with a
debugged process. One window is opened for each process that has
- been attached to. Note that when attaching to a process, its
- execution is automatically stopped.
- </p>
+ been attached to. Notice that when attaching to a process, its
+ execution is automatically stopped.</p>
<image file="images/attach.jpg">
- <icaption>The Attach Process Window.</icaption>
+ <icaption>Attach Process Window</icaption>
</image>
- <p>The window is divided into five parts:</p>
- <list>
- <item><p>The Code area, showing the code being executed. The code
- is indented and each line is prefixed with its line number.
- If the process execution is stopped, the current line is
- marked with <em>--></em>. An existing break point at a line
- is marked with a stop symbol. In the example above,
- the execution has been stopped at line 6, before
- the execution of <c>fac/1</c>.</p>
- <p>Active breakpoints are shown in red, while inactive
- breakpoints are shown in blue.</p>
+ <p>The window is divided into the following five parts:</p>
+ <list type="bulleted">
+ <item><p>The Code area, displaying the code being executed. The code
+ is indented and each line is prefixed with its line number.
+ If the process execution is stopped, the current line is
+ marked with <c>--></c>. An existing break point at a line
+ is marked with a stop symbol. In the example shown in the
+ illustration, the execution stopped at line 6, before
+ the execution of <c>fac/1</c>.</p>
+
+ <p>Active breakpoints are displayed in red and inactive
+ breakpoints in blue.</p>
</item>
- <item>The Button area, with buttons for quick access to frequently
- used functions in the Process menu.</item>
- <item>The Evaluator area, where the user can evaluate functions
- within the context of the debugged process, provided that
- process execution has been stopped.</item>
- <item>The Bindings area, showing all variables bindings.
- Clicking on a variable name will result in the value being
- displayed in the Evaluator area.
- Double-clicking on a variable name will open a window where
- the variable value may be edited. Note however that pid,
- reference, binary or port values can not be edited.
+
+ <item><p>The Button area, with buttons for quick access to frequently
+ used functions in the <em>Process</em> menu.</p></item>
+
+ <item><p>The Evaluator area, where you can evaluate functions
+ within the context of the debugged process, if that
+ process execution is stopped.</p></item>
+
+ <item><p>The Bindings area, displaying all variables bindings. If you
+ click a variable name, the value is displayed in the Evaluator area.
+ Double-click a variable name to open a window where
+ the variable value can be edited. Notice however that pid,
+ reference, binary, or port values cannot be edited.</p>
</item>
- <item><p>The Trace area, showing a trace output for the process.
- </p>
+
+ <item><p>The Trace area, which displays a trace output for the
+ process.</p>
<taglist>
- <tag><c>++ (N) &lt;L&gt;</c></tag>
- <item>Function call, where <c>N</c> is the call level and
- <c>L</c> the line number.</item>
+ <tag><c>++ (N) &lt;L&gt;</c></tag>
+ <item><p>Function call, where <c>N</c> is the call level and
+ <c>L</c> the line number.</p></item>
- <tag><c>-- (N)</c></tag>
- <item>Function return value.</item>
+ <tag><c>-- (N)</c></tag>
+ <item><p>Function return value</p>.</item>
- <tag><c>==> Pid : Msg</c></tag>
- <item>The message <c>Msg</c> is sent to process <c>Pid</c>.
- </item>
+ <tag><c>==> Pid : Msg</c></tag>
+ <item><p>The message <c>Msg</c> is sent to process
+ <c>Pid</c>.</p></item>
- <tag><c><![CDATA[<== Msg]]></c></tag>
- <item>The message <c>Msg</c> is received.</item>
+ <tag><c><![CDATA[<== Msg]]></c></tag>
+ <item><p>The message <c>Msg</c> is received.</p></item>
- <tag><c>++ (N) receive</c></tag>
- <item>Waiting in a <c>receive</c>.</item>
+ <tag><c>++ (N) receive</c></tag>
+ <item><p>Waiting in a <c>receive</c>.</p></item>
- <tag><c>++ (N) receive with timeout</c></tag>
- <item>Waiting in a <c>receive...after</c>.</item>
- </taglist>
+ <tag><c>++ (N) receive with timeout</c></tag>
+ <item><p>Waiting in a <c>receive...after</c>.</p></item>
+ </taglist>
- <p>Also the back trace, a summary of the current function calls
- on the stack, is displayed in the Trace area.</p>
+ <p>The Trace area also displays Back Trace, a summary of the
+ current function calls on the stack.</p>
</item>
</list>
- <p>It is configurable using the Options menu which areas should
- be shown or hidden. By default, all areas except the Trace area
- are shown.</p>
+ <p>Using the <em>Options</em> menu, you can set which areas to be
+ displayed. By default, all areas except the Trace area are displayed.</p>
<section>
- <title>The File Menu</title>
+ <title>File Menu</title>
<taglist>
<tag><em>Close</em></tag>
- <item><p>Close this window and detach from the process.</p>
+ <item><p>Closes this window and detach from the process.</p>
</item>
</taglist>
</section>
<section>
- <title>The Edit Menu</title>
+ <title>Edit Menu</title>
<taglist>
<tag><em>Go to line...</em></tag>
- <item><p>Go to a specified line number.</p></item>
+ <item><p>Goes to a specified line number.</p></item>
<tag><em>Search...</em></tag>
- <item><p>Search for a specified string.</p></item>
+ <item><p>Searches for a specified string.</p></item>
</taglist>
</section>
<section>
- <title>The Process Menu</title>
+ <title>Process Menu</title>
<taglist>
<tag><em>Step</em></tag>
- <item><p>Execute the current line of code, stepping into any
+ <item><p>Executes the current code line, stepping into any
(interpreted) function calls.</p></item>
<tag><em>Next</em></tag>
- <item><p>Execute the current line of code and stop at the next
+ <item><p>Executes the current code line and stop at the next
line.</p></item>
<tag><em>Continue</em></tag>
- <item><p>Continue the execution.</p></item>
+ <item><p>Continues the execution.</p></item>
<tag><em>Finish</em></tag>
- <item><p>Continue the execution until the current function
+ <item><p>Continues the execution until the current function
returns.</p></item>
<tag><em>Skip</em></tag>
- <item><p>Skip the current line of code and stop at the next
+ <item><p>Skips the current code line and stop at the next
line. If used on the last line in a function body,
- the function will return <c>skipped</c>.</p></item>
+ the function returns <c>skipped</c>.</p></item>
<tag><em>Time Out</em></tag>
- <item><p>Simulate a timeout when executing a
+ <item><p>Simulates a time-out when executing a
<c>receive...after</c> statement.</p></item>
<tag><em>Stop</em></tag>
- <item><p>Stop the execution of a running process, that is, make
- the process stop as at a breakpoint. The command will take
+ <item><p>Stops the execution of a running process, that is, make
+ the process stop at a breakpoint. The command takes
effect (visibly) the next time the process receives a
message.</p></item>
<tag><em>Where</em></tag>
- <item><p>Make sure the current location of the execution is
+ <item><p>Verifies that the current location of the execution is
visible in the code area.</p></item>
<tag><em>Kill</em></tag>
- <item><p>Terminate the process using <c>exit(Pid,kill)</c>.</p>
+ <item><p>Terminates the process using <c>exit(Pid,kill)</c>.</p>
</item>
<tag><em>Messages</em></tag>
- <item><p>Inspect the message queue of the process. The queue is
- printed in the evaluator area.</p></item>
+ <item><p>Inspects the message queue of the process. The queue is
+ displayed in the Evaluator area.</p></item>
<tag><em>Back Trace</em></tag>
- <item><p>Display the back trace of the process, a summary of
- the current function calls on the stack, in the trace area.
- Requires that the Trace area is visible and that the stack
- trace option is 'Stack On, Tail' or 'Stack On, No Tail'.</p>
+ <item><p>Displays the back trace of the process, a summary of
+ the current function calls on the stack, in the Trace area.
+ Requires that the Trace area is visible and that the Stack
+ Trace option is <em>Stack On, Tail</em> or
+ <em>Stack On, No Tail</em>.</p>
</item>
<tag><em>Up</em></tag>
- <item><p>Inspect the previous function call on the stack,
+ <item><p>Inspects the previous function call on the stack,
showing the location and variable bindings.</p></item>
<tag><em>Down</em></tag>
- <item><p>Inspect the next function call on the stack, showing
+ <item><p>Inspects the next function call on the stack, showing
the location and variable bindings.</p></item>
</taglist>
</section>
<section>
- <title>The Options Menu</title>
+ <title>Options Menu</title>
<taglist>
<tag><em>Trace Window</em></tag>
- <item><p>Set which areas should be visible. Does not affect
- other Attach Process windows.</p>
- </item>
+ <item><p>Sets which areas are to be visible. Does not affect
+ other Attach Process windows.</p></item>
<tag><em>Stack Trace</em></tag>
- <item><p>Same as in <seealso marker="#monitor">the Monitor
- window</seealso>, but only affects the debugged
- process the window is attached to.</p>
- </item>
+ <item><p>Same as in the <seealso marker="#monitor">Monitor
+ window</seealso>, but only affects the debugged
+ process the window is attached to.</p></item>
<tag><em>Strings</em></tag>
- <item><p>Same as in <seealso marker="#monitor">the Monitor
- window</seealso>, but only affects the debugged
- process the window is attached to.</p>
- </item>
+ <item><p>Same as in the <seealso marker="#monitor">Monitor
+ window</seealso>, but only affects the debugged
+ process the window is attached to.</p></item>
<tag><em>Back Trace Size...</em></tag>
- <item><p>Set how many call frames should be fetched when
+ <item><p>Sets how many call frames are to be fetched when
inspecting the call stack. Does not affect other Attach
- Process windows.</p>
- </item>
+ Process windows.</p></item>
</taglist>
</section>
<section>
- <title>Break, Windows and Help Menus</title>
+ <title>Break, Windows, and Help Menus</title>
- <p>The Break, Windows and Help menus look the same as in
- the Monitor window, see the chapter
- <seealso marker="#monitor">The Monitor Window</seealso>, except
- that the Breaks menu apply to the local breakpoints only.</p>
+ <p>The <em>Break</em>, <em>Windows</em>, and <em>Help</em> menus
+ are the same as in the
+ <seealso marker="#monitor">Monitor Window</seealso>, except
+ that the <em>Breaks</em> menu applies only to local
+ breakpoints.</p>
</section>
</section>
<section>
<marker id="view"/>
- <title>The View Module Window</title>
+ <title>View Module Window</title>
- <p>The View Module window shows the contents of an interpreted
+ <p>The View Module window displays the contents of an interpreted
module and makes it possible to set breakpoints.</p>
<image file="images/view.jpg">
- <icaption>The View Module Window.</icaption>
+ <icaption>View Module Window</icaption>
</image>
<p>The source code is indented and each line is prefixed with its
line number.</p>
- <p>Clicking a line will highlight it and select it to be the target
- of the breakpoint functions available from the Break menu.
- Doubleclicking a line will set a line breakpoint on that line.
- Doubleclicking a line with an existing breakpoint will remove
- the breakpoint.</p>
+ <p>Clicking a line highlights it and selects it to be the target
+ of the breakpoint functions available from the <em>Break</em> menu.
+ To set a line breakpoint on a line, double-click it.
+ To remove the breakpoint, double-click the line with an existing
+ breakpoint.</p>
<p>Breakpoints are marked with a stop symbol.</p>
<section>
<title>File and Edit Menus</title>
- <p>The File and Edit menus look the same as in the Attach Process
- window, see the chapter <seealso marker="#attach">The Attach
- Process Window</seealso>.</p>
+ <p>The <em>File</em> and <em>Edit</em> menus are the same as in the
+ <seealso marker="#attach">Attach Process Window</seealso>.</p>
</section>
<section>
- <title>Break, Windows and Help Menus</title>
+ <title>Break, Windows, and Help Menus</title>
- <p>The Break, Windows and Help menus look the same as in
- the Monitor window, see the chapter
- <seealso marker="#monitor">The Monitor Window</seealso>, except
- that the Breaks menu apply to the local breakpoints only.</p>
+ <p>The <em>Break</em>, <em>Windows</em>, and <em>Help</em> menus
+ are the same as in the
+ <seealso marker="#monitor">Monitor Window</seealso>, except
+ that the <em>Break</em> menu applies only to local breakpoints.</p>
</section>
</section>
@@ -862,14 +852,14 @@ c_break(Bindings) ->
<title>Performance</title>
<p>Execution of interpreted code is naturally slower than for
- regularly compiled modules. Using the Debugger also increases
+ regularly compiled modules. Using Debugger also increases
the number of processes in the system, as for each debugged
process another process (the meta process) is created.</p>
- <p>It is also worth to keep in mind that programs with timers may
+ <p>It is also worth to keep in mind that programs with timers can
behave differently when debugged. This is especially true when
- stopping the execution of a process, for example at a
- breakpoint. Timeouts can then occur in other processes that
+ stopping the execution of a process (for example, at a
+ breakpoint). Time-outs can then occur in other processes that
continue execution as normal.</p>
</section>
@@ -878,8 +868,8 @@ c_break(Bindings) ->
<p>Code loading works almost as usual, except that interpreted
modules are also stored in a database and debugged processes
- uses only this stored code. Re-interpreting an interpreted
- module will result in the new version being stored as well, but
+ use only this stored code. Reinterpreting an interpreted
+ module results in the new version being stored as well, but
does not affect existing processes executing an older version
of the code. This means that the code replacement mechanism of
Erlang does not work for debugged processes.</p>
@@ -888,22 +878,24 @@ c_break(Bindings) ->
<section>
<title>Debugging Remote Nodes</title>
- <p>By using <c>debugger:start/1</c>, it can be specified if Debugger
- should be started in local or global mode.</p>
+ <p>By using
+ <seealso marker="debugger#start/1">debugger:start/1</seealso>,
+ you can specify if Debugger is to be started in local or global
+ mode:</p>
<pre>
debugger:start(local | global)</pre>
- <p>If no argument is provided, Debugger is started in global mode.
- </p>
+
+ <p>If no argument is provided, Debugger starts in global mode.</p>
<p>In local mode, code is interpreted only at the current node.
In global mode, code is interpreted at all known nodes. Processes
- at other nodes executing interpreted code will automatically be
- shown in the Monitor window and can be attached to like any other
+ at other nodes executing interpreted code are automatically
+ displayed in the Monitor window and can be attached to like any other
debugged process.</p>
- <p>It is possible, but definitely not recommended to start Debugger
- in global mode on more than one node in a network, as they will
- interfere with each other leading to inconsistent behaviour.</p>
+ <p>It is possible, but definitely not recommended, to start Debugger
+ in global mode on more than one node in a network, as the nodes
+ interfere with each other, leading to inconsistent behavior.</p>
</section>
</chapter>
diff --git a/lib/debugger/doc/src/i.xml b/lib/debugger/doc/src/i.xml
index 9ceba94b44..628b91e9e4 100644
--- a/lib/debugger/doc/src/i.xml
+++ b/lib/debugger/doc/src/i.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,35 +29,36 @@
<rev></rev>
</header>
<module>i</module>
- <modulesummary>Debugger/Interpreter Interface</modulesummary>
+ <modulesummary>Debugger/Interpreter Interface.</modulesummary>
<description>
- <p>The module <c>i</c> provides short forms for some of
+ <p>The <c>i</c> module provides short forms for some of
the functions used by the graphical Debugger and some of
- the functions in the <c>int</c> module, the Erlang interpreter.
- </p>
+ the functions in module
+ <seealso marker="int"><c>int</c></seealso>, the Erlang interpreter.</p>
<p>This module also provides facilities for displaying status
information about interpreted processes and break points.</p>
<p>It is possible to attach to interpreted processes by giving
the corresponding process identity only. By default, an attachment
- window pops up. Processes at other Erlang nodes can be
+ window is displayed. Processes at other Erlang nodes can be
attached manually or automatically.</p>
- <p>By preference, these functions can be included in the module
- <c>shell_default</c>. By default, they are.</p>
+ <p>By preference, these functions can be included in module
+ <seealso marker="stdlib:shell_default"><c>shell_default</c></seealso>.
+ By default, they are included in that module.</p>
</description>
<funcs>
<func>
<name>im() -> pid()</name>
- <fsummary>Start a graphical monitor</fsummary>
+ <fsummary>Start a graphical monitor.</fsummary>
<desc>
<p>Starts a new graphical monitor. This is the Monitor window,
- the main window of the Debugger. All of the Debugger and
+ the main window of Debugger. All the Debugger and
interpreter functionality is accessed from the Monitor window.
- The Monitor window displays the status of all processes that
- have been/are executing interpreted modules.</p>
+ This window displays the status of all processes that
+ have been or are executing interpreted modules.</p>
</desc>
</func>
@@ -66,7 +67,7 @@
<name>ii(AbsModule) -> {module, Module} | error</name>
<name>ini(AbsModules) -> ok</name>
<name>ini(AbsModule) -> {module, Module} | error</name>
- <fsummary>Interpret a module</fsummary>
+ <fsummary>Interpret a module.</fsummary>
<type>
<v>AbsModules = [AbsModule]</v>
<v>AbsModule = Module | File</v>
@@ -85,7 +86,7 @@
<func>
<name>iq(AbsModule) -> ok</name>
<name>inq(AbsModule) -> ok</name>
- <fsummary>Stop interpreting a module</fsummary>
+ <fsummary>Stop interpreting a module.</fsummary>
<type>
<v>AbsModule = Module | File</v>
<v>&nbsp;Module = atom()</v>
@@ -110,28 +111,27 @@
<func>
<name>ip() -> ok</name>
- <fsummary>Make a printout of the current status of all interpreted
- processes</fsummary>
+ <fsummary>Print the current status of all interpreted
+ processes.</fsummary>
<desc>
- <p>Makes a printout of the current status of all interpreted
- processes.</p>
+ <p>Prints the current status of all interpreted processes.</p>
</desc>
</func>
<func>
<name>ic() -> ok</name>
<fsummary>Clear information about processes executing interpreted
- code</fsummary>
+ code.</fsummary>
<desc>
<p>Clears information about processes executing interpreted code
- byt removing all information about terminated processes.</p>
+ by removing all information about terminated processes.</p>
</desc>
</func>
<func>
<name>iaa(Flags) -> true</name>
<name>iaa(Flags, Function) -> true</name>
- <fsummary>Set when and how to attach to a process</fsummary>
+ <fsummary>Set when and how to attach to a process.</fsummary>
<type>
<v>Flags = [init | break | exit]</v>
<v>Function = {Module,Name,Args}</v>
@@ -139,42 +139,41 @@
<v>&nbsp;Args = [term()]</v>
</type>
<desc>
- <p>Sets when and how to automatically attach to a debugged
- process, see
+ <p>Sets when and how to attach to a debugged process
+ automatically, see
<seealso marker="int#auto_attach/0">int:auto_attach/2</seealso>.
<c>Function</c> defaults to the standard function used by
- the Debugger.</p>
+ Debugger.</p>
</desc>
</func>
<func>
<name>ist(Flag) -> true</name>
- <fsummary>Set how to save call frames</fsummary>
+ <fsummary>Set how to save call frames.</fsummary>
<type>
<v>Flag = all | no_tail | false</v>
</type>
<desc>
<p>Sets how to save call frames in the stack, see
- <seealso marker="int#stack_trace/0">int:stack_trace/1</seealso>.
- </p>
+ <seealso marker="int#stack_trace/0">int:stack_trace/1</seealso>.</p>
</desc>
</func>
<func>
<name>ia(Pid) -> ok | no_proc</name>
- <fsummary>Attach to a process</fsummary>
+ <fsummary>Attache to a process.</fsummary>
<type>
<v>Pid = pid()</v>
</type>
<desc>
- <p>Attaches to the debugged process <c>Pid</c>. A Debugger
+ <p>Attaches to the debugged process <c>Pid</c>. An
Attach Process window is opened for the process.</p>
</desc>
</func>
<func>
<name>ia(X,Y,Z) -> ok | no_proc</name>
- <fsummary>Attach to a process</fsummary>
+ <fsummary>Attache to a process.</fsummary>
<type>
<v>X = Y = Z = int()</v>
</type>
@@ -186,7 +185,7 @@
<func>
<name>ia(Pid, Function) -> ok | no_proc</name>
- <fsummary>Attach to a process</fsummary>
+ <fsummary>Attache to a process.</fsummary>
<type>
<v>Pid = pid()</v>
<v>Function = {Module,Name}</v>
@@ -194,14 +193,14 @@
</type>
<desc>
<p>Attaches to the debugged process <c>Pid</c>. The interpreter
- will call <c>spawn(Module, Name, [Pid])</c> (and ignore
+ calls <c>spawn(Module, Name, [Pid])</c> (and ignores
the result).</p>
</desc>
</func>
<func>
<name>ia(X,Y,Z, Function) -> ok | no_proc</name>
- <fsummary>Attach to a process</fsummary>
+ <fsummary>Attache to a process.</fsummary>
<type>
<v>X = Y = Z = int()</v>
<v>Function = {Module,Name}</v>
@@ -211,15 +210,15 @@
<p>Same as <c>ia(Pid, Function)</c>, where <c>Pid</c> is
the result of calling the shell function <c>pid(X,Y,Z)</c>.
An attached process is expected to call the unofficial
- <c>int:attached(Pid)</c> function and to be able to handle
- messages from the interpreter, see <c>dbg_wx_trace.erl</c> for
- an example.</p>
+ function <c>int:attached(Pid)</c> and to be able to handle
+ messages from the interpreter. For an example, see
+ <c>dbg_wx_trace.erl</c>.</p>
</desc>
</func>
<func>
<name>ib(Module, Line) -> ok | {error, break_exists}</name>
- <fsummary>Create a breakpoint</fsummary>
+ <fsummary>Create a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
@@ -232,20 +231,20 @@
<func>
<name>ib(Module, Name, Arity) -> ok | {error, function_not_found}
</name>
- <fsummary>Create breakpoints in the specified function</fsummary>
+ <fsummary>Create breakpoints in the specified function.</fsummary>
<type>
<v>Module = Name = atom()</v>
<v>Arity = int()</v>
</type>
<desc>
<p>Creates breakpoints at the first line of every clause of
- the <c>Module:Name/Arity</c> function.</p>
+ function <c>Module:Name/Arity</c>.</p>
</desc>
</func>
<func>
<name>ir() -> ok</name>
- <fsummary>Delete all breakpoints</fsummary>
+ <fsummary>Delete all breakpoints.</fsummary>
<desc>
<p>Deletes all breakpoints.</p>
</desc>
@@ -253,7 +252,7 @@
<func>
<name>ir(Module) -> ok</name>
- <fsummary>Delete all breakpoints in a module</fsummary>
+ <fsummary>Delete all breakpoints in a module.</fsummary>
<type>
<v>Module = atom()</v>
</type>
@@ -264,61 +263,57 @@
<func>
<name>ir(Module, Line) -> ok</name>
- <fsummary>Delete a breakpoint</fsummary>
+ <fsummary>Delete a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
</type>
<desc>
- <p>Deletes the breakpoint located at <c>Line</c> in
- <c>Module</c>.</p>
+ <p>Deletes the breakpoint at <c>Line</c> in <c>Module</c>.</p>
</desc>
</func>
<func>
<name>ir(Module, Name, Arity) -> ok | {error, function_not_found}
</name>
- <fsummary>Delete breakpoints from the specified function
- </fsummary>
+ <fsummary>Delete breakpoints from the specified function.</fsummary>
<type>
<v>Module = Name = atom()</v>
<v>Arity = int()</v>
</type>
<desc>
<p>Deletes the breakpoints at the first line of every clause of
- the <c>Module:Name/Arity</c> function.</p>
+ function <c>Module:Name/Arity</c>.</p>
</desc>
</func>
<func>
<name>ibd(Module, Line) -> ok</name>
- <fsummary>Make a breakpoint inactive</fsummary>
+ <fsummary>Make a breakpoint inactive.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
</type>
<desc>
- <p>Makes the breakpoint at <c>Line</c> in <c>Module</c>
- inactive.</p>
+ <p>Makes the breakpoint at <c>Line</c> in <c>Module</c> inactive.</p>
</desc>
</func>
<func>
<name>ibe(Module, Line) -> ok</name>
- <fsummary>Make a breakpoint active</fsummary>
+ <fsummary>Make a breakpoint active.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
</type>
<desc>
- <p>Makes the breakpoint at <c>Line</c> in <c>Module</c> active.
- </p>
+ <p>Makes the breakpoint at <c>Line</c> in <c>Module</c> active.</p>
</desc>
</func>
<func>
<name>iba(Module, Line, Action) -> ok</name>
- <fsummary>Set the trigger action of a breakpoint</fsummary>
+ <fsummary>Set the trigger action of a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
@@ -332,7 +327,7 @@
<func>
<name>ibc(Module, Line, Function) -> ok</name>
- <fsummary>Set the conditional test of a breakpoint</fsummary>
+ <fsummary>Set the conditional test of a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
@@ -346,46 +341,44 @@
<p>The conditional test is performed by calling
<c>Module:Name(Bindings)</c>, where <c>Bindings</c> is
the current variable bindings. The function must return
- <c>true</c> (break) or <c>false</c> (do not break). Use
- <c>int:get_binding(Var, Bindings)</c> to retrieve the value
- of a variable <c>Var</c>.</p>
+ <c>true</c> (break) or <c>false</c> (do not break).
+ To retrieve the value of a variable <c>Var</c>, use
+ <seealso marker="int#get_binding/2">int:get_binding(Var, Bindings)</seealso>.</p>
</desc>
</func>
<func>
<name>ipb() -> ok</name>
- <fsummary>Make a printout of all existing breakpoints</fsummary>
+ <fsummary>Print all existing breakpoints.</fsummary>
<desc>
- <p>Makes a printout of all existing breakpoints.</p>
+ <p>Prints all existing breakpoints.</p>
</desc>
</func>
<func>
<name>ipb(Module) -> ok</name>
- <fsummary>Make a printout of all breakpoints in a module
- </fsummary>
+ <fsummary>Print all existing breakpoints in a module.</fsummary>
<type>
<v>Module = atom()</v>
</type>
<desc>
- <p>Makes a printout of all existing breakpoints in
- <c>Module</c>.</p>
+ <p>Prints all existing breakpoints in <c>Module</c>.</p>
</desc>
</func>
<func>
<name>iv() -> atom()</name>
- <fsummary>Current version number of the interpreter</fsummary>
+ <fsummary>Return the current version number of the interpreter.
+ </fsummary>
<desc>
<p>Returns the current version number of the interpreter.
- The same as the version number of the Debugger application.
- </p>
+ Same as the version number of the Debugger application.</p>
</desc>
</func>
<func>
<name>help() -> ok</name>
- <fsummary>Print help text</fsummary>
+ <fsummary>Print help text.</fsummary>
<desc>
<p>Prints help text.</p>
</desc>
@@ -393,15 +386,8 @@
</funcs>
<section>
- <title>Usage</title>
-
- <p>Refer to the Debugger User's Guide for information about
- the Debugger.</p>
- </section>
-
- <section>
<title>See Also</title>
- <p><c>int(3)</c></p>
+ <p><seealso marker="int"><c>int(3)</c></seealso></p>
</section>
</erlref>
diff --git a/lib/debugger/doc/src/int.xml b/lib/debugger/doc/src/int.xml
index ea21d04a07..31e9dfe923 100644
--- a/lib/debugger/doc/src/int.xml
+++ b/lib/debugger/doc/src/int.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1998</year><year>2013</year>
+ <year>1998</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -29,16 +29,16 @@
<rev></rev>
</header>
<module>int</module>
- <modulesummary>Interpreter Interface</modulesummary>
+ <modulesummary>Interpreter Interface.</modulesummary>
<description>
<p>The Erlang interpreter provides mechanisms for breakpoints and
- stepwise execution of code. It is mainly intended to be used by
- the <em>Debugger</em>, see Debugger User's Guide and
- <c>debugger(3)</c>.</p>
+ stepwise execution of code. It is primarily intended to be used by
+ Debugger, see the User's Guide and
+ <seealso marker="debugger"><c>debugger(3)</c></seealso>.</p>
- <p>From the shell, it is possible to:</p>
- <list>
- <item>Specify which modules should be interpreted.</item>
+ <p>The following can be done from the shell:</p>
+ <list type="bulleted">
+ <item>Specify the modules to be interpreted.</item>
<item>Specify breakpoints.</item>
<item>Monitor the current status of all processes executing code
in interpreted modules, also processes at other Erlang nodes.
@@ -48,45 +48,48 @@
<p>By <em>attaching to</em> a process executing interpreted code, it
is possible to examine variable bindings and order stepwise
execution. This is done by sending and receiving information
- to/from the process via a third process, called the meta process.
- It is possible to implement your own attached process. See
+ to/from the process through a third process, called the meta
+ process. You can implement your own attached process. See
<c>int.erl</c> for available functions and <c>dbg_wx_trace.erl</c>
for possible messages.</p>
- <p>The interpreter depends on the Kernel, STDLIB and GS
- applications, which means modules belonging to any of these
- applications are not allowed to be interpreted as it could lead
+ <p>The interpreter depends on the Kernel, STDLIB, and
+ GS applications. This means that modules belonging to any of
+ these applications are not allowed to be interpreted, as it could lead
to a deadlock or emulator crash. This also applies to modules
- belonging to the Debugger application itself.</p>
+ belonging to the Debugger application.</p>
</description>
<section>
+ <marker id="int_breakpoints"/>
<title>Breakpoints</title>
<p>Breakpoints are specified on a line basis. When a process
executing code in an interpreted module reaches a breakpoint, it
- will stop. This means that that a breakpoint must be set at an
- executable line, that is, a line of code containing an executable
+ stops. This means that a breakpoint must be set at an
+ executable line, that is, a code line containing an executable
expression.</p>
- <p>A breakpoint have a status, a trigger action and may have a
- condition associated with it. The status is either <em>active</em>
- or <em>inactive</em>. An inactive breakpoint is ignored. When a
- breakpoint is reached, the trigger action specifies if
- the breakpoint should continue to be active (<em>enable</em>), if
- it should become inactive (<em>disable</em>), or if it should be
- removed (<em>delete</em>). A condition is a tuple
- <c>{Module,Name}</c>. When the breakpoint is reached,
- <c>Module:Name(Bindings)</c> is called. If this evaluates to
- <c>true</c>, execution will stop. If this evaluates to
- <c>false</c>, the breakpoint is ignored. <c>Bindings</c> contains
- the current variable bindings, use <c>get_binding</c> to retrieve
- the value for a given variable.</p>
+ <p>A breakpoint has the following:</p>
+ <list type="bulleted">
+ <item>A status, which is <em>active</em> or <em>inactive</em>. An
+ inactive breakpoint is ignored.</item>
+ <item>A trigger action. When a breakpoint is reached, the trigger
+ action specifies if the breakpoint is to continue as active
+ (<em>enable</em>), or to become inactive (<em>disable</em>), or
+ to be removed (<em>delete</em>).</item>
+ <item>Optionally an associated condition. A condition is a tuple
+ <c>{Module,Name}</c>. When the breakpoint is reached,
+ <c>Module:Name(Bindings)</c> is called. If it evaluates to
+ <c>true</c>, execution stops. If it evaluates to <c>false</c>,
+ the breakpoint is ignored. <c>Bindings</c> contains the current
+ variable bindings. To retrieve the value for a specified variable,
+ use <c>get_binding</c>.</item>
+ </list>
<p>By default, a breakpoint is active, has trigger action
- <c>enable</c> and has no condition associated with it. For more
- detailed information about breakpoints, refer to Debugger User's
- Guide.</p>
+ <c>enable</c>, and has no associated condition. For details
+ about breakpoints, see the User's Guide.</p>
</section>
<funcs>
@@ -95,7 +98,7 @@
<name>i(AbsModules) -> ok</name>
<name>ni(AbsModule) -> {module,Module} | error</name>
<name>ni(AbsModules) -> ok</name>
- <fsummary>Interpret a module</fsummary>
+ <fsummary>Interpret a module.</fsummary>
<type>
<v>AbsModules = [AbsModule]</v>
<v>AbsModule = Module | File | [Module | File]</v>
@@ -107,41 +110,43 @@
the module only at the current node. <c>ni/1</c> interprets
the module at all known nodes.</p>
- <p>A module may be given by its module name (atom) or by its
- file name. If given by its module name, the object code
+ <p>A module can be specified by its module name (atom) or
+ filename.</p>
+
+ <p>If specified by its module name, the object code
<c>Module.beam</c> is searched for in the current path.
The source code <c>Module.erl</c> is searched for first in
- the same directory as the object code, then in a <c>src</c>
+ the same directory as the object code, then in an <c>src</c>
directory next to it.</p>
- <p>If given by its file name, the file name may include a path
- and the <c>.erl</c> extension may be omitted. The object code
+ <p>If specified by its filename, the filename can include a path
+ and the <c>.erl</c> extension can be omitted. The object code
<c>Module.beam</c> is searched for first in the same directory
as the source code, then in an <c>ebin</c> directory next to
it, and then in the current path.</p>
<note>
- <p>The interpreter needs both the source code and the object
- code, and the object code <em>must</em> include debug
- information. That is, only modules compiled with the option
+ <p>The interpreter requires both the source code and the object
+ code. The object code <em>must</em> include debug
+ information, that is, only modules compiled with option
<c>debug_info</c> set can be interpreted.</p>
</note>
<p>The functions returns <c>{module,Module}</c> if the module
- was interpreted, or <c>error</c> if it was not.</p>
+ was interpreted, otherwise <c>error</c> is returned.</p>
- <p>The argument may also be a list of modules/file names, in
+ <p>The argument can also be a list of modules or filenames, in
which case the function tries to interpret each module as
- specified above. The function then always returns <c>ok</c>,
- but prints some information to stdout if a module could not be
- interpreted.</p>
+ specified earlier. The function then always returns <c>ok</c>,
+ but prints some information to <c>stdout</c> if a module
+ cannot be interpreted.</p>
</desc>
</func>
<func>
<name>n(AbsModule) -> ok</name>
<name>nn(AbsModule) -> ok</name>
- <fsummary>Stop interpreting a module</fsummary>
+ <fsummary>Stop interpreting a module.</fsummary>
<type>
<v>AbsModule = Module | File | [Module | File]</v>
<v>&nbsp;Module = atom()</v>
@@ -152,14 +157,14 @@
interpreting the module only at the current node. <c>nn/1</c>
stops interpreting the module at all known nodes.</p>
- <p>As for <c>i/1</c> and <c>ni/1</c>, a module may be given by
- either its module name or its file name.</p>
+ <p>As for <c>i/1</c> and <c>ni/1</c>, a module can be specified by
+ its module name or filename.</p>
</desc>
</func>
<func>
<name>interpreted() -> [Module]</name>
- <fsummary>Get all interpreted modules</fsummary>
+ <fsummary>Get all interpreted modules.</fsummary>
<type>
<v>Module = atom()</v>
</type>
@@ -170,20 +175,20 @@
<func>
<name>file(Module) -> File | {error,not_loaded}</name>
- <fsummary>Get the file name for an interpreted module</fsummary>
+ <fsummary>Get the filename for an interpreted module.</fsummary>
<type>
<v>Module = atom()</v>
<v>File = string()</v>
</type>
<desc>
- <p>Returns the source code file name <c>File</c> for an
+ <p>Returns the source code filename <c>File</c> for an
interpreted module <c>Module</c>.</p>
</desc>
</func>
<func>
<name>interpretable(AbsModule) -> true | {error,Reason}</name>
- <fsummary>Check if a module is possible to interpret</fsummary>
+ <fsummary>Check if a module can be interpreted.</fsummary>
<type>
<v>AbsModule = Module | File</v>
<v>&nbsp;Module = atom()</v>
@@ -193,45 +198,59 @@
<v>&nbsp;App = atom()</v>
</type>
<desc>
- <p>Checks if a module is possible to interpret. The module can
- be given by its module name <c>Module</c> or its source file
- name <c>File</c>. If given by a module name, the module is
- searched for in the code path.</p>
-
- <p>The function returns <c>true</c> if both source code and
- object code for the module is found, the module has been
- compiled with the option <c>debug_info</c> set and does not
- belong to any of the applications Kernel, STDLIB, GS or
- Debugger itself.</p>
-
- <p>The function returns <c>{error,Reason}</c> if the module for
- some reason is not possible to interpret.</p>
-
- <p><c>Reason</c> is <c>no_src</c> if no source code is found or
- <c>no_beam</c> if no object code is found. It is assumed that
- the source- and object code are located either in the same
- directory, or in <c>src</c> and <c>ebin</c> directories next
- to each other.</p>
-
- <p><c>Reason</c> is <c>no_debug_info</c> if the module has not
- been compiled with the option <c>debug_info</c> set.</p>
-
- <p><c>Reason</c> is <c>badarg</c> if <c>AbsModule</c> is not
- found. This could be because the specified file does not
- exist, or because <c>code:which/1</c> does not return a
- beam file name, which is the case not only for non-existing
- modules but also for modules which are preloaded or cover
- compiled.</p>
-
- <p><c>Reason</c> is <c>{app,App}</c> where <c>App</c> is
- <c>kernel</c>, <c>stdlib</c>, <c>gs</c> or <c>debugger</c> if
- <c>AbsModule</c> belongs to one of these applications.</p>
-
- <p>Note that the function can return <c>true</c> for a module
- which in fact is not interpretable in the case where
+ <p>Checks if a module can be interpreted. The module can be
+ specified by its module name <c>Module</c> or its source
+ filename <c>File</c>. If specified by a module name, the module
+ is searched for in the code path.</p>
+
+ <p>The function returns <c>true</c> if all of the following
+ apply:</p>
+ <list type="bulleted">
+ <item>Both source code and object code for the module is
+ found.</item>
+ <item>The module has been compiled with option <c>debug_info</c>
+ set.</item>
+ <item>The module does not belong to any of the applications
+ Kernel, STDLIB, GS, or Debugger.</item>
+ </list>
+
+ <p>The function returns <c>{error,Reason}</c> if the module cannot
+ be interpreted. <c>Reason</c> can have the following values:</p>
+ <taglist>
+ <tag><c>no_src</c></tag>
+ <item><p>No source code is found.
+ It is assumed that the source code and object code are located
+ either in the same directory, or in <c>src</c> and <c>ebin</c>
+ directories next to each other.</p></item>
+
+ <tag><c>no_beam</c></tag>
+ <item><p>No object code is found.
+ It is assumed that the source code and object code are located
+ either in the same directory, or in <c>src</c> and <c>ebin</c>
+ directories next to each other.</p></item>
+
+ <tag><c>no_debug_info</c></tag>
+ <item><p>The module has not been compiled with option
+ <c>debug_info</c> set.</p></item>
+
+ <tag><c>badarg</c></tag>
+ <item><p><c>AbsModule</c> is not found. This could be because
+ the specified file does not exist, or because
+ <c>code:which/1</c> does not return a BEAM filename,
+ which is the case not only for non-existing modules but also
+ for modules that are preloaded or cover-compiled.</p></item>
+
+ <tag><c>{app,App}</c></tag>
+ <item><p><c>App</c> is <c>kernel</c>, <c>stdlib</c>, <c>gs</c>,
+ or <c>debugger</c> if <c>AbsModule</c> belongs to one of these
+ applications.</p></item>
+ </taglist>
+
+ <p>Notice that the function can return <c>true</c> for a module
+ that in fact is not interpretable in the case where
the module is marked as sticky or resides in a directory
- marked as sticky, as this is not discovered until
- the interpreter actually tries to load the module.</p>
+ marked as sticky. The reason is that this is not discovered
+ until the interpreter tries to load the module.</p>
</desc>
</func>
@@ -239,7 +258,7 @@
<name>auto_attach() -> false | {Flags,Function}</name>
<name>auto_attach(false)</name>
<name>auto_attach(Flags, Function)</name>
- <fsummary>Get/set when and how to attach to a process</fsummary>
+ <fsummary>Get and set when and how to attach to a process.</fsummary>
<type>
<v>Flags = [init | break | exit]</v>
<v>Function = {Module,Name,Args}</v>
@@ -247,24 +266,24 @@
<v>&nbsp;Args = [term()]</v>
</type>
<desc>
- <p>Gets and sets when and how to automatically attach to a
+ <p>Gets and sets when and how to attach automatically to a
process executing code in interpreted modules. <c>false</c>
- means never automatically attach, this is the default.
+ means never attach automatically, this is the default.
Otherwise automatic attach is defined by a list of flags and
- a function. The following flags may be specified:</p>
- <list>
- <item><c>init</c> - attach when a process for the very first
+ a function. The following flags can be specified:</p>
+ <list type="bulleted">
+ <item><c>init</c> - Attach when a process for the first
time calls an interpreted function.</item>
- <item><c>break</c> - attach whenever a process reaches a
+ <item><c>break</c> - Attach whenever a process reaches a
breakpoint.</item>
- <item><c>exit</c> - attach when a process terminates.</item>
+ <item><c>exit</c> - Attach when a process terminates.</item>
</list>
<p>When the specified event occurs, the function <c>Function</c>
- will be called as:</p>
+ is called as:</p>
<pre>
-spawn(Module, Name, [Pid | Args])
- </pre>
+spawn(Module, Name, [Pid | Args])</pre>
+
<p><c>Pid</c> is the pid of the process executing interpreted
code.</p>
</desc>
@@ -273,7 +292,7 @@ spawn(Module, Name, [Pid | Args])
<func>
<name>stack_trace() -> Flag</name>
<name>stack_trace(Flag)</name>
- <fsummary>Get/set if and how to save call frames</fsummary>
+ <fsummary>Get and set if and how to save call frames.</fsummary>
<type>
<v>Flag = all | no_tail | false</v>
</type>
@@ -281,25 +300,30 @@ spawn(Module, Name, [Pid | Args])
<p>Gets and sets how to save call frames in the stack. Saving
call frames makes it possible to inspect the call chain of a
process, and is also used to emulate the stack trace if an
- error (an exception of class error) occurs.</p>
- <list>
- <item><c>all</c> - save information about all current calls,
- that is, function calls that have not yet returned a value.
- </item>
- <item><c>no_tail</c> - save information about current calls,
+ error (an exception of class error) occurs. The following
+ flags can be specified:</p>
+ <taglist>
+ <tag><c>all</c></tag>
+ <item><p>Save information about all current calls,
+ that is, function calls that have not yet returned a value.</p>
+ </item>
+
+ <tag><c>no_tail</c></tag>
+ <item><p>Save information about current calls,
but discard previous information when a tail recursive call
- is made. This option consumes less memory and may be
+ is made. This option consumes less memory and can be
necessary to use for processes with long lifetimes and many
- tail recursive calls. This is the default.</item>
- <item><c>false</c> - do not save any information about current
- calls.</item>
- </list>
+ tail recursive calls. This is the default.</p></item>
+
+ <tag><c>false</c></tag>
+ <item><p>Save no information about currentcalls.</p></item>
+ </taglist>
</desc>
</func>
<func>
<name>break(Module, Line) -> ok | {error,break_exists}</name>
- <fsummary>Create a breakpoint</fsummary>
+ <fsummary>Create a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
@@ -311,86 +335,80 @@ spawn(Module, Name, [Pid | Args])
<func>
<name>delete_break(Module, Line) -> ok</name>
- <fsummary>Delete a breakpoint</fsummary>
+ <fsummary>Delete a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
</type>
<desc>
- <p>Deletes the breakpoint located at <c>Line</c> in
- <c>Module</c>.</p>
+ <p>Deletes the breakpoint at <c>Line</c> in <c>Module</c>.</p>
</desc>
</func>
<func>
<name>break_in(Module, Name, Arity) -> ok
| {error,function_not_found}</name>
- <fsummary>Create breakpoints in the specified function</fsummary>
+ <fsummary>Create breakpoints in the specified function.</fsummary>
<type>
<v>Module = Name = atom()</v>
<v>Arity = int()</v>
</type>
<desc>
<p>Creates a breakpoint at the first line of every clause of
- the <c>Module:Name/Arity</c> function.</p>
+ function <c>Module:Name/Arity</c>.</p>
</desc>
</func>
<func>
<name>del_break_in(Module, Name, Arity) -> ok
| {error,function_not_found}</name>
- <fsummary>Delete breakpoints from the specified function
- </fsummary>
+ <fsummary>Delete breakpoints from the specified function.</fsummary>
<type>
<v>Module = Name = atom()</v>
<v>Arity = int()</v>
</type>
<desc>
<p>Deletes the breakpoints at the first line of every clause of
- the <c>Module:Name/Arity</c> function.
- </p>
+ function <c>Module:Name/Arity</c>.</p>
</desc>
</func>
<func>
<name>no_break() -> ok</name>
<name>no_break(Module) -> ok</name>
- <fsummary>Delete all breakpoints</fsummary>
+ <fsummary>Delete all breakpoints.</fsummary>
<desc>
- <p>Deletes all breakpoints, or all breakpoints in <c>Module</c>.
- </p>
+ <p>Deletes all breakpoints, or all breakpoints in <c>Module</c>.</p>
</desc>
</func>
<func>
<name>disable_break(Module, Line) -> ok</name>
- <fsummary>Make a breakpoint inactive</fsummary>
+ <fsummary>Make a breakpoint inactive.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
</type>
<desc>
- <p>Makes the breakpoint at <c>Line</c> in <c>Module</c>
- inactive.</p>
+ <p>Makes the breakpoint at <c>Line</c> in <c>Module</c> inactive.</p>
</desc>
</func>
<func>
<name>enable_break(Module, Line) -> ok</name>
- <fsummary>Make a breakpoint active</fsummary>
+ <fsummary>Make a breakpoint active.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
</type>
<desc>
- <p>Makes the breakpoint at <c>Line</c> in <c>Module</c> active.
- </p>
+ <p>Makes the breakpoint at <c>Line</c> in <c>Module</c> active.</p>
</desc>
</func>
<func>
<name>action_at_break(Module, Line, Action) -> ok</name>
- <fsummary>Set the trigger action of a breakpoint</fsummary>
+ <fsummary>Set the trigger action of a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
@@ -404,7 +422,7 @@ spawn(Module, Name, [Pid | Args])
<func>
<name>test_at_break(Module, Line, Function) -> ok</name>
- <fsummary>Set the conditional test of a breakpoint</fsummary>
+ <fsummary>Set the conditional test of a breakpoint.</fsummary>
<type>
<v>Module = atom()</v>
<v>Line = int()</v>
@@ -414,14 +432,14 @@ spawn(Module, Name, [Pid | Args])
<desc>
<p>Sets the conditional test of the breakpoint at <c>Line</c> in
<c>Module</c> to <c>Function</c>. The function must
- fulfill the requirements specified in the section
- <em>Breakpoints</em> above.</p>
+ fulfill the requirements specified in section
+ <seealso marker="#int_breakpoints">Breakpoints</seealso>.</p>
</desc>
</func>
<func>
<name>get_binding(Var, Bindings) -> {value,Value} | unbound</name>
- <fsummary>Retrieve a variable binding</fsummary>
+ <fsummary>Retrieve a variable binding.</fsummary>
<type>
<v>Var = atom()</v>
<v>Bindings = term()</v>
@@ -437,7 +455,7 @@ spawn(Module, Name, [Pid | Args])
<func>
<name>all_breaks() -> [Break]</name>
<name>all_breaks(Module) -> [Break]</name>
- <fsummary>Get all breakpoints</fsummary>
+ <fsummary>Get all breakpoints.</fsummary>
<type>
<v>Break = {Point,Options}</v>
<v>&nbsp;Point = {Module,Line}</v>
@@ -451,15 +469,14 @@ spawn(Module, Name, [Pid | Args])
<v>&nbsp;&nbsp;&nbsp;&nbsp;Name = atom()</v>
</type>
<desc>
- <p>Gets all breakpoints, or all breakpoints in <c>Module</c>.
- </p>
+ <p>Gets all breakpoints, or all breakpoints in <c>Module</c>.</p>
</desc>
</func>
<func>
<name>snapshot() -> [Snapshot]</name>
<fsummary>Get information about all processes executing interpreted
- code</fsummary>
+ code.</fsummary>
<type>
<v>Snapshot = {Pid, Function, Status, Info}</v>
<v>&nbsp;Pid = pid()</v>
@@ -475,26 +492,27 @@ spawn(Module, Name, [Pid | Args])
<desc>
<p>Gets information about all processes executing interpreted code.
</p>
- <list>
- <item><c>Pid</c> - process identifier.</item>
- <item><c>Function</c> - first interpreted function called by
+ <list type="bulleted">
+ <item><c>Pid</c> - Process identifier.</item>
+ <item><c>Function</c> - First interpreted function called by
the process.</item>
- <item><c>Status</c> - current status of the process.</item>
- <item><c>Info</c> - additional information.</item>
+ <item><c>Status</c> - Current status of the process.</item>
+ <item><c>Info</c> - More information.</item>
</list>
- <p><c>Status</c> is one of:</p>
- <list>
- <item><c>idle</c> - the process is no longer executing
+
+ <p><c>Status</c> is one of the following:</p>
+ <list type="bulleted">
+ <item><c>idle</c> - The process is no longer executing
interpreted code. <c>Info={}</c>.</item>
- <item><c>running</c> - the process is running. <c>Info={}</c>.
+ <item><c>running</c> - The process is running. <c>Info={}</c>.
</item>
- <item><c>waiting</c> - the process is waiting at a
+ <item><c>waiting</c> - The process is waiting at a
<c>receive</c>. <c>Info={}</c>.</item>
- <item><c>break</c> - process execution has been stopped,
+ <item><c>break</c> - Process execution is stopped,
normally at a breakpoint. <c>Info={Module,Line}</c>.</item>
- <item><c>exit</c> - the process has terminated.
+ <item><c>exit</c> - The process is terminated.
<c>Info=ExitReason</c>.</item>
- <item><c>no_conn</c> - the connection is down to the node
+ <item><c>no_conn</c> - The connection is down to the node
where the process is running. <c>Info={}</c>.</item>
</list>
</desc>
@@ -503,7 +521,7 @@ spawn(Module, Name, [Pid | Args])
<func>
<name>clear() -> ok</name>
<fsummary>Clear information about processes executing interpreted
- code</fsummary>
+ code.</fsummary>
<desc>
<p>Clears information about processes executing interpreted code
by removing all information about terminated processes.</p>
@@ -513,13 +531,13 @@ spawn(Module, Name, [Pid | Args])
<func>
<name>continue(Pid) -> ok | {error,not_interpreted}</name>
<name>continue(X,Y,Z) -> ok | {error,not_interpreted}</name>
- <fsummary>Resume process execution</fsummary>
+ <fsummary>Resume process execution.</fsummary>
<type>
<v>Pid = pid()</v>
<v>X = Y = Z = int()</v>
</type>
<desc>
- <p>Resume process execution for <c>Pid</c>, or for
+ <p>Resumes process execution for <c>Pid</c> or
<c>c:pid(X,Y,Z)</c>.</p>
</desc>
</func>
diff --git a/lib/debugger/doc/src/introduction.xml b/lib/debugger/doc/src/introduction.xml
new file mode 100644
index 0000000000..95a42cad09
--- /dev/null
+++ b/lib/debugger/doc/src/introduction.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE chapter SYSTEM "chapter.dtd">
+
+<chapter>
+<header>
+ <copyright>
+ <year>1997</year><year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ 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.
+
+ </legalnotice>
+
+ <title>Introduction</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date></date>
+ <rev></rev>
+ <file>introduction.xml</file>
+ </header>
+
+ <section>
+ <title>Scope</title>
+ <p>Debugger is a graphical user interface for the Erlang
+ interpreter, which can be used for debugging and testing of
+ Erlang programs. For example, breakpoints can be set, code can be
+ single-stepped and variable values can be displayed and changed.
+ </p>
+
+ <p>The Erlang interpreter can also be accessed through the interface
+ module <seealso marker="int"><c>int(3)</c></seealso>.
+ </p>
+
+ <warning>
+ <p>Debugger might at some point
+ start tracing on the processes that execute the interpreted
+ code. This means that a conflict occurs if tracing by other
+ means is started on any of these processes.</p>
+ </warning>
+ </section>
+
+ <section>
+ <title>Prerequisites</title>
+ <p>It is assumed that the reader is familiar with the Erlang
+ programming language.</p>
+ <p>Modules to be debugged must include debug information,
+ for example, <c>erlc +debug_info MODULE.erl</c>.</p>
+ </section>
+
+</chapter>
+
+
diff --git a/lib/debugger/doc/src/notes.xml b/lib/debugger/doc/src/notes.xml
index 67cfe20d83..93bc46ddbe 100644
--- a/lib/debugger/doc/src/notes.xml
+++ b/lib/debugger/doc/src/notes.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2013</year>
+ <year>2004</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -33,6 +33,69 @@
<p>This document describes the changes made to the Debugger
application.</p>
+<section><title>Debugger 4.2.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Update build scripts to not make assumtions about where
+ env, cp and perl are located.</p>
+ <p>
+ Own Id: OTP-13800</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Debugger 4.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>When the debugger searches for source files, it will
+ also use the location of the source in the compilation
+ information part of the BEAM file.</p>
+ <p>
+ Own Id: OTP-13375</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Debugger 4.1.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Documentation corrections.</p>
+ <p>
+ Own Id: OTP-12994</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Debugger 4.1.1</title>
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix crash when starting a quick debugging session. Thanks
+ Alan Duffield.</p>
+ <p>
+ Own Id: OTP-12911 Aux Id: seq12906 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+
<section><title>Debugger 4.1</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/debugger/doc/src/part.xml b/lib/debugger/doc/src/part.xml
index 7515c0ad5b..ce1edbd978 100644
--- a/lib/debugger/doc/src/part.xml
+++ b/lib/debugger/doc/src/part.xml
@@ -4,7 +4,7 @@
<part xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -27,14 +27,10 @@
<docno></docno>
<date>1998-05-12</date>
<rev>B</rev>
- <file>part.sgml</file>
+ <file>part.xml</file>
</header>
- <description>
- <p><em>Debugger</em> is a graphical tool which can be used for
- debugging and testing of Erlang programs. For example, breakpoints
- can be set, code can be single stepped and variable values can be
- displayed and changed.</p>
- </description>
+ <description></description>
+ <xi:include href="introduction.xml"/>
<xi:include href="debugger_chapter.xml"/>
</part>
diff --git a/lib/debugger/doc/src/ref_man.xml b/lib/debugger/doc/src/ref_man.xml
index 6df9e90c2c..0f224cdb4b 100644
--- a/lib/debugger/doc/src/ref_man.xml
+++ b/lib/debugger/doc/src/ref_man.xml
@@ -4,7 +4,7 @@
<application xmlns:xi="http://www.w3.org/2001/XInclude">
<header>
<copyright>
- <year>1997</year><year>2013</year>
+ <year>1997</year><year>2016</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -28,12 +28,7 @@
<date></date>
<rev></rev>
</header>
- <description>
- <p><em>Debugger</em> is a graphical tool which can be used for
- debugging and testing of Erlang programs. For example, breakpoints
- can be set, code can be single stepped and variable values can be
- displayed and changed.</p>
- </description>
+ <description></description>
<xi:include href="debugger.xml"/>
<xi:include href="i.xml"/>
<xi:include href="int.xml"/>
diff --git a/lib/debugger/priv/Makefile b/lib/debugger/priv/Makefile
index 77c114fa35..726d7eb2f3 100644
--- a/lib/debugger/priv/Makefile
+++ b/lib/debugger/priv/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile
index f115f49d98..9594a0bfe3 100644
--- a/lib/debugger/src/Makefile
+++ b/lib/debugger/src/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2013. All Rights Reserved.
+# Copyright Ericsson AB 1997-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_debugged.erl b/lib/debugger/src/dbg_debugged.erl
index 99bed6f01b..e142af4ae0 100644
--- a/lib/debugger/src/dbg_debugged.erl
+++ b/lib/debugger/src/dbg_debugged.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -70,7 +70,10 @@ msg_loop(Meta, Mref, SaveStacktrace) ->
%% Meta is evaluating a receive, must be done within context
%% of real (=this) process
{sys, Meta, {'receive',Msg}} ->
- receive Msg -> Meta ! {self(), rec_acked} end,
+ receive Msg ->
+ Meta ! {self(), rec_acked},
+ ok
+ end,
msg_loop(Meta, Mref, SaveStacktrace);
%% Meta needs something evaluated within context of real process
diff --git a/lib/debugger/src/dbg_icmd.erl b/lib/debugger/src/dbg_icmd.erl
index 4c34f253c6..57a3719a50 100644
--- a/lib/debugger/src/dbg_icmd.erl
+++ b/lib/debugger/src/dbg_icmd.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -171,10 +171,10 @@ handle_cmd(Bs, Status, Ieval) ->
%% User control of process execution and settings
%%====================================================================
-step(Meta) -> Meta ! {user, {cmd, step}}.
-next(Meta) -> Meta ! {user, {cmd, next}}.
-continue(Meta) -> Meta ! {user, {cmd, continue}}.
-finish(Meta) -> Meta ! {user, {cmd, finish}}.
+step(Meta) -> Meta ! {user, {cmd, step}}, ok.
+next(Meta) -> Meta ! {user, {cmd, next}}, ok.
+continue(Meta) -> Meta ! {user, {cmd, continue}}, ok.
+finish(Meta) -> Meta ! {user, {cmd, finish}}, ok.
skip(Meta) -> Meta ! {user, {cmd, skip}}.
timeout(Meta) -> Meta ! {user, timeout}.
@@ -267,7 +267,7 @@ handle_int_msg({old_code,Mod}, Status, Bs,
#ieval{level=Le,module=M}=Ieval) ->
if
Status =:= idle, Le =:= 1 ->
- erase([Mod|db]),
+ erase(?DB_REF_KEY(Mod)),
put(cache, []);
true ->
case dbg_istk:in_use_p(Mod, M) of
@@ -277,7 +277,7 @@ handle_int_msg({old_code,Mod}, Status, Bs,
exit(get(self), kill),
dbg_ieval:exception(exit, old_code, Bs, Ieval);
false ->
- erase([Mod|db]),
+ erase(?DB_REF_KEY(Mod)),
put(cache, [])
end
end;
diff --git a/lib/debugger/src/dbg_idb.erl b/lib/debugger/src/dbg_idb.erl
index 9ce3ec3ef2..55177bbe76 100644
--- a/lib/debugger/src/dbg_idb.erl
+++ b/lib/debugger/src/dbg_idb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index 7ed371a653..f5e079ef7e 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -560,7 +560,7 @@ get_function(Mod, Name, Args, extern) ->
end.
db_ref(Mod) ->
- case get([Mod|db]) of
+ case get(?DB_REF_KEY(Mod)) of
undefined ->
case dbg_iserver:call(get(int),
{get_module_db, Mod, get(self)}) of
@@ -572,7 +572,7 @@ db_ref(Mod) ->
Node =/= node() -> {Node,ModDb};
true -> ModDb
end,
- put([Mod|db], DbRef),
+ put(?DB_REF_KEY(Mod), DbRef),
DbRef
end;
DbRef ->
diff --git a/lib/debugger/src/dbg_ieval.hrl b/lib/debugger/src/dbg_ieval.hrl
index 95d0842b19..ad422a9e4a 100644
--- a/lib/debugger/src/dbg_ieval.hrl
+++ b/lib/debugger/src/dbg_ieval.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,3 +27,5 @@
%% (i.e. the next call will leave interpreted code).
top = false
}).
+
+-define(DB_REF_KEY(Mod), {Mod,db}).
diff --git a/lib/debugger/src/dbg_iload.erl b/lib/debugger/src/dbg_iload.erl
index 2a8bcd32d8..369b456524 100644
--- a/lib/debugger/src/dbg_iload.erl
+++ b/lib/debugger/src/dbg_iload.erl
@@ -39,7 +39,7 @@
%% dbg_iserver. We are suspended until the module has been loaded.
%%--------------------------------------------------------------------
-spec load_mod(Mod, file:filename(), binary(), ets:tid()) ->
- {'ok', Mod} when is_subtype(Mod, atom()).
+ {'ok', Mod} when Mod :: atom().
load_mod(Mod, File, Binary, Db) ->
Flag = process_flag(trap_exit, true),
@@ -541,7 +541,7 @@ fun_clauses([]) -> [].
new_map(Fs0, Anno, F) ->
Line = ln(Anno),
Fs1 = map_fields(Fs0, F),
- Fs2 = [{ln(A),K,V} || {map_field_assoc,A,K,V} <- Fs1],
+ Fs2 = [{L,K,V} || {map_field_assoc,L,K,V} <- Fs1],
try
{value,Line,map_literal(Fs2, #{})}
catch
diff --git a/lib/debugger/src/dbg_iserver.erl b/lib/debugger/src/dbg_iserver.erl
index 28e8012f71..3e959e8e30 100644
--- a/lib/debugger/src/dbg_iserver.erl
+++ b/lib/debugger/src/dbg_iserver.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -72,17 +72,17 @@ cast(Int, Request) ->
gen_server:cast(Int, Request).
safe_call(Request) ->
- ensure_started(),
+ {ok, _} = ensure_started(),
call(Request).
safe_cast(Request) ->
- ensure_started(),
+ {ok, _} = ensure_started(),
cast(Request).
ensure_started() ->
case whereis(?MODULE) of
undefined -> start();
- _Pid -> ignore
+ Pid -> {ok, Pid}
end.
%%--Module database---------------------------------------------------
@@ -214,7 +214,6 @@ handle_call({new_process, Pid, Meta, Function}, _From, State) ->
%% Code loading
handle_call({load, Mod, Src, Bin}, _From, State) ->
-
%% Create an ETS table for storing information about the module
Db = State#state.db,
ModDb = ets:new(Mod, [ordered_set, public]),
@@ -285,23 +284,28 @@ handle_call({contents, Mod, Pid}, _From, State) ->
{reply, {ok, Bin}, State};
handle_call({raw_contents, Mod, Pid}, _From, State) ->
Db = State#state.db,
- [{{Mod, refs}, ModDbs}] = ets:lookup(Db, {Mod, refs}),
- ModDb = if
- Pid =:= any -> hd(ModDbs);
- true ->
- lists:foldl(fun(T, not_found) ->
- [{T, Pids}] = ets:lookup(Db, T),
- case lists:member(Pid, Pids) of
- true -> T;
- false -> not_found
- end;
- (_T, T) -> T
- end,
- not_found,
- ModDbs)
- end,
- [{mod_raw, Bin}] = ets:lookup(ModDb, mod_raw),
- {reply, {ok, Bin}, State};
+ case ets:lookup(Db, {Mod, refs}) of
+ [{{Mod, refs}, ModDbs}] ->
+ ModDb =
+ if
+ Pid =:= any -> hd(ModDbs);
+ true ->
+ lists:foldl(fun(T, not_found) ->
+ [{T, Pids}] = ets:lookup(Db, T),
+ case lists:member(Pid, Pids) of
+ true -> T;
+ false -> not_found
+ end;
+ (_T, T) -> T
+ end,
+ not_found,
+ ModDbs)
+ end,
+ [{mod_raw, Bin}] = ets:lookup(ModDb, mod_raw),
+ {reply, {ok, Bin}, State};
+ [] -> % code not interpreted
+ {reply, not_found, State}
+ end;
handle_call({is_interpreted, Mod, Name, Arity}, _From, State) ->
Db = State#state.db,
Reply = case ets:lookup(Db, {Mod, refs}) of
@@ -402,8 +406,10 @@ handle_cast({set_status, Meta, Status, Info}, State) ->
send_all(subscriber, {new_status, Proc#proc.pid, Status, Info}, State),
if
Status =:= break ->
- auto_attach(break, State#state.auto, Proc);
- true -> ignore
+ _ = auto_attach(break, State#state.auto, Proc),
+ ok;
+ true ->
+ ok
end,
Proc2 = Proc#proc{status=Status, info=Info},
{noreply, State#state{procs=lists:keyreplace(Meta, #proc.meta,
@@ -470,7 +476,7 @@ handle_info({'EXIT',Who,Why}, State) ->
[self(),AttPid,Pid,Why,ExitInfo]);
undefined ->
%% Otherwise, auto attach if necessary
- auto_attach(exit, State#state.auto, Pid),
+ _ = auto_attach(exit, State#state.auto, Pid),
Who
end,
send_all(subscriber, {new_status,Pid,exit,Why}, State),
@@ -583,7 +589,8 @@ send_all(Pids, Msg) ->
lists:foreach(fun(Pid) -> send(Pid, Msg) end, Pids).
send(Pid, Msg) ->
- Pid ! {int, Msg}.
+ Pid ! {int, Msg},
+ ok.
get_proc({Type, Pid}, Procs) ->
Index = case Type of
diff --git a/lib/debugger/src/dbg_istk.erl b/lib/debugger/src/dbg_istk.erl
index d6c512bdf8..886ea142af 100644
--- a/lib/debugger/src/dbg_istk.erl
+++ b/lib/debugger/src/dbg_istk.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2011-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2011-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_break.erl b/lib/debugger/src/dbg_wx_break.erl
index b577cfdaec..764322d7c4 100644
--- a/lib/debugger/src/dbg_wx_break.erl
+++ b/lib/debugger/src/dbg_wx_break.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_break_win.erl b/lib/debugger/src/dbg_wx_break_win.erl
index c9464f1e07..770681510d 100644
--- a/lib/debugger/src/dbg_wx_break_win.erl
+++ b/lib/debugger/src/dbg_wx_break_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -65,18 +65,18 @@ create_win(Parent, Pos, function, Mod, _Line) ->
{choices, IntStrs}]),
Expand = [{border, 5}, {flag,?wxLEFT bor ?wxRIGHT bor ?wxEXPAND}],
- wxSizer:add(MainS, Label, [{border,5},
+ _ = wxSizer:add(MainS, Label, [{border,5},
{flag,?wxTOP bor ?wxLEFT bor ?wxRIGHT}]),
- wxSizer:add(MainS, Text, Expand),
+ _ = wxSizer:add(MainS, Text, Expand),
FunLabel = wxStaticText:new(Win, ?wxID_ANY, "Function:"),
LB = wxListBox:new(Win, ?wxID_ANY, [{size,{-1, 100}},{style,?wxLB_MULTIPLE}]),
- wxSizer:add(MainS, FunLabel, Expand),
- wxSizer:add(MainS, LB, [{proportion,1}|Expand]),
+ _ = wxSizer:add(MainS, FunLabel, Expand),
+ _ = wxSizer:add(MainS, LB, [{proportion,1}|Expand]),
wxSizer:setMinSize(MainS, 300, 400),
OK = wxDialog:createStdDialogButtonSizer(Win, ?wxOK bor ?wxCANCEL),
- wxSizer:add(MainS, OK, [{border,5},{flag,?wxALL}]),
+ _ = wxSizer:add(MainS, OK, [{border,5},{flag,?wxALL}]),
wxDialog:setSizer(Win,MainS),
- wxSizer:fit(MainS, Win),
+ _ = wxSizer:fit(MainS, Win),
wxSizer:setSizeHints(MainS,Win),
wxComboBox:setFocus(Text),
wxDialog:connect(Win, command_button_clicked),
@@ -110,11 +110,11 @@ create_win(Parent, Pos, Type, Mod, Line) ->
IntStrs = [atom_to_list(M) || M <- Int],
ModT = wxComboBox:new(Win, ?wxID_ANY, [{choices,IntStrs}]),
ModSz = create_label_of_control(Win, "Module:", ModT, Mod),
- wxSizer:add(MainS,ModSz,[{flag, ?wxEXPAND}]),
+ _ = wxSizer:add(MainS,ModSz,[{flag, ?wxEXPAND}]),
%% Create rest of text input fields
Add = fun({IType, Label, Def}) ->
{Sz, Text} = create_sizer_with_text(Win, Label, Def),
- wxSizer:add(MainS, Sz, [{flag, ?wxEXPAND}]),
+ _ = wxSizer:add(MainS, Sz, [{flag, ?wxEXPAND}]),
{Text, IType}
end,
Inputs = case Type of
@@ -129,15 +129,15 @@ create_win(Parent, Pos, Type, Mod, Line) ->
Entries = wx:map(Add, Inputs),
%% Create and add radio box
{TriggerBox,Trigger} = create_trigger_box(Win),
- wxSizer:add(MainS, TriggerBox, [{border,5},{flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(MainS, TriggerBox, [{border,5},{flag,?wxALL bor ?wxEXPAND}]),
- wxSizer:addStretchSpacer(MainS),
+ _ = wxSizer:addStretchSpacer(MainS),
%% Put it together
OK = wxDialog:createStdDialogButtonSizer(Win, ?wxOK bor ?wxCANCEL),
- wxSizer:add(MainS, OK, [{border,5},{flag,?wxALL}]),
+ _ = wxSizer:add(MainS, OK, [{border,5},{flag,?wxALL}]),
wxSizer:setMinSize(MainS, 300, -1),
wxDialog:setSizer(Win,MainS),
- wxSizer:fit(MainS, Win),
+ _ = wxSizer:fit(MainS, Win),
wxSizer:setSizeHints(MainS,Win),
wxComboBox:setFocus(ModT),
wxDialog:connect(Win, command_button_clicked),
@@ -243,8 +243,8 @@ create_label_of_control(Parent, Label, Control, Def) ->
Text = wxStaticText:new(Parent, ?wxID_ANY, Label),
Border = {border, 5},
Flag = ?wxRIGHT bor ?wxLEFT bor ?wxALIGN_CENTRE_VERTICAL,
- wxSizer:add(Sizer, Text, [{proportion,1}, {flag,Flag}, Border]),
- wxSizer:add(Sizer, Control, [{proportion,3}, {flag,Flag bor ?wxEXPAND}, Border]),
+ _ = wxSizer:add(Sizer, Text, [{proportion,1}, {flag,Flag}, Border]),
+ _ = wxSizer:add(Sizer, Control, [{proportion,3}, {flag,Flag bor ?wxEXPAND}, Border]),
wxControl:setLabel(Control, dbg_wx_win:to_string(Def)),
Sizer.
@@ -252,11 +252,11 @@ create_trigger_box(Win) ->
SBox = wxStaticBox:new(Win, ?wxID_ANY, "Trigger Action:"),
SBS = wxStaticBoxSizer:new(SBox, ?wxVERTICAL),
Ebtn = wxRadioButton:new(Win, ?wxID_ANY, "Enable"),
- wxSizer:add(SBS,Ebtn),
+ _ = wxSizer:add(SBS,Ebtn),
Dibtn = wxRadioButton:new(Win, ?wxID_ANY, "Disable"),
- wxSizer:add(SBS,Dibtn),
+ _ = wxSizer:add(SBS,Dibtn),
Debtn = wxRadioButton:new(Win, ?wxID_ANY, "Delete"),
- wxSizer:add(SBS,Debtn),
+ _ = wxSizer:add(SBS,Debtn),
wxRadioButton:setValue(Ebtn, true),
{SBS, [{Ebtn,enable},{Dibtn,disable},{Debtn,delete}]}.
diff --git a/lib/debugger/src/dbg_wx_code.erl b/lib/debugger/src/dbg_wx_code.erl
index a0e6c94d60..473963500a 100644
--- a/lib/debugger/src/dbg_wx_code.erl
+++ b/lib/debugger/src/dbg_wx_code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -127,20 +127,22 @@ load_code(Ed, Code) ->
%%io:format("~p ~p ~p~n", [Lines, Sz, LW]),
?stc:setMarginWidth(Ed, 0, LW+5),
?stc:setReadOnly(Ed, true),
- Ed.
+ ok.
unload_code(Ed) ->
?stc:setReadOnly(Ed, false),
?stc:setTextRaw(Ed, <<0:8>>),
?stc:setReadOnly(Ed, true),
- Ed.
+ ok.
add_break_to_code(Ed, Line, active) ->
?stc:markerDelete(Ed, Line-1, 1),
- ?stc:markerAdd(Ed, Line-1, 0);
+ ?stc:markerAdd(Ed, Line-1, 0),
+ ok;
add_break_to_code(Ed, Line, inactive) ->
?stc:markerDelete(Ed, Line-1, 0),
- ?stc:markerAdd(Ed, Line-1, 1).
+ ?stc:markerAdd(Ed, Line-1, 1),
+ ok.
del_break_from_code(Ed,Line) ->
?stc:markerDelete(Ed, Line-1, 0),
diff --git a/lib/debugger/src/dbg_wx_filedialog_win.erl b/lib/debugger/src/dbg_wx_filedialog_win.erl
index 910eda7fad..f7b031dc28 100644
--- a/lib/debugger/src/dbg_wx_filedialog_win.erl
+++ b/lib/debugger/src/dbg_wx_filedialog_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -118,9 +118,9 @@ init([Parent, Id, Options0]) ->
wxTextCtrl:connect(Dir, char, [{callback, IsTab}]),
Top = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(Top, Back, [{border, 2},{flag,?wxALL bor ?wxEXPAND}]),
- wxSizer:add(Top, Forw, [{border, 2},{flag,?wxALL bor ?wxEXPAND}]),
- wxSizer:add(Top, Up, [{border, 2},{flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(Top, Back, [{border, 2},{flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(Top, Forw, [{border, 2},{flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(Top, Up, [{border, 2},{flag,?wxALL bor ?wxEXPAND}]),
%% List Ctrl
{Art, IconMap} = create_icons(ExtraIcons),
@@ -154,13 +154,13 @@ init([Parent, Id, Options0]) ->
%% OK done
Box = wxBoxSizer:new(?wxVERTICAL),
- wxSizer:add(Box, Top, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}]),
- wxSizer:add(Box, Dir, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}]),
- wxSizer:add(Box, LC, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}, {proportion, 1}]),
- wxSizer:add(Box, Bott, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(Box, Top, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(Box, Dir, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(Box, LC, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}, {proportion, 1}]),
+ _ = wxSizer:add(Box, Bott, [{border, 2}, {flag,?wxALL bor ?wxEXPAND}]),
wxWindow:setSizer(Dlg, Box),
- wxSizer:fit(Box, Dlg),
+ _ = wxSizer:fit(Box, Dlg),
wxSizer:setSizeHints(Box,Dlg),
State = #state{win=Dlg,
back=Back, forward=Forw, up=Up,
diff --git a/lib/debugger/src/dbg_wx_filedialog_win.hrl b/lib/debugger/src/dbg_wx_filedialog_win.hrl
index 96a6fb2ae9..3eb21ffb29 100644
--- a/lib/debugger/src/dbg_wx_filedialog_win.hrl
+++ b/lib/debugger/src/dbg_wx_filedialog_win.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2009. All Rights Reserved.
+%% Copyright Ericsson AB 2009-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_interpret.erl b/lib/debugger/src/dbg_wx_interpret.erl
index f93a9089d7..4dcb5b65ac 100644
--- a/lib/debugger/src/dbg_wx_interpret.erl
+++ b/lib/debugger/src/dbg_wx_interpret.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_mon.erl b/lib/debugger/src/dbg_wx_mon.erl
index cd09dd1273..a32a6894b8 100644
--- a/lib/debugger/src/dbg_wx_mon.erl
+++ b/lib/debugger/src/dbg_wx_mon.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -135,7 +135,7 @@ init2(CallingPid, Mode, SFile, GS) ->
%% Start other necessary stuff
dbg_wx_win:init(),
- dbg_wx_winman:start(), % Debugger window manager
+ _ = dbg_wx_winman:start(), % Debugger window manager
%% Create monitor window
Title = "Monitor",
@@ -339,7 +339,7 @@ gui_cmd('Delete All Modules', State) ->
lists:foreach(fun(Mod) -> int:nn(Mod) end, int:interpreted()),
State;
gui_cmd({module, Mod, What}, State) ->
- case What of
+ _ = case What of
delete -> int:nn(Mod);
view ->
Window = dbg_wx_mon_win:get_window(State#state.win),
diff --git a/lib/debugger/src/dbg_wx_mon_win.erl b/lib/debugger/src/dbg_wx_mon_win.erl
index 5377ef83af..9737c9e67f 100644
--- a/lib/debugger/src/dbg_wx_mon_win.erl
+++ b/lib/debugger/src/dbg_wx_mon_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -107,31 +107,31 @@ create_win_batch(Title, Menus) ->
Hlb = 200,
Listbox = wxListBox:new(Panel, ?wxID_ANY, [{size,{?Wf,Hlb}},
{style,?wxLB_SINGLE}]),
- wxSizer:add(LeftSz,Listbox,[{proportion,1},{border,3},{flag,?wxEXPAND}]),
+ _ = wxSizer:add(LeftSz,Listbox,[{proportion,1},{border,3},{flag,?wxEXPAND}]),
wxListBox:connect(Listbox, command_listbox_doubleclicked),
wxListBox:connect(Listbox, right_down),
SBox = wxStaticBox:new(Panel, ?wxID_ANY, "Auto Attach:"),
SBS = wxStaticBoxSizer:new(SBox, ?wxVERTICAL),
Fbtn = wxCheckBox:new(Panel, ?autoId, "First Call"),
- wxSizer:add(SBS,Fbtn),
+ _ = wxSizer:add(SBS,Fbtn),
Bbtn = wxCheckBox:new(Panel, ?autoId, "On Break"),
- wxSizer:add(SBS,Bbtn),
+ _ = wxSizer:add(SBS,Bbtn),
Ebtn = wxCheckBox:new(Panel, ?autoId, "On Exit"),
- wxSizer:add(SBS,Ebtn),
+ _ = wxSizer:add(SBS,Ebtn),
wxFrame:connect(Panel, command_checkbox_clicked),
- wxSizer:add(LeftSz,SBS, [{flag,?wxEXPAND}]),
+ _ = wxSizer:add(LeftSz,SBS, [{flag,?wxEXPAND}]),
SLabel = wxStaticText:new(Panel, ?wxID_ANY, "Stack Trace:\n On (with tail)"),
- wxSizer:add(LeftSz,SLabel),
+ _ = wxSizer:add(LeftSz,SLabel),
BLabel = wxStaticText:new(Panel, ?wxID_ANY, "Back Trace Size:\n 50000"),
- wxSizer:add(LeftSz,BLabel),
+ _ = wxSizer:add(LeftSz,BLabel),
StringsBox = wxStaticBox:new(Panel, ?wxID_ANY, "Strings:"),
StringsBS = wxStaticBoxSizer:new(StringsBox, ?wxVERTICAL),
Stringsbtn = wxCheckBox:new(Panel, ?stringsId, ?STRTEXT),
- wxSizer:add(StringsBS,Stringsbtn),
- wxSizer:add(LeftSz,StringsBS, [{flag,?wxEXPAND}]),
+ _ = wxSizer:add(StringsBS,Stringsbtn),
+ _ = wxSizer:add(LeftSz,StringsBS, [{flag,?wxEXPAND}]),
%% Create list_crtl / grid
Grid = wxListCtrl:new(Panel, [{winid, ?GRID},
@@ -169,12 +169,12 @@ create_win_batch(Title, Menus) ->
wxWindow:setFocus(Grid),
%% Put it in the window
- wxSizer:add(MainSz, LeftSz, [{border, 3}, {flag,?wxALL bor ?wxEXPAND}]),
- wxSizer:add(MainSz, Grid, [{border, 3}, {flag,?wxALL bor ?wxEXPAND},
+ _ = wxSizer:add(MainSz, LeftSz, [{border, 3}, {flag,?wxALL bor ?wxEXPAND}]),
+ _ = wxSizer:add(MainSz, Grid, [{border, 3}, {flag,?wxALL bor ?wxEXPAND},
{proportion, 1}]),
wxWindow:setSizer(Panel,MainSz),
- wxSizer:fit(MainSz, Win),
+ _ = wxSizer:fit(MainSz, Win),
wxSizer:setSizeHints(MainSz,Win),
IconFile = dbg_wx_win:find_icon("erlang_bug.png"),
diff --git a/lib/debugger/src/dbg_wx_settings.erl b/lib/debugger/src/dbg_wx_settings.erl
index e45d74f67e..3a355f18a9 100644
--- a/lib/debugger/src/dbg_wx_settings.erl
+++ b/lib/debugger/src/dbg_wx_settings.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/dbg_wx_src_view.erl b/lib/debugger/src/dbg_wx_src_view.erl
index 43c36a4d8e..207c407fbc 100644
--- a/lib/debugger/src/dbg_wx_src_view.erl
+++ b/lib/debugger/src/dbg_wx_src_view.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ code_area(Parent, Sizer) ->
end,
[SetStyle(Style) || Style <- Styles],
?stc:setKeyWords(Ed, 0, keyWords()),
- wxSizer:add(Sizer, Ed, [{proportion,1}, {flag, ?wxEXPAND}]),
+ _ = wxSizer:add(Sizer, Ed, [{proportion,1}, {flag, ?wxEXPAND}]),
Ed.
diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl
index b246c71284..29c8e8cefb 100644
--- a/lib/debugger/src/dbg_wx_trace.erl
+++ b/lib/debugger/src/dbg_wx_trace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -73,6 +73,10 @@ start(Pid, TraceWin, BackTrace) ->
start(Pid, TraceWin, BackTrace, Strings) ->
case whereis(dbg_wx_mon) of
+ undefined ->
+ Parent = wx:new(),
+ Env = wx:get_env(),
+ start(Pid, Env, Parent, TraceWin, BackTrace, Strings);
Monitor when is_pid(Monitor) ->
Monitor ! {?MODULE, self(), get_env},
receive
@@ -317,7 +321,7 @@ gui_cmd('Kill', State) ->
exit(State#state.pid, kill),
State;
gui_cmd('Messages', State) ->
- case int:meta(State#state.meta, messages) of
+ _ = case int:meta(State#state.meta, messages) of
[] ->
dbg_wx_trace_win:eval_output(State#state.win,"< No Messages!\n", bold);
Messages ->
@@ -807,18 +811,21 @@ gui_show_module(Win, Mod, Line, Mod, _Pid, How) ->
dbg_wx_trace_win:mark_line(Win, Line, How);
gui_show_module(Win, Mod, Line, _Cm, Pid, How) ->
Win2 = case dbg_wx_trace_win:is_shown(Win, Mod) of
- {true, Win3} -> Win3;
+ %% {true, Win3} -> Win3;
false -> gui_load_module(Win, Mod, Pid)
end,
dbg_wx_trace_win:mark_line(Win2, Line, How).
gui_load_module(Win, Mod, _Pid) ->
dbg_wx_trace_win:display(Win,{text, "Loading module..."}),
- %% Contents = int:contents(Mod, Pid),
- {ok, Contents} = dbg_iserver:call({raw_contents, Mod, any}),
- Win2 = dbg_wx_trace_win:show_code(Win, Mod, Contents),
- dbg_wx_trace_win:display(Win,{text, ""}),
- Win2.
+ case dbg_iserver:call({raw_contents, Mod, any}) of
+ {ok, Contents} ->
+ Win2 = dbg_wx_trace_win:show_code(Win, Mod, Contents),
+ dbg_wx_trace_win:display(Win,{text, ""}),
+ Win2;
+ not_found ->
+ dbg_wx_trace_win:show_no_code(Win)
+ end.
gui_update_bindings(Win,Meta) ->
Bs = int:meta(Meta, bindings, nostack),
diff --git a/lib/debugger/src/dbg_wx_trace_win.erl b/lib/debugger/src/dbg_wx_trace_win.erl
index 232d61b1db..972a917728 100644
--- a/lib/debugger/src/dbg_wx_trace_win.erl
+++ b/lib/debugger/src/dbg_wx_trace_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -123,7 +123,8 @@
%% GS = term()
%%--------------------------------------------------------------------
init() ->
- dbg_wx_win:init().
+ _ = dbg_wx_win:init(),
+ ok.
stop(#winInfo{window=Win}) ->
(catch wxFrame:destroy(Win)),
@@ -149,29 +150,29 @@ create_win(Parent, Title, Windows, Menus) ->
Sizer = wxBoxSizer:new(?wxVERTICAL),
Code = code_area(Panel),
- wxSizer:add(Sizer, Code#sub.win,
+ _ = wxSizer:add(Sizer, Code#sub.win,
[{proportion,1}, {border, 2},
{flag, ?wxEXPAND bor ?wxDOWN}]),
wxSizer:setVirtualSizeHints(Sizer, Code#sub.win),
ExpandWithBorder = [{border, 3},{flag,?wxEXPAND bor ?wxALL}],
Search = search_area(Panel),
- wxSizer:add(Sizer, Search#sub.win, ExpandWithBorder),
+ _ = wxSizer:add(Sizer, Search#sub.win, ExpandWithBorder),
Bs = button_area(Panel),
- wxSizer:add(Sizer, Bs#sub.win, ExpandWithBorder),
+ _ = wxSizer:add(Sizer, Bs#sub.win, ExpandWithBorder),
InfoArea = wxBoxSizer:new(?wxHORIZONTAL),
wxSizer:setMinSize(InfoArea, {100, ?EVAL_H}),
Eval = eval_area(Panel),
- wxSizer:add(InfoArea, Eval#sub.win, [{proportion,1},{flag,?wxEXPAND}]),
+ _ = wxSizer:add(InfoArea, Eval#sub.win, [{proportion,1},{flag,?wxEXPAND}]),
Bind = bind_area(Panel),
- wxSizer:add(InfoArea, Bind#sub.win,
+ _ = wxSizer:add(InfoArea, Bind#sub.win,
[{proportion,1},{border, 2},
{flag,?wxEXPAND bor ?wxLEFT}]),
- wxSizer:add(Sizer, InfoArea, ExpandWithBorder),
+ _ = wxSizer:add(Sizer, InfoArea, ExpandWithBorder),
Trace = trace_area(Panel),
- wxSizer:add(Sizer, Trace#sub.win, ExpandWithBorder),
+ _ = wxSizer:add(Sizer, Trace#sub.win, ExpandWithBorder),
SB = wxFrame:createStatusBar(Win,[]),
%% Note id and lastId to get the event when it dragged is complete
@@ -192,7 +193,7 @@ create_win(Parent, Title, Windows, Menus) ->
Wi = show_windows(enable_windows(Wi0,Windows)),
wxWindow:setSizer(Panel, Sizer),
- wxSizer:fit(Sizer, Win),
+ _ = wxSizer:fit(Sizer, Win),
wxSizer:setSizeHints(Sizer,Win),
IconFile = dbg_wx_win:find_icon("erlang_bug.png"),
@@ -230,11 +231,11 @@ get_window(WinInfo) ->
%%--------------------------------------------------------------------
configure(Wi=#winInfo{window=Win,m_szr={Panel,Sizer}}) ->
wx:batch(fun() ->
- show_windows(Wi),
+ _ = show_windows(Wi),
wxSizer:layout(Sizer),
%%wxWindow:setSizerAndFit(Panel,Sizer),
wxWindow:setSizer(Panel, Sizer),
- wxSizer:fit(Sizer, Win),
+ _ = wxSizer:fit(Sizer, Win),
wxSizer:setSizeHints(Sizer,Win),
Wi
end).
@@ -242,10 +243,10 @@ configure(Wi=#winInfo{window=Win,m_szr={Panel,Sizer}}) ->
configure(Wi0=#winInfo{window=Win,m_szr={Panel,Sizer}}, Windows) ->
wx:batch(fun() ->
Wi = enable_windows(Wi0, Windows),
- show_windows(Wi),
+ _ = show_windows(Wi),
wxSizer:layout(Sizer),
wxWindow:setSizer(Panel, Sizer),
- wxSizer:fit(Sizer, Win),
+ _ = wxSizer:fit(Sizer, Win),
wxSizer:setSizeHints(Sizer,Win),
Wi
end).
@@ -348,7 +349,7 @@ add_break(WinInfo, Menu, {{Mod,Line},[Status|_Options]}=Break) ->
case WinInfo#winInfo.editor of
{Mod, Editor} ->
dbg_wx_code:add_break_to_code(Editor, Line, Status);
- _ -> ignore
+ _ -> ok
end,
add_break_to_menu(WinInfo, Menu, Break).
@@ -372,7 +373,7 @@ update_break(WinInfo, {{Mod,Line},[Status|_Options]}=Break) ->
case WinInfo#winInfo.editor of
{Mod, Editor} ->
dbg_wx_code:add_break_to_code(Editor, Line, Status);
- _ -> ignore
+ _ -> ok
end,
update_break_in_menu(WinInfo, Break).
@@ -929,7 +930,7 @@ button_area(Parent) ->
B=wxButton:new(Parent, Button,
[{label,dbg_wx_win:to_string(Name)}]),
Id = wxWindow:getId(B),
- wxSizer:add(Sz,B, []),
+ _ = wxSizer:add(Sz,B, []),
wxButton:connect(B, command_button_clicked, [{id,Id}])
end, buttons()),
#sub{name='Button Area', win=Sz}.
@@ -938,22 +939,22 @@ button_area(Parent) ->
search_area(Parent) ->
HSz = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(HSz, wxStaticText:new(Parent, ?wxID_ANY, "Find:"),
+ _ = wxSizer:add(HSz, wxStaticText:new(Parent, ?wxID_ANY, "Find:"),
[{flag,?wxALIGN_CENTER_VERTICAL}]),
TC1 = wxTextCtrl:new(Parent, ?SEARCH_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
- wxSizer:add(HSz, TC1, [{proportion,3}, {flag, ?wxEXPAND}]),
+ _ = wxSizer:add(HSz, TC1, [{proportion,3}, {flag, ?wxEXPAND}]),
Nbtn = wxRadioButton:new(Parent, ?wxID_ANY, "Next"),
wxRadioButton:setValue(Nbtn, true),
- wxSizer:add(HSz,Nbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
+ _ = wxSizer:add(HSz,Nbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
Pbtn = wxRadioButton:new(Parent, ?wxID_ANY, "Previous"),
- wxSizer:add(HSz,Pbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
+ _ = wxSizer:add(HSz,Pbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
Cbtn = wxCheckBox:new(Parent, ?wxID_ANY, "Match Case"),
- wxSizer:add(HSz,Cbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
- wxSizer:add(HSz, 15,15, [{proportion,1}, {flag, ?wxEXPAND}]),
- wxSizer:add(HSz, wxStaticText:new(Parent, ?wxID_ANY, "Goto Line:"),
+ _ = wxSizer:add(HSz,Cbtn,[{flag,?wxALIGN_CENTER_VERTICAL}]),
+ _ = wxSizer:add(HSz, 15,15, [{proportion,1}, {flag, ?wxEXPAND}]),
+ _ = wxSizer:add(HSz, wxStaticText:new(Parent, ?wxID_ANY, "Goto Line:"),
[{flag,?wxALIGN_CENTER_VERTICAL}]),
TC2 = wxTextCtrl:new(Parent, ?GOTO_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
- wxSizer:add(HSz, TC2, [{proportion,0}, {flag, ?wxEXPAND}]),
+ _ = wxSizer:add(HSz, TC2, [{proportion,0}, {flag, ?wxEXPAND}]),
wxTextCtrl:connect(TC1, command_text_updated),
wxTextCtrl:connect(TC1, command_text_enter),
wxTextCtrl:connect(TC1, kill_focus),
@@ -969,14 +970,14 @@ eval_area(Parent) ->
VSz = wxBoxSizer:new(?wxVERTICAL),
HSz = wxBoxSizer:new(?wxHORIZONTAL),
- wxSizer:add(HSz, wxStaticText:new(Parent, ?wxID_ANY, "Evaluator:"),
+ _ = wxSizer:add(HSz, wxStaticText:new(Parent, ?wxID_ANY, "Evaluator:"),
[{flag,?wxALIGN_CENTER_VERTICAL}]),
TC = wxTextCtrl:new(Parent, ?EVAL_ENTRY, [{style, ?wxTE_PROCESS_ENTER}]),
- wxSizer:add(HSz, TC, [{proportion,1}, {flag, ?wxEXPAND}]),
- wxSizer:add(VSz, HSz, [{flag, ?wxEXPAND}]),
+ _ = wxSizer:add(HSz, TC, [{proportion,1}, {flag, ?wxEXPAND}]),
+ _ = wxSizer:add(VSz, HSz, [{flag, ?wxEXPAND}]),
TL = wxTextCtrl:new(Parent, ?EVAL_LOG, [{style, ?wxTE_DONTWRAP bor
?wxTE_MULTILINE bor ?wxTE_READONLY}]),
- wxSizer:add(VSz, TL, [{proportion,5}, {flag, ?wxEXPAND}]),
+ _ = wxSizer:add(VSz, TL, [{proportion,5}, {flag, ?wxEXPAND}]),
wxTextCtrl:connect(TC, command_text_enter),
#sub{name='Evaluator Area', win=VSz, in=TC, out=TL}.
diff --git a/lib/debugger/src/dbg_wx_view.erl b/lib/debugger/src/dbg_wx_view.erl
index 9715a9c17b..86d009238f 100644
--- a/lib/debugger/src/dbg_wx_view.erl
+++ b/lib/debugger/src/dbg_wx_view.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -263,7 +263,11 @@ shortcut(_) -> false.
gui_load_module(Win, Mod) ->
dbg_wx_trace_win:display(Win,{text, "Loading module..."}),
- {ok, Contents} = dbg_iserver:call({raw_contents, Mod, any}),
- Win2 = dbg_wx_trace_win:show_code(Win, Mod, Contents),
- dbg_wx_trace_win:display(Win,{text, ""}),
- Win2.
+ case dbg_iserver:call({raw_contents, Mod, any}) of
+ {ok, Contents} ->
+ Win2 = dbg_wx_trace_win:show_code(Win, Mod, Contents),
+ dbg_wx_trace_win:display(Win,{text, ""}),
+ Win2;
+ not_found ->
+ dbg_wx_trace_win:show_no_code(Win)
+ end.
diff --git a/lib/debugger/src/dbg_wx_win.erl b/lib/debugger/src/dbg_wx_win.erl
index 63f74392b5..25ffc5054c 100644
--- a/lib/debugger/src/dbg_wx_win.erl
+++ b/lib/debugger/src/dbg_wx_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -43,7 +43,8 @@
%% GS = term()
%%--------------------------------------------------------------------
init() ->
- wx:new().
+ _ = wx:new(),
+ ok.
%%--------------------------------------------------------------------
%% create_menus(MenuBar, [Menu])
@@ -80,12 +81,12 @@ create_menus(_MB,[], _Win,Id) ->
Id.
create_menu_item(Menu, [separator|Is], Win, Id,Connect) ->
- wxMenu:appendSeparator(Menu),
+ _ = wxMenu:appendSeparator(Menu),
create_menu_item(Menu,Is,Win,Id+1,Connect);
create_menu_item(Menu, [{Name, _N, cascade, Items}|Is], Win, Id0,Connect) ->
Sub = wxMenu:new([]),
Id = create_menu_item(Sub, Items, Win, Id0, false),
- wxMenu:append(Menu, ?wxID_ANY, menu_name(Name,ignore), Sub),
+ _ = wxMenu:append(Menu, ?wxID_ANY, menu_name(Name,ignore), Sub),
%% Simulate GS sub checkBox/RadioBox behaviour
Self = self(),
Butts = [{MI,get(MI)} || {MI,_,_} <- Items],
@@ -95,13 +96,12 @@ create_menu_item(Menu, [{Name, _N, cascade, Items}|Is], Win, Id0,Connect) ->
false -> Acc
end
end,
- Filter = fun(_,_) ->
+ Filter = fun(Ev,_) ->
Enabled = lists:foldl(IsChecked, [], Butts),
- Self ! #wx{userData={Name, Enabled},
- event=#wxCommand{type=command_menu_selected}}
+ Self ! Ev#wx{userData={Name, Enabled}}
end,
- wxMenu:connect(Win, command_menu_selected,
- [{id,Id0},{lastId, Id-1},{callback,Filter}]),
+ _ = wxMenu:connect(Win, command_menu_selected,
+ [{id,Id0},{lastId, Id-1},{callback,Filter}]),
create_menu_item(Menu, Is, Win, Id, Connect);
create_menu_item(Menu, [{Name,Pos}|Is], Win, Id, Connect) ->
MenuId = case lists:member(Name, ['Debugger']) of
@@ -169,7 +169,7 @@ add_break(Win, MenuName, Point) ->
Delete = wxMenu:appendRadioItem(Trigger, ?wxID_ANY,"Delete"),
Add(Delete, {break,Point,{trigger,delete}}),
- wxMenu:append(Sub, ?wxID_ANY, "Trigger Action", Trigger),
+ _ = wxMenu:append(Sub, ?wxID_ANY, "Trigger Action", Trigger),
MenuBtn = wxMenu:append(Menu,?wxID_ANY, Label, Sub),
#break{mb={Menu,MenuBtn},
diff --git a/lib/debugger/src/dbg_wx_winman.erl b/lib/debugger/src/dbg_wx_winman.erl
index 0045948d2f..ca858fa4bb 100644
--- a/lib/debugger/src/dbg_wx_winman.erl
+++ b/lib/debugger/src/dbg_wx_winman.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -100,11 +100,11 @@ update_windows_menu(Win, [MonInfo|Infos]) ->
OldItems = wxMenu:getMenuItems(Menu),
[wxMenu:delete(Menu, Item) || Item <- OldItems],
menuitem(Win, Menu,MonInfo, 700),
- wxMenu:appendSeparator(Menu),
+ _ = wxMenu:appendSeparator(Menu),
wx:foldl(fun(Info,Acc) -> menuitem(Win,Menu,Info,Acc) end, 701, Infos).
menuitem(Window, Menu, {Title, Win}, Id) ->
- wxMenu:append(Menu, Id, Title),
+ _ = wxMenu:append(Menu, Id, Title),
wxWindow:connect(Window, command_menu_selected,
[{id,Id},{userData,{dbg_ui_winman,Win}}]),
Id+1.
diff --git a/lib/debugger/src/debugger.appup.src b/lib/debugger/src/debugger.appup.src
index 2fa3f5de5f..afad2a6a09 100644
--- a/lib/debugger/src/debugger.appup.src
+++ b/lib/debugger/src/debugger.appup.src
@@ -1,7 +1,7 @@
%% -*- erlang -*-
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/debugger.erl b/lib/debugger/src/debugger.erl
index c188663668..f92c8e4a23 100644
--- a/lib/debugger/src/debugger.erl
+++ b/lib/debugger/src/debugger.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/src/i.erl b/lib/debugger/src/i.erl
index f8f6a3b245..2da3e77618 100644
--- a/lib/debugger/src/i.erl
+++ b/lib/debugger/src/i.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -108,7 +108,7 @@ ib(Module,Function,Arity) ->
ib(Module,Function,Arity,Cond) ->
Breaks1 = int:all_breaks(Module),
- int:break_in(Module,Function,Arity),
+ ok = int:break_in(Module,Function,Arity),
Breaks2 = int:all_breaks(Module),
lists:foreach(fun({Mod,Line}) -> int:test_at_break(Mod,Line,Cond) end,
Breaks2--Breaks1).
diff --git a/lib/debugger/src/int.erl b/lib/debugger/src/int.erl
index 4f54beb45b..e5bade9abe 100644
--- a/lib/debugger/src/int.erl
+++ b/lib/debugger/src/int.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -352,10 +352,10 @@ start() -> dbg_iserver:start().
stop() ->
lists:foreach(
fun(Mod) ->
- everywhere(distributed,
- fun() ->
+ _ = everywhere(distributed,
+ fun() ->
erts_debug:breakpoint({Mod,'_','_'}, false)
- end)
+ end)
end,
interpreted()),
dbg_iserver:stop().
@@ -524,21 +524,21 @@ check(Mod) when is_atom(Mod) -> catch check_module(Mod);
check(File) when is_list(File) -> catch check_file(File).
load({Mod, Src, Beam, BeamBin, Exp, Abst}, Dist) ->
- everywhere(Dist,
- fun() ->
+ _ = everywhere(Dist,
+ fun() ->
code:purge(Mod),
erts_debug:breakpoint({Mod,'_','_'}, false),
{module,Mod} = code:load_binary(Mod, Beam, BeamBin)
- end),
+ end),
case erl_prim_loader:get_file(filename:absname(Src)) of
{ok, SrcBin, _} ->
MD5 = code:module_md5(BeamBin),
Bin = term_to_binary({interpreter_module,Exp,Abst,SrcBin,MD5}),
{module, Mod} = dbg_iserver:safe_call({load, Mod, Src, Bin}),
- everywhere(Dist,
- fun() ->
+ _ = everywhere(Dist,
+ fun() ->
true = erts_debug:breakpoint({Mod,'_','_'}, true) > 0
- end),
+ end),
{module, Mod};
error ->
error
@@ -547,7 +547,7 @@ load({Mod, Src, Beam, BeamBin, Exp, Abst}, Dist) ->
check_module(Mod) ->
case code:which(Mod) of
Beam when is_list(Beam) ->
- case find_src(Beam) of
+ case find_src(Mod, Beam) of
Src when is_list(Src) ->
check_application(Src),
case check_beam(Beam) of
@@ -608,7 +608,7 @@ check_application2("gs-"++_) -> throw({error,{app,gs}});
check_application2("debugger-"++_) -> throw({error,{app,debugger}});
check_application2(_) -> ok.
-find_src(Beam) ->
+find_src(Mod, Beam) ->
Src0 = filename:rootname(Beam) ++ ".erl",
case is_file(Src0) of
true -> Src0;
@@ -618,10 +618,22 @@ find_src(Beam) ->
filename:basename(Src0)]),
case is_file(Src) of
true -> Src;
- false -> error
+ false -> find_src_from_module(Mod)
end
end.
+find_src_from_module(Mod) ->
+ Compile = Mod:module_info(compile),
+ case lists:keyfind(source, 1, Compile) of
+ {source, Src} ->
+ case is_file(Src) of
+ true -> Src;
+ false -> error
+ end;
+ false ->
+ error
+ end.
+
find_beam(Mod, Src) ->
SrcDir = filename:dirname(Src),
BeamFile = atom_to_list(Mod) ++ code:objfile_extension(),
@@ -726,9 +738,9 @@ del_mod(AbsMod, Dist) ->
list_to_atom(filename:basename(AbsMod,".erl"))
end,
dbg_iserver:safe_cast({delete, Mod}),
- everywhere(Dist,
- fun() ->
+ _ = everywhere(Dist,
+ fun() ->
erts_debug:breakpoint({Mod,'_','_'}, false),
erlang:yield()
- end),
+ end),
ok.
diff --git a/lib/debugger/test/Makefile b/lib/debugger/test/Makefile
index 82f49c155f..125abcacda 100644
--- a/lib/debugger/test/Makefile
+++ b/lib/debugger/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1998-2012. All Rights Reserved.
+# Copyright Ericsson AB 1998-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ RELSYSDIR = $(RELEASE_PATH)/debugger_test
# ----------------------------------------------------
ERL_MAKE_FLAGS +=
-ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/test_server/include
+ERL_COMPILE_FLAGS +=
EBIN = .
diff --git a/lib/debugger/test/andor_SUITE.erl b/lib/debugger/test/andor_SUITE.erl
index 384b6c7c77..d7bbd4fccb 100644
--- a/lib/debugger/test/andor_SUITE.erl
+++ b/lib/debugger/test/andor_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,9 +27,11 @@
t_andalso/1,t_orelse/1,inside/1,overlap/1,
combined/1,in_case/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -46,17 +48,14 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- ?line Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -71,23 +70,23 @@ t_andalso(Config) when is_list(Config) ->
Ps = [{X,Y} || X <- Bs, Y <- Bs],
lists:foreach(fun (P) -> t_andalso_1(P) end, Ps),
- ?line true = true andalso true,
- ?line false = true andalso false,
- ?line false = false andalso true,
- ?line false = false andalso false,
+ true = true andalso true,
+ false = true andalso false,
+ false = false andalso true,
+ false = false andalso false,
- ?line false = false andalso glurf,
- ?line false = false andalso exit(exit_now),
+ false = false andalso glurf,
+ false = false andalso exit(exit_now),
- ?line true = not id(false) andalso not id(false),
- ?line false = not id(false) andalso not id(true),
- ?line false = not id(true) andalso not id(false),
- ?line false = not id(true) andalso not id(true),
+ true = not id(false) andalso not id(false),
+ false = not id(false) andalso not id(true),
+ false = not id(true) andalso not id(false),
+ false = not id(true) andalso not id(true),
- ?line {'EXIT',{badarg,_}} = (catch not id(glurf) andalso id(true)),
- ?line {'EXIT',{badarg,_}} = (catch not id(false) andalso not id(glurf)),
- ?line false = id(false) andalso not id(glurf),
- ?line false = false andalso not id(glurf),
+ {'EXIT',{badarg,_}} = (catch not id(glurf) andalso id(true)),
+ {'EXIT',{badarg,_}} = (catch not id(false) andalso not id(glurf)),
+ false = id(false) andalso not id(glurf),
+ false = false andalso not id(glurf),
ok.
@@ -96,23 +95,23 @@ t_orelse(Config) when is_list(Config) ->
Ps = [{X,Y} || X <- Bs, Y <- Bs],
lists:foreach(fun (P) -> t_orelse_1(P) end, Ps),
- ?line true = true orelse true,
- ?line true = true orelse false,
- ?line true = false orelse true,
- ?line false = false orelse false,
+ true = true orelse true,
+ true = true orelse false,
+ true = false orelse true,
+ false = false orelse false,
- ?line true = true orelse glurf,
- ?line true = true orelse exit(exit_now),
+ true = true orelse glurf,
+ true = true orelse exit(exit_now),
- ?line true = not id(false) orelse not id(false),
- ?line true = not id(false) orelse not id(true),
- ?line true = not id(true) orelse not id(false),
- ?line false = not id(true) orelse not id(true),
+ true = not id(false) orelse not id(false),
+ true = not id(false) orelse not id(true),
+ true = not id(true) orelse not id(false),
+ false = not id(true) orelse not id(true),
- ?line {'EXIT',{badarg,_}} = (catch not id(glurf) orelse id(true)),
- ?line {'EXIT',{badarg,_}} = (catch not id(true) orelse not id(glurf)),
- ?line true = id(true) orelse not id(glurf),
- ?line true = true orelse not id(glurf),
+ {'EXIT',{badarg,_}} = (catch not id(glurf) orelse id(true)),
+ {'EXIT',{badarg,_}} = (catch not id(true) orelse not id(glurf)),
+ true = id(true) orelse not id(glurf),
+ true = true orelse not id(glurf),
ok.
@@ -135,16 +134,16 @@ t_orelse_1({X,Y}) ->
check(V1, X or Y).
inside(Config) when is_list(Config) ->
- ?line true = inside(-8, 1),
- ?line false = inside(-53.5, -879798),
- ?line false = inside(1.0, -879),
- ?line false = inside(59, -879),
- ?line false = inside(-11, 1.0),
- ?line false = inside(100, 0.2),
- ?line false = inside(100, 1.2),
- ?line false = inside(-53.5, 4),
- ?line false = inside(1.0, 5.3),
- ?line false = inside(59, 879),
+ true = inside(-8, 1),
+ false = inside(-53.5, -879798),
+ false = inside(1.0, -879),
+ false = inside(59, -879),
+ false = inside(-11, 1.0),
+ false = inside(100, 0.2),
+ false = inside(100, 1.2),
+ false = inside(-53.5, 4),
+ false = inside(1.0, 5.3),
+ false = inside(59, 879),
ok.
inside(Xm, Ym) ->
@@ -179,15 +178,15 @@ inside_guard(Xm, Ym, X, Y, W, H) ->
{false,Xm,Ym,X,Y,W,H}.
overlap(Config) when is_list(Config) ->
- ?line true = overlap(7.0, 2.0, 8.0, 0.5),
- ?line true = overlap(7.0, 2.0, 8.0, 2.5),
- ?line true = overlap(7.0, 2.0, 5.3, 2),
- ?line true = overlap(7.0, 2.0, 0.0, 100.0),
-
- ?line false = overlap(-1, 2, -35, 0.5),
- ?line false = overlap(-1, 2, 777, 0.5),
- ?line false = overlap(-1, 2, 2, 10),
- ?line false = overlap(2, 10, 12, 55.3),
+ true = overlap(7.0, 2.0, 8.0, 0.5),
+ true = overlap(7.0, 2.0, 8.0, 2.5),
+ true = overlap(7.0, 2.0, 5.3, 2),
+ true = overlap(7.0, 2.0, 0.0, 100.0),
+
+ false = overlap(-1, 2, -35, 0.5),
+ false = overlap(-1, 2, 777, 0.5),
+ false = overlap(-1, 2, 2, 10),
+ false = overlap(2, 10, 12, 55.3),
ok.
overlap(Pos1, Len1, Pos2, Len2) ->
@@ -211,33 +210,33 @@ overlap(Pos1, Len1, Pos2, Len2) ->
-define(COMB(A,B,C), (A andalso B orelse C)).
combined(Config) when is_list(Config) ->
- ?line false = comb(false, false, false),
- ?line true = comb(false, false, true),
- ?line false = comb(false, true, false),
- ?line true = comb(false, true, true),
-
- ?line false = comb(true, false, false),
- ?line true = comb(true, true, false),
- ?line true = comb(true, false, true),
- ?line true = comb(true, true, true),
-
- ?line false = comb(false, blurf, false),
- ?line true = comb(false, blurf, true),
- ?line true = comb(true, true, blurf),
-
- ?line false = ?COMB(false, false, false),
- ?line true = ?COMB(false, false, true),
- ?line false = ?COMB(false, true, false),
- ?line true = ?COMB(false, true, true),
-
- ?line false = ?COMB(true, false, false),
- ?line true = ?COMB(true, true, false),
- ?line true = ?COMB(true, false, true),
- ?line true = ?COMB(true, true, true),
-
- ?line false = ?COMB(false, blurf, false),
- ?line true = ?COMB(false, blurf, true),
- ?line true = ?COMB(true, true, blurf),
+ false = comb(false, false, false),
+ true = comb(false, false, true),
+ false = comb(false, true, false),
+ true = comb(false, true, true),
+
+ false = comb(true, false, false),
+ true = comb(true, true, false),
+ true = comb(true, false, true),
+ true = comb(true, true, true),
+
+ false = comb(false, blurf, false),
+ true = comb(false, blurf, true),
+ true = comb(true, true, blurf),
+
+ false = ?COMB(false, false, false),
+ true = ?COMB(false, false, true),
+ false = ?COMB(false, true, false),
+ true = ?COMB(false, true, true),
+
+ false = ?COMB(true, false, false),
+ true = ?COMB(true, true, false),
+ true = ?COMB(true, false, true),
+ true = ?COMB(true, true, true),
+
+ false = ?COMB(false, blurf, false),
+ true = ?COMB(false, blurf, true),
+ true = ?COMB(true, true, blurf),
ok.
-undef(COMB).
@@ -268,13 +267,13 @@ comb(A, B, C) ->
%% Test that a boolean expression in a case expression is properly
%% optimized (in particular, that the error behaviour is correct).
in_case(Config) when is_list(Config) ->
- ?line edge_rings = in_case_1(1, 1, 1, 1, 1),
- ?line not_loop = in_case_1(0.5, 1, 1, 1, 1),
- ?line loop = in_case_1(0.5, 0.9, 1.1, 1, 4),
- ?line {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, 0)),
- ?line {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, nan)),
- ?line {'EXIT',{badarg,_}} = (catch in_case_1(1, 1, 1, blurf, 1)),
- ?line {'EXIT',{badarith,_}} = (catch in_case_1([nan], 1, 1, 1, 1)),
+ edge_rings = in_case_1(1, 1, 1, 1, 1),
+ not_loop = in_case_1(0.5, 1, 1, 1, 1),
+ loop = in_case_1(0.5, 0.9, 1.1, 1, 4),
+ {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, 0)),
+ {'EXIT',{badarith,_}} = (catch in_case_1(1, 1, 1, 1, nan)),
+ {'EXIT',{badarg,_}} = (catch in_case_1(1, 1, 1, blurf, 1)),
+ {'EXIT',{badarith,_}} = (catch in_case_1([nan], 1, 1, 1, 1)),
ok.
in_case_1(LenUp, LenDw, LenN, Rotation, Count) ->
@@ -302,14 +301,14 @@ in_case_1_guard(LenUp, LenDw, LenN, Rotation, Count) ->
(abs(Rotation) > 0.707) of
true -> edge_rings;
false when LenUp >= 1 orelse LenDw >= 1 orelse
- LenN =< 1 orelse Count < 4 -> not_loop;
+ LenN =< 1 orelse Count < 4 -> not_loop;
false -> loop
end.
check(V1, V0) ->
if V1 /= V0 ->
io:fwrite("error: ~w.\n", [V1]),
- ?t:fail();
+ ct:fail(failed);
true ->
io:fwrite("ok: ~w.\n", [V1])
end.
diff --git a/lib/debugger/test/bs_bincomp_SUITE.erl b/lib/debugger/test/bs_bincomp_SUITE.erl
index 0750c6793d..39e2240f2d 100644
--- a/lib/debugger/test/bs_bincomp_SUITE.erl
+++ b/lib/debugger/test/bs_bincomp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,19 +30,18 @@
byte_aligned/1,bit_aligned/1,extended_byte_aligned/1,
extended_bit_aligned/1,mixed/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[byte_aligned, bit_aligned, extended_byte_aligned,
@@ -66,62 +65,62 @@ end_per_group(_GroupName, Config) ->
byte_aligned(Config) when is_list(Config) ->
- ?line <<"abcdefg">> = << <<(X+32)>> || <<X>> <= <<"ABCDEFG">> >>,
- ?line <<1:32/little,2:32/little,3:32/little,4:32/little>> =
+ <<"abcdefg">> = << <<(X+32)>> || <<X>> <= <<"ABCDEFG">> >>,
+ <<1:32/little,2:32/little,3:32/little,4:32/little>> =
<< <<X:32/little>> || <<X:32>> <= <<1:32,2:32,3:32,4:32>> >>,
- ?line <<1:32/little,2:32/little,3:32/little,4:32/little>> =
+ <<1:32/little,2:32/little,3:32/little,4:32/little>> =
<< <<X:32/little>> || <<X:16>> <= <<1:16,2:16,3:16,4:16>> >>,
- ok.
+ ok.
bit_aligned(Config) when is_list(Config) ->
- ?line <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
+ <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
<< <<(X+32):7>> || <<X>> <= <<"ABCDEFG">> >>,
- ?line <<"ABCDEFG">> =
+ <<"ABCDEFG">> =
<< <<(X-32)>> || <<X:7>> <= <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> >>,
- ?line <<1:31/little,2:31/little,3:31/little,4:31/little>> =
+ <<1:31/little,2:31/little,3:31/little,4:31/little>> =
<< <<X:31/little>> || <<X:31>> <= <<1:31,2:31,3:31,4:31>> >>,
- ?line <<1:31/little,2:31/little,3:31/little,4:31/little>> =
+ <<1:31/little,2:31/little,3:31/little,4:31/little>> =
<< <<X:31/little>> || <<X:15>> <= <<1:15,2:15,3:15,4:15>> >>,
- ok.
+ ok.
extended_byte_aligned(Config) when is_list(Config) ->
- ?line <<"abcdefg">> = << <<(X+32)>> || X <- "ABCDEFG" >>,
- ?line "abcdefg" = [(X+32) || <<X>> <= <<"ABCDEFG">>],
- ?line <<1:32/little,2:32/little,3:32/little,4:32/little>> =
+ <<"abcdefg">> = << <<(X+32)>> || X <- "ABCDEFG" >>,
+ "abcdefg" = [(X+32) || <<X>> <= <<"ABCDEFG">>],
+ <<1:32/little,2:32/little,3:32/little,4:32/little>> =
<< <<X:32/little>> || X <- [1,2,3,4] >>,
- ?line [256,512,768,1024] =
+ [256,512,768,1024] =
[X || <<X:16/little>> <= <<1:16,2:16,3:16,4:16>>],
- ok.
+ ok.
extended_bit_aligned(Config) when is_list(Config) ->
- ?line <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
+ <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>> =
<< <<(X+32):7>> || X <- "ABCDEFG" >>,
- ?line "ABCDEFG" = [(X-32) || <<X:7>> <= <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>>],
- ?line <<1:31/little,2:31/little,3:31/little,4:31/little>> =
+ "ABCDEFG" = [(X-32) || <<X:7>> <= <<$a:7,$b:7,$c:7,$d:7,$e:7,$f:7,$g:7>>],
+ <<1:31/little,2:31/little,3:31/little,4:31/little>> =
<< <<X:31/little>> || X <- [1,2,3,4] >>,
- ?line [256,512,768,1024] =
+ [256,512,768,1024] =
[X || <<X:15/little>> <= <<1:15,2:15,3:15,4:15>>],
ok.
mixed(Config) when is_list(Config) ->
- ?line <<2,3,3,4,4,5,5,6>> =
+ <<2,3,3,4,4,5,5,6>> =
<< <<(X+Y)>> || <<X>> <= <<1,2,3,4>>, <<Y>> <= <<1,2>> >>,
- ?line <<2,3,3,4,4,5,5,6>> =
+ <<2,3,3,4,4,5,5,6>> =
<< <<(X+Y)>> || <<X>> <= <<1,2,3,4>>, Y <- [1,2] >>,
- ?line <<2,3,3,4,4,5,5,6>> =
+ <<2,3,3,4,4,5,5,6>> =
<< <<(X+Y)>> || X <- [1,2,3,4], Y <- [1,2] >>,
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X>> <= <<1,2,3,4>>, <<Y>> <= <<1,2>>],
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X>> <= <<1,2,3,4>>, Y <- [1,2]],
- ?line <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
+ <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
<< <<(X+Y):3>> || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, <<Y:3>> <= <<1:3,2:3>> >>,
- ?line <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
+ <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
<< <<(X+Y):3>> || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, Y <- [1,2] >>,
- ?line <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
+ <<2:3,3:3,3:3,4:3,4:3,5:3,5:3,6:3>> =
<< <<(X+Y):3>> || X <- [1,2,3,4], Y <- [1,2] >>,
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, <<Y:3>> <= <<1:3,2:3>>],
- ?line [2,3,3,4,4,5,5,6] =
+ [2,3,3,4,4,5,5,6] =
[(X+Y) || <<X:3>> <= <<1:3,2:3,3:3,4:3>>, Y <- [1,2]],
ok.
diff --git a/lib/debugger/test/bs_construct_SUITE.erl b/lib/debugger/test/bs_construct_SUITE.erl
index f62512568f..6c6435c61a 100644
--- a/lib/debugger/test/bs_construct_SUITE.erl
+++ b/lib/debugger/test/bs_construct_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,9 +36,11 @@
copy_writable_binary/1, dynamic/1,
otp_7422/1, zero_width/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,15}}].
all() ->
[test1, test2, test3, test4, test5, testf, not_used,
@@ -57,17 +59,14 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(15)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -84,9 +83,9 @@ r(L) ->
-define(T(B, L), {B, ??B, L}).
-define(N(B), {B, ??B, unknown}).
--define(FAIL(Expr), ?line fail_check(catch Expr, ??Expr, [])).
+-define(FAIL(Expr), fail_check(catch Expr, ??Expr, [])).
--define(FAIL_VARS(Expr, Vars), ?line fail_check(catch Expr, ??Expr, Vars)).
+-define(FAIL_VARS(Expr, Vars), fail_check(catch Expr, ??Expr, Vars)).
l(I_13, I_big1) ->
[
@@ -162,7 +161,7 @@ l(I_13, I_big1) ->
?T(<<<<344:17>>/binary-unit:17>>, <<344:17>>),
?T(<<<<42,3,7656:16>>/binary-unit:16>>, <<42,3,7656:16>>)
- ].
+ ].
native_3798() ->
case <<1:16/native>> of
@@ -205,7 +204,7 @@ one_test({C_bin, E_bin, Str, Bytes}) when is_list(Bytes) ->
true ->
io:format("ERROR: Compiled: ~p. Expected ~p. Got ~p.~n",
[Str, Bytes, binary_to_list(C_bin)]),
- test_server:fail(comp)
+ ct:fail(comp)
end,
if
E_bin == Bin ->
@@ -213,7 +212,7 @@ one_test({C_bin, E_bin, Str, Bytes}) when is_list(Bytes) ->
true ->
io:format("ERROR: Interpreted: ~p. Expected ~p. Got ~p.~n",
[Str, Bytes, binary_to_list(E_bin)]),
- test_server:fail(comp)
+ ct:fail(comp)
end;
one_test({C_bin, E_bin, Str, Result}) ->
io:format(" ~s ~p~n", [Str, C_bin]),
@@ -234,7 +233,7 @@ one_test({C_bin, E_bin, Str, Result}) ->
io:format("ERROR: Compiled not equal to interpreted:"
"~n ~p, ~p.~n",
[binary_to_list(C_bin), binary_to_list(E_bin)]),
- test_server:fail(comp);
+ ct:fail(comp);
0 ->
ok;
%% For situations where the final bits may not matter, like
@@ -269,23 +268,22 @@ fail_check({'EXIT',{badarg,_}}, Str, Vars) ->
try evaluate(Str, Vars) of
Res ->
io:format("Interpreted result: ~p", [Res]),
- ?t:fail(did_not_fail_in_intepreted_code)
+ ct:fail(did_not_fail_in_intepreted_code)
catch
error:badarg ->
ok
end;
fail_check(Res, _, _) ->
io:format("Compiled result: ~p", [Res]),
- ?t:fail(did_not_fail_in_compiled_code).
+ ct:fail(did_not_fail_in_compiled_code).
%%% Simple working cases
-test1(suite) -> [];
test1(Config) when is_list(Config) ->
- ?line I_13 = i(13),
- ?line I_big1 = big(1),
- ?line Vars = [{'I_13', I_13},
- {'I_big1', I_big1}],
- ?line lists:foreach(fun one_test/1, eval_list(l(I_13, I_big1), Vars)).
+ I_13 = i(13),
+ I_big1 = big(1),
+ Vars = [{'I_13', I_13},
+ {'I_big1', I_big1}],
+ lists:foreach(fun one_test/1, eval_list(l(I_13, I_big1), Vars)).
%%% Misc
@@ -301,10 +299,9 @@ gen(N, S, A) ->
gen_l(N, S, A) ->
[?T(<<A:S/little, A:(N-S)/little>>, comp(N, A, S))].
-test2(suite) -> [];
test2(Config) when is_list(Config) ->
- ?line test2(0, 8, 2#10101010101010101),
- ?line test2(0, 8, 2#1111111111).
+ test2(0, 8, 2#10101010101010101),
+ test2(0, 8, 2#1111111111).
test2(End, End, _) ->
ok;
@@ -329,10 +326,9 @@ t3() ->
?N(<<>>)
].
-test3(suite) -> [];
test3(Config) when is_list(Config) ->
- ?line Vars = [],
- ?line lists:foreach(fun one_test/1, eval_list(t3(), Vars)).
+ Vars = [],
+ lists:foreach(fun one_test/1, eval_list(t3(), Vars)).
gen_u(N, S, A) ->
[?N(<<A:S, A:(N-S)>>)].
@@ -340,10 +336,9 @@ gen_u(N, S, A) ->
gen_u_l(N, S, A) ->
[?N(<<A:S/little, A:(N-S)/little>>)].
-test4(suite) -> [];
test4(Config) when is_list(Config) ->
- ?line test4(0, 16, 2#10101010101010101),
- ?line test4(0, 16, 2#1111111111).
+ test4(0, 16, 2#10101010101010101),
+ test4(0, 16, 2#1111111111).
test4(End, End, _) ->
ok;
@@ -361,11 +356,10 @@ gen_b(N, S, A) ->
[?T(<<A:S/binary-unit:1, A:(N-S)/binary-unit:1>>,
binary_to_list(<<A:S/binary-unit:1, A:(N-S)/binary-unit:1>>))].
-test5(suite) -> [];
-test5(doc) -> ["OTP-3995"];
+%% OTP-3995.
test5(Config) when is_list(Config) ->
- ?line test5(0, 8, <<73>>),
- ?line test5(0, 8, <<68>>).
+ test5(0, 8, <<73>>),
+ test5(0, 8, <<68>>).
test5(End, End, _) ->
ok;
@@ -379,47 +373,46 @@ test5(S, A) ->
lists:foreach(fun one_test/1, eval_list(gen_b(N, S, A), Vars)).
%%% Failure cases
-testf(suite) -> [];
testf(Config) when is_list(Config) ->
- ?line ?FAIL(<<3.14>>),
- ?line ?FAIL(<<<<1,2>>>>),
+ ?FAIL(<<3.14>>),
+ ?FAIL(<<<<1,2>>>>),
- ?line ?FAIL(<<2.71/binary>>),
- ?line ?FAIL(<<24334/binary>>),
- ?line ?FAIL(<<24334344294788947129487129487219847/binary>>),
+ ?FAIL(<<2.71/binary>>),
+ ?FAIL(<<24334/binary>>),
+ ?FAIL(<<24334344294788947129487129487219847/binary>>),
BigInt = id(24334344294788947129487129487219847),
- ?line ?FAIL_VARS(<<BigInt/binary>>, [{'BigInt',BigInt}]),
- ?line ?FAIL_VARS(<<42,BigInt/binary>>, [{'BigInt',BigInt}]),
- ?line ?FAIL_VARS(<<BigInt:2/binary>>, [{'BigInt',BigInt}]),
+ ?FAIL_VARS(<<BigInt/binary>>, [{'BigInt',BigInt}]),
+ ?FAIL_VARS(<<42,BigInt/binary>>, [{'BigInt',BigInt}]),
+ ?FAIL_VARS(<<BigInt:2/binary>>, [{'BigInt',BigInt}]),
%% One negative field size, but the sum of field sizes will be 1 byte.
%% Make sure that we reject that properly.
I_minus_777 = id(-777),
I_minus_2047 = id(-2047),
- ?line ?FAIL_VARS(<<I_minus_777:2048/unit:8,57:I_minus_2047/unit:8>>,
- ordsets:from_list([{'I_minus_777',I_minus_777},
- {'I_minus_2047',I_minus_2047}])),
- ?line ?FAIL(<<<<1,2,3>>/float>>),
+ ?FAIL_VARS(<<I_minus_777:2048/unit:8,57:I_minus_2047/unit:8>>,
+ ordsets:from_list([{'I_minus_777',I_minus_777},
+ {'I_minus_2047',I_minus_2047}])),
+ ?FAIL(<<<<1,2,3>>/float>>),
%% Negative field widths.
- ?line testf_1(-8, <<1,2,3,4,5>>),
- ?line ?FAIL(<<0:(-(1 bsl 100))>>),
+ testf_1(-8, <<1,2,3,4,5>>),
+ ?FAIL(<<0:(-(1 bsl 100))>>),
- ?line ?FAIL(<<42:(-16)>>),
- ?line ?FAIL(<<3.14:(-8)/float>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(-16)/binary>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(2.5)/binary>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(anka)>>),
- ?line ?FAIL(<<<<23,56,0,2>>:(anka)>>),
+ ?FAIL(<<42:(-16)>>),
+ ?FAIL(<<3.14:(-8)/float>>),
+ ?FAIL(<<<<23,56,0,2>>:(-16)/binary>>),
+ ?FAIL(<<<<23,56,0,2>>:(2.5)/binary>>),
+ ?FAIL(<<<<23,56,0,2>>:(anka)>>),
+ ?FAIL(<<<<23,56,0,2>>:(anka)>>),
%% Unit failures.
- ?line ?FAIL(<<<<1:1>>/binary>>),
+ ?FAIL(<<<<1:1>>/binary>>),
Sz = id(1),
- ?line ?FAIL_VARS(<<<<1:Sz>>/binary>>, [{'Sz',Sz}]),
- ?line {'EXIT',{badarg,_}} = (catch <<<<1:(id(1))>>/binary>>),
- ?line ?FAIL(<<<<7,8,9>>/binary-unit:16>>),
- ?line ?FAIL(<<<<7,8,9,3:7>>/binary-unit:16>>),
- ?line ?FAIL(<<<<7,8,9,3:7>>/binary-unit:17>>),
+ ?FAIL_VARS(<<<<1:Sz>>/binary>>, [{'Sz',Sz}]),
+ {'EXIT',{badarg,_}} = (catch <<<<1:(id(1))>>/binary>>),
+ ?FAIL(<<<<7,8,9>>/binary-unit:16>>),
+ ?FAIL(<<<<7,8,9,3:7>>/binary-unit:16>>),
+ ?FAIL(<<<<7,8,9,3:7>>/binary-unit:17>>),
ok.
@@ -429,14 +422,13 @@ testf_1(W, B) ->
?FAIL_VARS(<<3.14:W/float>>, Vars),
?FAIL_VARS(<<B:W/binary>>, [{'B',B}|Vars]).
-not_used(doc) ->
- "Test that constructed binaries that are not used will still give an exception.";
+%% Test that constructed binaries that are not used will still give an exception.
not_used(Config) when is_list(Config) ->
- ?line ok = not_used1(3, <<"dum">>),
- ?line {'EXIT',{badarg,_}} = (catch not_used1(3, "dum")),
- ?line {'EXIT',{badarg,_}} = (catch not_used2(444, -2)),
- ?line {'EXIT',{badarg,_}} = (catch not_used2(444, anka)),
- ?line {'EXIT',{badarg,_}} = (catch not_used3(444)),
+ ok = not_used1(3, <<"dum">>),
+ {'EXIT',{badarg,_}} = (catch not_used1(3, "dum")),
+ {'EXIT',{badarg,_}} = (catch not_used2(444, -2)),
+ {'EXIT',{badarg,_}} = (catch not_used2(444, anka)),
+ {'EXIT',{badarg,_}} = (catch not_used3(444)),
ok.
not_used1(I, BinString) ->
@@ -452,11 +444,11 @@ not_used3(I) ->
ok.
in_guard(Config) when is_list(Config) ->
- ?line 1 = in_guard(<<16#74ad:16>>, 16#e95, 5),
- ?line 2 = in_guard(<<16#3A,16#F7,"hello">>, 16#3AF7, <<"hello">>),
- ?line 3 = in_guard(<<16#FBCD:14,3.1415/float,3:2>>, 16#FBCD, 3.1415),
- ?line 3 = in_guard(<<16#FBCD:14,3/float,3:2>>, 16#FBCD, 3),
- ?line 3 = in_guard(<<16#FBCD:14,(2 bsl 226)/float,3:2>>, 16#FBCD, 2 bsl 226),
+ 1 = in_guard(<<16#74ad:16>>, 16#e95, 5),
+ 2 = in_guard(<<16#3A,16#F7,"hello">>, 16#3AF7, <<"hello">>),
+ 3 = in_guard(<<16#FBCD:14,3.1415/float,3:2>>, 16#FBCD, 3.1415),
+ 3 = in_guard(<<16#FBCD:14,3/float,3:2>>, 16#FBCD, 3),
+ 3 = in_guard(<<16#FBCD:14,(2 bsl 226)/float,3:2>>, 16#FBCD, 2 bsl 226),
nope = in_guard(<<1>>, 42, b),
nope = in_guard(<<1>>, a, b),
nope = in_guard(<<1,2>>, 1, 1),
@@ -470,16 +462,16 @@ in_guard(Bin, A, B) when <<A:14,B/float,3:2>> == Bin -> 3;
in_guard(Bin, A, B) when {a,b,<<A:14,B/float,3:2>>} == Bin -> cant_happen;
in_guard(_, _, _) -> nope.
-mem_leak(doc) -> "Make sure that construction has no memory leak";
+%% Make sure that construction has no memory leak.
mem_leak(Config) when is_list(Config) ->
- ?line B = make_bin(16, <<0>>),
- ?line mem_leak(1024, B),
+ B = make_bin(16, <<0>>),
+ mem_leak(1024, B),
ok.
mem_leak(0, _) -> ok;
mem_leak(N, B) ->
- ?line big_bin(B, <<23>>),
- ?line {'EXIT',{badarg,_}} = (catch big_bin(B, bad)),
+ big_bin(B, <<23>>),
+ {'EXIT',{badarg,_}} = (catch big_bin(B, bad)),
mem_leak(N-1, B).
big_bin(B1, B2) ->
@@ -493,18 +485,18 @@ make_bin(0, Acc) -> Acc;
make_bin(N, Acc) -> make_bin(N-1, <<Acc/binary,Acc/binary>>).
-define(COF(Int0),
- ?line (fun(Int) ->
- true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
- true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
- end)(nonliteral(Int0)),
- ?line true = <<Int0:32/float>> =:= <<(float(Int0)):32/float>>,
- ?line true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
+ (fun(Int) ->
+ true = <<Int:32/float>> =:= <<(float(Int)):32/float>>,
+ true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
+ end)(nonliteral(Int0)),
+ true = <<Int0:32/float>> =:= <<(float(Int0)):32/float>>,
+ true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
-define(COF64(Int0),
- ?line (fun(Int) ->
- true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
- end)(nonliteral(Int0)),
- ?line true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
+ (fun(Int) ->
+ true = <<Int:64/float>> =:= <<(float(Int)):64/float>>
+ end)(nonliteral(Int0)),
+ true = <<Int0:64/float>> =:= <<(float(Int0)):64/float>>).
nonliteral(X) -> X.
@@ -523,7 +515,7 @@ coerce_to_float(Config) when is_list(Config) ->
ok.
bjorn(Config) when is_list(Config) ->
- ?line error = bjorn_1(),
+ error = bjorn_1(),
ok.
bjorn_1() ->
@@ -551,30 +543,30 @@ do_something() ->
throw(blurf).
huge_float_field(Config) when is_list(Config) ->
- ?line {'EXIT',{badarg,_}} = (catch <<0.0:9/float-unit:8>>),
- ?line huge_float_check(catch <<0.0:67108865/float-unit:64>>),
- ?line huge_float_check(catch <<0.0:((1 bsl 26)+1)/float-unit:64>>),
- ?line huge_float_check(catch <<0.0:(id(67108865))/float-unit:64>>),
-%% ?line huge_float_check(catch <<0.0:((1 bsl 60)+1)/float-unit:64>>),
- ?line huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 26)+1)/float-unit:64>>),
-%% ?line huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 60)+1)/float-unit:64>>),
+ {'EXIT',{badarg,_}} = (catch <<0.0:9/float-unit:8>>),
+ huge_float_check(catch <<0.0:67108865/float-unit:64>>),
+ huge_float_check(catch <<0.0:((1 bsl 26)+1)/float-unit:64>>),
+ huge_float_check(catch <<0.0:(id(67108865))/float-unit:64>>),
+ %% huge_float_check(catch <<0.0:((1 bsl 60)+1)/float-unit:64>>),
+ huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 26)+1)/float-unit:64>>),
+ %% huge_float_check(catch <<3839739387439387383739387987347983:((1 bsl 60)+1)/float-unit:64>>),
ok.
huge_float_check({'EXIT',{system_limit,_}}) -> ok;
huge_float_check({'EXIT',{badarg,_}}) -> ok.
huge_binary(Config) when is_list(Config) ->
- ?line 16777216 = size(<<0:(id(1 bsl 26)),(-1):(id(1 bsl 26))>>),
+ 16777216 = size(<<0:(id(1 bsl 26)),(-1):(id(1 bsl 26))>>),
ok.
system_limit(Config) when is_list(Config) ->
WordSize = erlang:system_info(wordsize),
BitsPerWord = WordSize * 8,
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{system_limit,_}} =
(catch <<0:(id(0)),42:(id(1 bsl BitsPerWord))>>),
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{system_limit,_}} =
(catch <<42:(id(1 bsl BitsPerWord)),0:(id(0))>>),
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{system_limit,_}} =
(catch <<(id(<<>>))/binary,0:(id(1 bsl 100))>>),
case WordSize of
@@ -585,13 +577,13 @@ system_limit(Config) when is_list(Config) ->
end.
system_limit_32() ->
- ?line {'EXIT',{badarg,_}} = (catch <<42:(-1)>>),
- ?line {'EXIT',{badarg,_}} = (catch <<42:(id(-1))>>),
- ?line {'EXIT',{badarg,_}} = (catch <<42:(id(-389739873536870912))/unit:8>>),
- ?line {'EXIT',{system_limit,_}} = (catch <<42:536870912/unit:8>>),
- ?line {'EXIT',{system_limit,_}} = (catch <<42:(id(536870912))/unit:8>>),
- ?line {'EXIT',{system_limit,_}} = (catch <<0:(id(8)),42:536870912/unit:8>>),
- ?line {'EXIT',{system_limit,_}} =
+ {'EXIT',{badarg,_}} = (catch <<42:(-1)>>),
+ {'EXIT',{badarg,_}} = (catch <<42:(id(-1))>>),
+ {'EXIT',{badarg,_}} = (catch <<42:(id(-389739873536870912))/unit:8>>),
+ {'EXIT',{system_limit,_}} = (catch <<42:536870912/unit:8>>),
+ {'EXIT',{system_limit,_}} = (catch <<42:(id(536870912))/unit:8>>),
+ {'EXIT',{system_limit,_}} = (catch <<0:(id(8)),42:536870912/unit:8>>),
+ {'EXIT',{system_limit,_}} =
(catch <<0:(id(8)),42:(id(536870912))/unit:8>>),
ok.
@@ -601,34 +593,34 @@ badarg(Config) when is_list(Config) ->
%% but the debugger will generate a system_limit exception.
%% It does not seems worthwhile to fix the debugger.
- ?line {'EXIT',{badarg,_}} =
+ {'EXIT',{badarg,_}} =
(catch <<(id(<<>>))/binary,0:(id(-(1 bsl 100)))>>),
ok.
copy_writable_binary(Config) when is_list(Config) ->
- ?line [copy_writable_binary_1(I) || I <- lists:seq(0, 256)],
+ [copy_writable_binary_1(I) || I <- lists:seq(0, 256)],
ok.
copy_writable_binary_1(_) ->
- ?line Bin0 = <<(id(<<>>))/binary,0,1,2,3,4,5,6,7>>,
- ?line SubBin = make_sub_bin(Bin0),
- ?line id(<<42,34,55,Bin0/binary>>), %Make reallocation likelier.
- ?line Pid = spawn(fun() ->
- copy_writable_binary_holder(Bin0, SubBin)
- end),
- ?line Tab = ets:new(holder, []),
- ?line ets:insert(Tab, {17,Bin0}),
- ?line ets:insert(Tab, {42,SubBin}),
- ?line id(<<Bin0/binary,0:(64*1024*8)>>),
- ?line Pid ! self(),
- ?line [{17,Bin0}] = ets:lookup(Tab, 17),
- ?line [{42,Bin0}] = ets:lookup(Tab, 42),
+ Bin0 = <<(id(<<>>))/binary,0,1,2,3,4,5,6,7>>,
+ SubBin = make_sub_bin(Bin0),
+ id(<<42,34,55,Bin0/binary>>), %Make reallocation likelier.
+ Pid = spawn(fun() ->
+ copy_writable_binary_holder(Bin0, SubBin)
+ end),
+ Tab = ets:new(holder, []),
+ ets:insert(Tab, {17,Bin0}),
+ ets:insert(Tab, {42,SubBin}),
+ id(<<Bin0/binary,0:(64*1024*8)>>),
+ Pid ! self(),
+ [{17,Bin0}] = ets:lookup(Tab, 17),
+ [{42,Bin0}] = ets:lookup(Tab, 42),
receive
{Pid,Bin0,Bin0} -> ok;
Other ->
io:format("Unexpected message: ~p", [Other]),
- ?line ?t:fail()
+ ct:fail(failed)
end,
ok.
@@ -656,7 +648,7 @@ dynamic(Config) when is_list(Config) ->
{'DOWN',Ref,process,Pid,normal} ->
ok;
{'DOWN',Ref,process,Pid,Exit} ->
- ?t:fail({Pid,Exit})
+ ct:fail({Pid,Exit})
end || {Pid,Ref} <- Ps],
ok.
@@ -743,17 +735,17 @@ otp_7422_bin(N) when N < 512 ->
otp_7422_bin(_) -> ok.
zero_width(Config) when is_list(Config) ->
- ?line Z = id(0),
+ Z = id(0),
Small = id(42),
Big = id(1 bsl 128),
- ?line <<>> = <<Small:Z>>,
- ?line <<>> = <<Small:0>>,
- ?line <<>> = <<Big:Z>>,
- ?line <<>> = <<Big:0>>,
-
- ?line {'EXIT',{badarg,_}} = (catch <<not_a_number:0>>),
- ?line {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):Z>>),
- ?line {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):0>>),
+ <<>> = <<Small:Z>>,
+ <<>> = <<Small:0>>,
+ <<>> = <<Big:Z>>,
+ <<>> = <<Big:0>>,
+
+ {'EXIT',{badarg,_}} = (catch <<not_a_number:0>>),
+ {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):Z>>),
+ {'EXIT',{badarg,_}} = (catch <<(id(not_a_number)):0>>),
ok.
diff --git a/lib/debugger/test/bs_match_bin_SUITE.erl b/lib/debugger/test/bs_match_bin_SUITE.erl
index a61b56501c..cd62874a9d 100644
--- a/lib/debugger/test/bs_match_bin_SUITE.erl
+++ b/lib/debugger/test/bs_match_bin_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,9 +27,11 @@
init_per_suite/1,end_per_suite/1,
byte_split_binary/1,bit_split_binary/1,match_huge_bin/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[byte_split_binary, bit_split_binary, match_huge_bin].
@@ -45,50 +47,47 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
-byte_split_binary(doc) -> "Tries to split a binary at all byte-aligned positions.";
+%% Tries to split a binary at all byte-aligned positions.
byte_split_binary(Config) when is_list(Config) ->
- ?line L = lists:seq(0, 57),
- ?line B = mkbin(L),
- ?line byte_split(L, B, size(B)),
- ?line Unaligned = make_unaligned_sub_binary(B),
- ?line byte_split(L, Unaligned, size(Unaligned)).
+ L = lists:seq(0, 57),
+ B = mkbin(L),
+ byte_split(L, B, size(B)),
+ Unaligned = make_unaligned_sub_binary(B),
+ byte_split(L, Unaligned, size(Unaligned)).
byte_split(L, B, Pos) when Pos >= 0 ->
- ?line Sz1 = Pos,
- ?line Sz2 = size(B) - Pos,
- ?line <<B1:Sz1/binary,B2:Sz2/binary>> = B,
- ?line B1 = list_to_binary(lists:sublist(L, 1, Pos)),
- ?line B2 = list_to_binary(lists:nthtail(Pos, L)),
- ?line byte_split(L, B, Pos-1);
+ Sz1 = Pos,
+ Sz2 = size(B) - Pos,
+ <<B1:Sz1/binary,B2:Sz2/binary>> = B,
+ B1 = list_to_binary(lists:sublist(L, 1, Pos)),
+ B2 = list_to_binary(lists:nthtail(Pos, L)),
+ byte_split(L, B, Pos-1);
byte_split(_, _, _) -> ok.
-bit_split_binary(doc) -> "Tries to split a binary at all positions.";
+%% Tries to split a binary at all positions.
bit_split_binary(Config) when is_list(Config) ->
Fun = fun(Bin, List, SkipBef, N) ->
- ?line SkipAft = 8*size(Bin) - N - SkipBef,
+ SkipAft = 8*size(Bin) - N - SkipBef,
%%io:format("~p, ~p, ~p", [SkipBef,N,SkipAft]),
- ?line <<_:SkipBef,OutBin:N/binary-unit:1,_:SkipAft>> = Bin,
- ?line OutBin = make_bin_from_list(List, N)
+ <<_:SkipBef,OutBin:N/binary-unit:1,_:SkipAft>> = Bin,
+ OutBin = make_bin_from_list(List, N)
end,
- ?line bit_split_binary1(Fun, erlang:md5(<<1,2,3>>)),
- ?line bit_split_binary1(Fun,
- make_unaligned_sub_binary(erlang:md5(<<1,2,3>>))),
+ bit_split_binary1(Fun, erlang:md5(<<1,2,3>>)),
+ bit_split_binary1(Fun,
+ make_unaligned_sub_binary(erlang:md5(<<1,2,3>>))),
ok.
bit_split_binary1(Action, Bin) ->
@@ -133,19 +132,19 @@ make_unaligned_sub_binary(Bin0) ->
id(I) -> I.
match_huge_bin(Config) when is_list(Config) ->
- ?line Bin = <<0:(1 bsl 27),13:8>>,
- ?line skip_huge_bin_1(1 bsl 27, Bin),
- ?line 16777216 = match_huge_bin_1(1 bsl 27, Bin),
+ Bin = <<0:(1 bsl 27),13:8>>,
+ skip_huge_bin_1(1 bsl 27, Bin),
+ 16777216 = match_huge_bin_1(1 bsl 27, Bin),
%% Test overflowing the size of a binary field.
- ?line nomatch = overflow_huge_bin_skip_32(Bin),
- ?line nomatch = overflow_huge_bin_32(Bin),
- ?line nomatch = overflow_huge_bin_skip_64(Bin),
- ?line nomatch = overflow_huge_bin_64(Bin),
+ nomatch = overflow_huge_bin_skip_32(Bin),
+ nomatch = overflow_huge_bin_32(Bin),
+ nomatch = overflow_huge_bin_skip_64(Bin),
+ nomatch = overflow_huge_bin_64(Bin),
%% Size in variable
- ?line ok = overflow_huge_bin(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
- ?line ok = overflow_huge_bin_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_bin(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_bin_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
ok.
diff --git a/lib/debugger/test/bs_match_int_SUITE.erl b/lib/debugger/test/bs_match_int_SUITE.erl
index fd77530dd5..8ff5fe260e 100644
--- a/lib/debugger/test/bs_match_int_SUITE.erl
+++ b/lib/debugger/test/bs_match_int_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,11 +26,13 @@
integer/1,signed_integer/1,dynamic/1,more_dynamic/1,mml/1,
match_huge_int/1,bignum/1,unaligned_32_bit/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-import(lists, [seq/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,4}}].
all() ->
[integer, signed_integer, dynamic, more_dynamic, mml,
@@ -47,39 +49,36 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(4)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
integer(Config) when is_list(Config) ->
- ?line 0 = get_int(mkbin([])),
- ?line 0 = get_int(mkbin([0])),
- ?line 42 = get_int(mkbin([42])),
- ?line 255 = get_int(mkbin([255])),
- ?line 256 = get_int(mkbin([1,0])),
- ?line 257 = get_int(mkbin([1,1])),
- ?line 258 = get_int(mkbin([1,2])),
- ?line 258 = get_int(mkbin([1,2])),
- ?line 65534 = get_int(mkbin([255,254])),
- ?line 16776455 = get_int(mkbin([255,253,7])),
- ?line 4245492555 = get_int(mkbin([253,13,19,75])),
- ?line 4294967294 = get_int(mkbin([255,255,255,254])),
- ?line 4294967295 = get_int(mkbin([255,255,255,255])),
- ?line Eight = [200,1,19,128,222,42,97,111],
- ?line cmp128(Eight, uint(Eight)),
- ?line fun_clause(catch get_int(mkbin(seq(1,5)))),
+ 0 = get_int(mkbin([])),
+ 0 = get_int(mkbin([0])),
+ 42 = get_int(mkbin([42])),
+ 255 = get_int(mkbin([255])),
+ 256 = get_int(mkbin([1,0])),
+ 257 = get_int(mkbin([1,1])),
+ 258 = get_int(mkbin([1,2])),
+ 258 = get_int(mkbin([1,2])),
+ 65534 = get_int(mkbin([255,254])),
+ 16776455 = get_int(mkbin([255,253,7])),
+ 4245492555 = get_int(mkbin([253,13,19,75])),
+ 4294967294 = get_int(mkbin([255,255,255,254])),
+ 4294967295 = get_int(mkbin([255,255,255,255])),
+ Eight = [200,1,19,128,222,42,97,111],
+ cmp128(Eight, uint(Eight)),
+ fun_clause(catch get_int(mkbin(seq(1,5)))),
ok.
get_int(Bin) ->
@@ -102,13 +101,13 @@ cmp128(<<I:128>>, I) -> equal;
cmp128(_, _) -> not_equal.
signed_integer(Config) when is_list(Config) ->
- ?line {no_match,_} = sint(mkbin([])),
- ?line {no_match,_} = sint(mkbin([1,2,3])),
- ?line 127 = sint(mkbin([127])),
- ?line -1 = sint(mkbin([255])),
- ?line -128 = sint(mkbin([128])),
- ?line 42 = sint(mkbin([42,255])),
- ?line 127 = sint(mkbin([127,255])).
+ {no_match,_} = sint(mkbin([])),
+ {no_match,_} = sint(mkbin([1,2,3])),
+ 127 = sint(mkbin([127])),
+ -1 = sint(mkbin([255])),
+ -128 = sint(mkbin([128])),
+ 42 = sint(mkbin([42,255])),
+ 127 = sint(mkbin([127,255])).
sint(Bin) ->
case Bin of
@@ -135,7 +134,7 @@ dynamic(Bin, S1) when S1 >= 0 ->
dynamic(_, _) -> ok.
dynamic(Bin, S1, S2, A, B) ->
-% io:format("~p ~p ~p ~p\n", [S1,S2,A,B]),
+ %% io:format("~p ~p ~p ~p\n", [S1,S2,A,B]),
case Bin of
<<A:S1,B:S2>> ->
io:format("~p ~p ~p ~p\n", [S1,S2,A,B]),
@@ -143,16 +142,16 @@ dynamic(Bin, S1, S2, A, B) ->
_Other -> erlang:error(badmatch, [Bin,S1,S2,A,B])
end.
-more_dynamic(doc) -> "Extract integers at different alignments and of different sizes.";
+%% Extract integers at different alignments and of different sizes.
more_dynamic(Config) when is_list(Config) ->
- % Unsigned big-endian numbers.
+ %% Unsigned big-endian numbers.
Unsigned = fun(Bin, List, SkipBef, N) ->
SkipAft = 8*size(Bin) - N - SkipBef,
<<_:SkipBef,Int:N,_:SkipAft>> = Bin,
Int = make_int(List, N, 0)
end,
- ?line more_dynamic1(Unsigned, funny_binary(42)),
+ more_dynamic1(Unsigned, funny_binary(42)),
%% Signed big-endian numbers.
Signed = fun(Bin, List, SkipBef, N) ->
@@ -164,10 +163,10 @@ more_dynamic(Config) when is_list(Config) ->
io:format("Bin = ~p,", [Bin]),
io:format("SkipBef = ~p, N = ~p", [SkipBef,N]),
io:format("Expected ~p, got ~p", [Int,Other]),
- ?t:fail()
+ ct:fail(failed)
end
end,
- ?line more_dynamic1(Signed, funny_binary(43)),
+ more_dynamic1(Signed, funny_binary(43)),
%% Unsigned little-endian numbers.
UnsLittle = fun(Bin, List, SkipBef, N) ->
@@ -175,7 +174,7 @@ more_dynamic(Config) when is_list(Config) ->
<<_:SkipBef,Int:N/little,_:SkipAft>> = Bin,
Int = make_int(big_to_little(List, N), N, 0)
end,
- ?line more_dynamic1(UnsLittle, funny_binary(44)),
+ more_dynamic1(UnsLittle, funny_binary(44)),
%% Signed little-endian numbers.
SignLittle = fun(Bin, List, SkipBef, N) ->
@@ -184,7 +183,7 @@ more_dynamic(Config) when is_list(Config) ->
Little = big_to_little(List, N),
Int = make_signed_int(Little, N)
end,
- ?line more_dynamic1(SignLittle, funny_binary(45)),
+ more_dynamic1(SignLittle, funny_binary(45)),
ok.
@@ -198,7 +197,7 @@ more_dynamic2(Action, Bin, [_|T]=List, Bef) ->
more_dynamic2(_, _, [], _) -> ok.
more_dynamic3(Action, Bin, List, Bef, Aft) when Bef =< Aft ->
-%% io:format("~p, ~p", [Bef,Aft-Bef]),
+ %% io:format("~p, ~p", [Bef,Aft-Bef]),
Action(Bin, List, Bef, Aft-Bef),
more_dynamic3(Action, Bin, List, Bef, Aft-1);
more_dynamic3(_, _, _, _, _) -> ok.
@@ -244,23 +243,23 @@ funny_binary(N) ->
B1.
mml(Config) when is_list(Config) ->
- ?line single_byte_binary = mml_choose(<<42>>),
- ?line multi_byte_binary = mml_choose(<<42,43>>).
+ single_byte_binary = mml_choose(<<42>>),
+ multi_byte_binary = mml_choose(<<42,43>>).
mml_choose(<<_A:8>>) -> single_byte_binary;
mml_choose(<<_A:8,_T/binary>>) -> multi_byte_binary.
match_huge_int(Config) when is_list(Config) ->
Sz = 1 bsl 27,
- ?line Bin = <<0:Sz,13:8>>,
- ?line skip_huge_int_1(Sz, Bin),
- ?line 0 = match_huge_int_1(Sz, Bin),
+ Bin = <<0:Sz,13:8>>,
+ skip_huge_int_1(Sz, Bin),
+ 0 = match_huge_int_1(Sz, Bin),
%% Test overflowing the size of an integer field.
- ?line nomatch = overflow_huge_int_skip_32(Bin),
+ nomatch = overflow_huge_int_skip_32(Bin),
case erlang:system_info(wordsize) of
4 ->
- ?line nomatch = overflow_huge_int_32(Bin);
+ nomatch = overflow_huge_int_32(Bin);
8 ->
%% An attempt will be made to allocate heap space for
%% the bignum (which will probably fail); only if the
@@ -268,15 +267,15 @@ match_huge_int(Config) when is_list(Config) ->
%% the binary is too small.
ok
end,
- ?line nomatch = overflow_huge_int_skip_64(Bin),
- ?line nomatch = overflow_huge_int_64(Bin),
+ nomatch = overflow_huge_int_skip_64(Bin),
+ nomatch = overflow_huge_int_64(Bin),
%% Test overflowing the size of an integer field using variables as sizes.
- ?line Sizes = case erlang:system_info(wordsize) of
- 4 -> lists:seq(25, 32);
- 8 -> []
- end ++ lists:seq(50, 64),
- ?line ok = overflow_huge_int_unit128(Bin, Sizes),
+ Sizes = case erlang:system_info(wordsize) of
+ 4 -> lists:seq(25, 32);
+ 8 -> []
+ end ++ lists:seq(50, 64),
+ ok = overflow_huge_int_unit128(Bin, Sizes),
ok.
@@ -343,19 +342,19 @@ overflow_huge_int_64(<<Int:9223372036854775808/unit:128,0,_/binary>>) -> {8,Int}
overflow_huge_int_64(_) -> nomatch.
bignum(Config) when is_list(Config) ->
- ?line Bin = id(<<42,0:1024/unit:8,43>>),
- ?line <<42:1025/little-integer-unit:8,_:8>> = Bin,
- ?line <<_:8,43:1025/integer-unit:8>> = Bin,
+ Bin = id(<<42,0:1024/unit:8,43>>),
+ <<42:1025/little-integer-unit:8,_:8>> = Bin,
+ <<_:8,43:1025/integer-unit:8>> = Bin,
- ?line BignumBin = id(<<0:512/unit:8,258254417031933722623:9/unit:8>>),
- ?line <<258254417031933722623:(512+9)/unit:8>> = BignumBin,
+ BignumBin = id(<<0:512/unit:8,258254417031933722623:9/unit:8>>),
+ <<258254417031933722623:(512+9)/unit:8>> = BignumBin,
erlang:garbage_collect(), %Search for holes in debug-build.
ok.
unaligned_32_bit(Config) when is_list(Config) ->
%% There used to be a risk for heap overflow (fixed in R11B-5).
- ?line L = unaligned_32_bit_1(<<-1:(64*1024)>>),
- ?line unaligned_32_bit_verify(L, 1638).
+ L = unaligned_32_bit_1(<<-1:(64*1024)>>),
+ unaligned_32_bit_verify(L, 1638).
unaligned_32_bit_1(<<1:1,U:32,_:7,T/binary>>) ->
[U|unaligned_32_bit_1(T)];
diff --git a/lib/debugger/test/bs_match_misc_SUITE.erl b/lib/debugger/test/bs_match_misc_SUITE.erl
index 2221cfe08b..fe86b54992 100644
--- a/lib/debugger/test/bs_match_misc_SUITE.erl
+++ b/lib/debugger/test/bs_match_misc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,9 +29,11 @@
writable_binary_matched/1,otp_7198/1,
unordered_bindings/1,float_middle_endian/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,15}}].
all() ->
[bound_var, bound_tail, t_float, little_float, sean,
@@ -49,8 +51,8 @@ end_per_group(_GroupName, Config) ->
Config.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -58,31 +60,28 @@ end_per_suite(Config) when is_list(Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(15)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
-bound_var(doc) -> "Test matching of bound variables.";
+%% Test matching of bound variables.
bound_var(Config) when is_list(Config) ->
- ?line ok = bound_var(42, 13, <<42,13>>),
- ?line nope = bound_var(42, 13, <<42,255>>),
- ?line nope = bound_var(42, 13, <<154,255>>),
+ ok = bound_var(42, 13, <<42,13>>),
+ nope = bound_var(42, 13, <<42,255>>),
+ nope = bound_var(42, 13, <<154,255>>),
ok.
bound_var(A, B, <<A:8,B:8>>) -> ok;
bound_var(_, _, _) -> nope.
-bound_tail(doc) -> "Test matching of a bound tail.";
+%% Test matching of a bound tail.
bound_tail(Config) when is_list(Config) ->
- ?line ok = bound_tail(<<>>, <<13,14>>),
- ?line ok = bound_tail(<<2,3>>, <<1,1,2,3>>),
- ?line nope = bound_tail(<<2,3>>, <<1,1,2,7>>),
- ?line nope = bound_tail(<<2,3>>, <<1,1,2,3,4>>),
- ?line nope = bound_tail(<<2,3>>, <<>>),
+ ok = bound_tail(<<>>, <<13,14>>),
+ ok = bound_tail(<<2,3>>, <<1,1,2,3>>),
+ nope = bound_tail(<<2,3>>, <<1,1,2,7>>),
+ nope = bound_tail(<<2,3>>, <<1,1,2,3,4>>),
+ nope = bound_tail(<<2,3>>, <<>>),
ok.
bound_tail(T, <<_:16,T/binary>>) -> ok;
@@ -92,26 +91,26 @@ t_float(Config) when is_list(Config) ->
F = f1(),
G = f_one(),
- ?line G = match_float(<<63,128,0,0>>, 32, 0),
- ?line G = match_float(<<63,240,0,0,0,0,0,0>>, 64, 0),
+ G = match_float(<<63,128,0,0>>, 32, 0),
+ G = match_float(<<63,240,0,0,0,0,0,0>>, 64, 0),
- ?line fcmp(F, match_float(<<F:32/float>>, 32, 0)),
- ?line fcmp(F, match_float(<<F:64/float>>, 64, 0)),
- ?line fcmp(F, match_float(<<1:1,F:32/float,127:7>>, 32, 1)),
- ?line fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
- ?line fcmp(F, match_float(<<1:13,F:32/float,127:3>>, 32, 13)),
- ?line fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
+ fcmp(F, match_float(<<F:32/float>>, 32, 0)),
+ fcmp(F, match_float(<<F:64/float>>, 64, 0)),
+ fcmp(F, match_float(<<1:1,F:32/float,127:7>>, 32, 1)),
+ fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
+ fcmp(F, match_float(<<1:13,F:32/float,127:3>>, 32, 13)),
+ fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
- ?line {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16, 0)),
- ?line {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16#7fffffff, 0)),
+ {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16, 0)),
+ {'EXIT',{{badmatch,_},_}} = (catch match_float(<<0,0>>, 16#7fffffff, 0)),
ok.
float_middle_endian(Config) when is_list(Config) ->
F = 9007199254740990.0, % turns to -NaN when word-swapped
- ?line fcmp(F, match_float(<<F:64/float>>, 64, 0)),
- ?line fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
- ?line fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
+ fcmp(F, match_float(<<F:64/float>>, 64, 0)),
+ fcmp(F, match_float(<<1:1,F:64/float,127:7>>, 64, 1)),
+ fcmp(F, match_float(<<1:13,F:64/float,127:3>>, 64, 13)),
ok.
@@ -128,15 +127,15 @@ little_float(Config) when is_list(Config) ->
F = f2(),
G = f_one(),
- ?line G = match_float_little(<<0,0,0,0,0,0,240,63>>, 64, 0),
- ?line G = match_float_little(<<0,0,128,63>>, 32, 0),
+ G = match_float_little(<<0,0,0,0,0,0,240,63>>, 64, 0),
+ G = match_float_little(<<0,0,128,63>>, 32, 0),
- ?line fcmp(F, match_float_little(<<F:32/float-little>>, 32, 0)),
- ?line fcmp(F, match_float_little(<<F:64/float-little>>, 64, 0)),
- ?line fcmp(F, match_float_little(<<1:1,F:32/float-little,127:7>>, 32, 1)),
- ?line fcmp(F, match_float_little(<<1:1,F:64/float-little,127:7>>, 64, 1)),
- ?line fcmp(F, match_float_little(<<1:13,F:32/float-little,127:3>>, 32, 13)),
- ?line fcmp(F, match_float_little(<<1:13,F:64/float-little,127:3>>, 64, 13)),
+ fcmp(F, match_float_little(<<F:32/float-little>>, 32, 0)),
+ fcmp(F, match_float_little(<<F:64/float-little>>, 64, 0)),
+ fcmp(F, match_float_little(<<1:1,F:32/float-little,127:7>>, 32, 1)),
+ fcmp(F, match_float_little(<<1:1,F:64/float-little,127:7>>, 64, 1)),
+ fcmp(F, match_float_little(<<1:13,F:32/float-little,127:3>>, 32, 13)),
+ fcmp(F, match_float_little(<<1:13,F:64/float-little,127:3>>, 64, 13)),
ok.
@@ -164,16 +163,16 @@ f_one() ->
1.0.
sean(Config) when is_list(Config) ->
- ?line small = sean1(<<>>),
- ?line small = sean1(<<1>>),
- ?line small = sean1(<<1,2>>),
- ?line small = sean1(<<1,2,3>>),
- ?line large = sean1(<<1,2,3,4>>),
-
- ?line small = sean1(<<4>>),
- ?line small = sean1(<<4,5>>),
- ?line small = sean1(<<4,5,6>>),
- ?line {'EXIT',{function_clause,_}} = (catch sean1(<<4,5,6,7>>)),
+ small = sean1(<<>>),
+ small = sean1(<<1>>),
+ small = sean1(<<1,2>>),
+ small = sean1(<<1,2,3>>),
+ large = sean1(<<1,2,3,4>>),
+
+ small = sean1(<<4>>),
+ small = sean1(<<4,5>>),
+ small = sean1(<<4,5,6>>),
+ {'EXIT',{function_clause,_}} = (catch sean1(<<4,5,6,7>>)),
ok.
sean1(<<B/binary>>) when byte_size(B) < 4 -> small;
@@ -188,11 +187,11 @@ msisdn_internal_storage(<<>>,MSISDN) ->
msisdn_internal_storage(<<2#11111111:8,_Rest/binary>>,MSISDN) ->
{ok,lists:reverse(MSISDN)};
msisdn_internal_storage(<<2#1111:4,DigitN:4,_Rest/binary>>,MSISDN) when
- DigitN < 10 ->
+ DigitN < 10 ->
{ok,lists:reverse([(DigitN bor 2#11110000)|MSISDN])};
msisdn_internal_storage(<<DigitNplus1:4,DigitN:4,Rest/binary>>,MSISDN) when
- DigitNplus1 < 10,
- DigitN < 10 ->
+ DigitNplus1 < 10,
+ DigitN < 10 ->
NewMSISDN=[((DigitNplus1 bsl 4) bor DigitN)|MSISDN],
msisdn_internal_storage(Rest,NewMSISDN);
msisdn_internal_storage(_Rest,_MSISDN) ->
@@ -297,36 +296,36 @@ getBase64Char(62) -> "+";
getBase64Char(63) -> "/";
getBase64Char(_Else) ->
%% This is an illegal input.
-% cgLogEM:log(error, ?MODULE, getBase64Char, [Else],
-% "illegal input",
-% ?LINE, version()),
+ %% cgLogEM:log(error, ?MODULE, getBase64Char, [Else],
+ %% "illegal input",
+ %% ?LINE, version()),
"**".
-define(M(F), <<F>> = <<F>>).
native(Config) when is_list(Config) ->
- ?line ?M(3.14:64/native-float),
- ?line ?M(333:16/native),
- ?line ?M(38658345:32/native),
+ ?M(3.14:64/native-float),
+ ?M(333:16/native),
+ ?M(38658345:32/native),
case <<1:16/native>> of
<<0,1>> -> native_big();
<<1,0>> -> native_little()
end.
native_big() ->
- ?line <<37.33:64/native-float>> = <<37.33:64/big-float>>,
- ?line <<3974:16/native-integer>> = <<3974:16/big-integer>>,
+ <<37.33:64/native-float>> = <<37.33:64/big-float>>,
+ <<3974:16/native-integer>> = <<3974:16/big-integer>>,
{comment,"Big endian"}.
native_little() ->
- ?line <<37869.32343:64/native-float>> = <<37869.32343:64/little-float>>,
- ?line <<7974:16/native-integer>> = <<7974:16/little-integer>>,
+ <<37869.32343:64/native-float>> = <<37869.32343:64/little-float>>,
+ <<7974:16/native-integer>> = <<7974:16/little-integer>>,
{comment,"Little endian"}.
happi(Config) when is_list(Config) ->
Bin = <<".123">>,
- ?line <<"123">> = lex_digits1(Bin, 1, []),
- ?line <<"123">> = lex_digits2(Bin, 1, []),
+ <<"123">> = lex_digits1(Bin, 1, []),
+ <<"123">> = lex_digits2(Bin, 1, []),
ok.
lex_digits1(<<$., Rest/binary>>,_Val,_Acc) ->
@@ -347,16 +346,16 @@ dec(A) ->
A-$0.
size_var(Config) when is_list(Config) ->
- ?line {<<45>>,<<>>} = split(<<1:16,45>>),
- ?line {<<45>>,<<46,47>>} = split(<<1:16,45,46,47>>),
- ?line {<<45,46>>,<<47>>} = split(<<2:16,45,46,47>>),
+ {<<45>>,<<>>} = split(<<1:16,45>>),
+ {<<45>>,<<46,47>>} = split(<<1:16,45,46,47>>),
+ {<<45,46>>,<<47>>} = split(<<2:16,45,46,47>>),
- ?line {<<45,46,47>>,<<48>>} = split_2(<<16:8,3:16,45,46,47,48>>),
+ {<<45,46,47>>,<<48>>} = split_2(<<16:8,3:16,45,46,47,48>>),
- ?line {<<45,46>>,<<47>>} = split(2, <<2:16,45,46,47>>),
- ?line {'EXIT',{function_clause,_}} = (catch split(42, <<2:16,45,46,47>>)),
+ {<<45,46>>,<<47>>} = split(2, <<2:16,45,46,47>>),
+ {'EXIT',{function_clause,_}} = (catch split(42, <<2:16,45,46,47>>)),
- ?line <<"cdef">> = skip(<<2:8,"abcdef">>),
+ <<"cdef">> = skip(<<2:8,"abcdef">>),
ok.
@@ -372,11 +371,11 @@ split_2(<<N0:8,N:N0,B:N/binary,T/binary>>) ->
skip(<<N:8,_:N/binary,T/binary>>) -> T.
wiger(Config) when is_list(Config) ->
- ?line ok1 = wcheck(<<3>>),
- ?line ok2 = wcheck(<<1,2,3>>),
- ?line ok3 = wcheck(<<4>>),
- ?line {error,<<1,2,3,4>>} = wcheck(<<1,2,3,4>>),
- ?line {error,<<>>} = wcheck(<<>>),
+ ok1 = wcheck(<<3>>),
+ ok2 = wcheck(<<1,2,3>>),
+ ok3 = wcheck(<<4>>),
+ {error,<<1,2,3,4>>} = wcheck(<<1,2,3,4>>),
+ {error,<<>>} = wcheck(<<>>),
ok.
wcheck(<<A>>) when A==3->
@@ -410,9 +409,9 @@ x0_2(_, Bin) ->
x0_3(_, Bin) ->
case Bin of
<<_:72,7:8,_/binary>> ->
- ?line ?t:fail();
+ ct:fail(failed);
<<_:64,0:16,_/binary>> ->
- ?line ?t:fail();
+ ct:fail(failed);
<<_:64,42:16,123456:32,_/binary>> ->
ok
end.
@@ -420,13 +419,13 @@ x0_3(_, Bin) ->
huge_float_field(Config) when is_list(Config) ->
Sz = 1 bsl 27,
- ?line Bin = <<0:Sz>>,
+ Bin = <<0:Sz>>,
- ?line nomatch = overflow_huge_float_skip_32(Bin),
- ?line nomatch = overflow_huge_float_32(Bin),
+ nomatch = overflow_huge_float_skip_32(Bin),
+ nomatch = overflow_huge_float_32(Bin),
- ?line ok = overflow_huge_float(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
- ?line ok = overflow_huge_float_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_float(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
+ ok = overflow_huge_float_unit128(Bin, lists:seq(25, 32)++lists:seq(50, 64)),
ok.
overflow_huge_float_skip_32(<<_:4294967296/float,0,_/binary>>) -> 1; % 1 bsl 32
@@ -486,36 +485,36 @@ overflow_huge_float_unit128(_, []) -> ok.
%%
writable_binary_matched(Config) when is_list(Config) ->
- ?line WritableBin = create_writeable_binary(),
- ?line writable_binary_matched(WritableBin, WritableBin, 500).
+ WritableBin = create_writeable_binary(),
+ writable_binary_matched(WritableBin, WritableBin, 500).
writable_binary_matched(<<0>>, _, N) ->
if
N =:= 0 -> ok;
true ->
put(grow_heap, [N|get(grow_heap)]),
- ?line WritableBin = create_writeable_binary(),
- ?line writable_binary_matched(WritableBin, WritableBin, N-1)
+ WritableBin = create_writeable_binary(),
+ writable_binary_matched(WritableBin, WritableBin, N-1)
end;
writable_binary_matched(<<B:8,T/binary>>, WritableBin0, N) ->
- ?line WritableBin = writable_binary(WritableBin0, B),
+ WritableBin = writable_binary(WritableBin0, B),
writable_binary_matched(T, WritableBin, N).
writable_binary(WritableBin0, B) when is_binary(WritableBin0) ->
%% Heavy append to force the binary to move.
- ?line WritableBin = <<WritableBin0/binary,0:(size(WritableBin0))/unit:8,B>>,
- ?line id(<<(id(0)):128/unit:8>>),
+ WritableBin = <<WritableBin0/binary,0:(size(WritableBin0))/unit:8,B>>,
+ id(<<(id(0)):128/unit:8>>),
WritableBin.
create_writeable_binary() ->
- <<(id(<<>>))/binary,1,2,3,4,5,6,0>>.
+ <<(id(<<>>))/binary,1,2,3,4,5,6,0>>.
otp_7198(Config) when is_list(Config) ->
%% When a match context was reused, and grown at the same time to
%% increase the number of saved positions, the thing word was not updated
%% to account for the new size. Therefore, if there was a garbage collection,
%% the new slots would be included in the garbage collection.
- ?line [do_otp_7198(FillerSize) || FillerSize <- lists:seq(0, 256)],
+ [do_otp_7198(FillerSize) || FillerSize <- lists:seq(0, 256)],
ok.
do_otp_7198(FillerSize) ->
@@ -526,7 +525,7 @@ do_otp_7198(FillerSize) ->
ok;
{'DOWN',Ref,process,Pid,Reason} ->
io:format("unexpected: ~p", [Reason]),
- ?line ?t:fail()
+ ct:fail(failed)
end.
do_otp_7198_test(_) ->
@@ -548,32 +547,32 @@ do_otp_7198_test(_) ->
otp_7198_scan(<<>>, TokAcc) ->
- lists:reverse(['$thats_all_folks$' | TokAcc]);
+ lists:reverse(['$thats_all_folks$' | TokAcc]);
otp_7198_scan(<<D, Z, Rest/binary>>, TokAcc) when
- (D =:= $D orelse D =:= $d) and
- ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
- otp_7198_scan(<<Z, Rest/binary>>, ['AND' | TokAcc]);
+ (D =:= $D orelse D =:= $d) and
+ ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
+ otp_7198_scan(<<Z, Rest/binary>>, ['AND' | TokAcc]);
otp_7198_scan(<<D>>, TokAcc) when
- (D =:= $D) or (D =:= $d) ->
- otp_7198_scan(<<>>, ['AND' | TokAcc]);
+ (D =:= $D) or (D =:= $d) ->
+ otp_7198_scan(<<>>, ['AND' | TokAcc]);
otp_7198_scan(<<N, Z, Rest/binary>>, TokAcc) when
- (N =:= $N orelse N =:= $n) and
- ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
- otp_7198_scan(<<Z, Rest/binary>>, ['NOT' | TokAcc]);
+ (N =:= $N orelse N =:= $n) and
+ ((Z =:= $\s) or (Z =:= $() or (Z =:= $))) ->
+ otp_7198_scan(<<Z, Rest/binary>>, ['NOT' | TokAcc]);
otp_7198_scan(<<C, Rest/binary>>, TokAcc) when
- (C >= $A) and (C =< $Z);
- (C >= $a) and (C =< $z);
- (C >= $0) and (C =< $9) ->
- case Rest of
- <<$:, R/binary>> ->
- otp_7198_scan(R, [{'FIELD', C} | TokAcc]);
- _ ->
- otp_7198_scan(Rest, [{'KEYWORD', C} | TokAcc])
- end.
+ (C >= $A) and (C =< $Z);
+ (C >= $a) and (C =< $z);
+ (C >= $0) and (C =< $9) ->
+ case Rest of
+ <<$:, R/binary>> ->
+ otp_7198_scan(R, [{'FIELD', C} | TokAcc]);
+ _ ->
+ otp_7198_scan(Rest, [{'KEYWORD', C} | TokAcc])
+ end.
unordered_bindings(Config) when is_list(Config) ->
{<<1,2,3,4>>,<<42,42>>,<<3,3,3>>} =
@@ -582,7 +581,7 @@ unordered_bindings(Config) when is_list(Config) ->
unordered_bindings(CompressedLength, HashSize, PadLength, T) ->
<<Content:CompressedLength/binary,Mac:HashSize/binary,
- Padding:PadLength/binary,PadLength>> = T,
+ Padding:PadLength/binary,PadLength>> = T,
{Content,Mac,Padding}.
diff --git a/lib/debugger/test/bs_match_tail_SUITE.erl b/lib/debugger/test/bs_match_tail_SUITE.erl
index 9ec93978ed..4faa0360ce 100644
--- a/lib/debugger/test/bs_match_tail_SUITE.erl
+++ b/lib/debugger/test/bs_match_tail_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,9 +26,11 @@
init_per_suite/1,end_per_suite/1,
aligned/1,unaligned/1,zero_tail/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -48,51 +50,48 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
-aligned(doc) -> "Test aligned tails.";
+%% Test aligned tails.
aligned(Config) when is_list(Config) ->
- ?line Tail1 = mkbin([]),
- ?line {258,Tail1} = al_get_tail_used(mkbin([1,2])),
- ?line Tail2 = mkbin(lists:seq(1, 127)),
- ?line {35091,Tail2} = al_get_tail_used(mkbin([137,19|Tail2])),
-
- ?line 64896 = al_get_tail_unused(mkbin([253,128])),
- ?line 64895 = al_get_tail_unused(mkbin([253,127|lists:seq(42, 255)])),
-
- ?line Tail3 = mkbin(lists:seq(0, 19)),
- ?line {0,Tail1} = get_dyn_tail_used(Tail1, 0),
- ?line {0,Tail3} = get_dyn_tail_used(mkbin([Tail3]), 0),
- ?line {73,Tail3} = get_dyn_tail_used(mkbin([73|Tail3]), 8),
-
- ?line 0 = get_dyn_tail_unused(mkbin([]), 0),
- ?line 233 = get_dyn_tail_unused(mkbin([233]), 8),
- ?line 23 = get_dyn_tail_unused(mkbin([23,22,2]), 8),
+ Tail1 = mkbin([]),
+ {258,Tail1} = al_get_tail_used(mkbin([1,2])),
+ Tail2 = mkbin(lists:seq(1, 127)),
+ {35091,Tail2} = al_get_tail_used(mkbin([137,19|Tail2])),
+
+ 64896 = al_get_tail_unused(mkbin([253,128])),
+ 64895 = al_get_tail_unused(mkbin([253,127|lists:seq(42, 255)])),
+
+ Tail3 = mkbin(lists:seq(0, 19)),
+ {0,Tail1} = get_dyn_tail_used(Tail1, 0),
+ {0,Tail3} = get_dyn_tail_used(mkbin([Tail3]), 0),
+ {73,Tail3} = get_dyn_tail_used(mkbin([73|Tail3]), 8),
+
+ 0 = get_dyn_tail_unused(mkbin([]), 0),
+ 233 = get_dyn_tail_unused(mkbin([233]), 8),
+ 23 = get_dyn_tail_unused(mkbin([23,22,2]), 8),
ok.
al_get_tail_used(<<A:16,T/binary>>) -> {A,T}.
al_get_tail_unused(<<A:16,_/binary>>) -> A.
-unaligned(doc) -> "Test that an non-aligned tail cannot be matched out.";
+%% Test that an non-aligned tail cannot be matched out.
unaligned(Config) when is_list(Config) ->
- ?line {'EXIT',{function_clause,_}} = (catch get_tail_used(mkbin([42]))),
- ?line {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_used(mkbin([137]), 3)),
- ?line {'EXIT',{function_clause,_}} = (catch get_tail_unused(mkbin([42,33]))),
- ?line {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_unused(mkbin([44]), 7)),
+ {'EXIT',{function_clause,_}} = (catch get_tail_used(mkbin([42]))),
+ {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_used(mkbin([137]), 3)),
+ {'EXIT',{function_clause,_}} = (catch get_tail_unused(mkbin([42,33]))),
+ {'EXIT',{{badmatch,_},_}} = (catch get_dyn_tail_unused(mkbin([44]), 7)),
ok.
get_tail_used(<<A:1,T/binary>>) -> {A,T}.
@@ -107,11 +106,11 @@ get_dyn_tail_unused(Bin, Sz) ->
<<A:Sz,_/binary>> = Bin,
A.
-zero_tail(doc) -> "Test that zero tails are tested correctly.";
+%% Test that zero tails are tested correctly.
zero_tail(Config) when is_list(Config) ->
- ?line 7 = (catch test_zero_tail(mkbin([7]))),
- ?line {'EXIT',{function_clause,_}} = (catch test_zero_tail(mkbin([1,2]))),
- ?line {'EXIT',{function_clause,_}} = (catch test_zero_tail2(mkbin([1,2,3]))),
+ 7 = (catch test_zero_tail(mkbin([7]))),
+ {'EXIT',{function_clause,_}} = (catch test_zero_tail(mkbin([1,2]))),
+ {'EXIT',{function_clause,_}} = (catch test_zero_tail2(mkbin([1,2,3]))),
ok.
test_zero_tail(<<A:8>>) -> A.
diff --git a/lib/debugger/test/bs_utf_SUITE.erl b/lib/debugger/test/bs_utf_SUITE.erl
index 90c4d6c7b9..ccedc42064 100644
--- a/lib/debugger/test/bs_utf_SUITE.erl
+++ b/lib/debugger/test/bs_utf_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,10 +28,12 @@
utf8_roundtrip/1,unused_utf_char/1,utf16_roundtrip/1,
utf32_roundtrip/1,guard/1,extreme_tripping/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-compile([no_jopt,time]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -52,31 +54,28 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
utf8_roundtrip(Config) when is_list(Config) ->
- ?line [utf8_roundtrip_1(P) || P <- utf_data()],
+ [utf8_roundtrip_1(P) || P <- utf_data()],
ok.
utf8_roundtrip_1({Str,Bin,Bin}) ->
- ?line Str = utf8_to_list(Bin),
- ?line Bin = list_to_utf8(Str),
- ?line [ok = utf8_guard(C, <<42,C/utf8>>) || C <- Str],
- ?line [error = utf8_guard(C, <<C/utf8>>) || C <- Str],
+ Str = utf8_to_list(Bin),
+ Bin = list_to_utf8(Str),
+ [ok = utf8_guard(C, <<42,C/utf8>>) || C <- Str],
+ [error = utf8_guard(C, <<C/utf8>>) || C <- Str],
ok.
utf8_guard(C, Bin) when <<42,C/utf8>> =:= Bin -> ok;
@@ -106,14 +105,14 @@ utf8_len(<<_/utf8,T/binary>>, N) ->
utf8_len(<<>>, N) -> N.
utf16_roundtrip(Config) when is_list(Config) ->
- ?line {Str,Big,Big,Little,Little} = utf16_data(),
- ?line 4 = utf16_big_len(Big),
- ?line 4 = utf16_little_len(Little),
- ?line Str = big_utf16_to_list(Big),
- ?line Str = little_utf16_to_list(Little),
+ {Str,Big,Big,Little,Little} = utf16_data(),
+ 4 = utf16_big_len(Big),
+ 4 = utf16_little_len(Little),
+ Str = big_utf16_to_list(Big),
+ Str = little_utf16_to_list(Little),
- ?line Big = list_to_big_utf16(Str),
- ?line Little = list_to_little_utf16(Str),
+ Big = list_to_big_utf16(Str),
+ Little = list_to_little_utf16(Str),
ok.
@@ -154,14 +153,14 @@ little_utf16_to_list(<<H/little-utf16,T/binary>>) ->
little_utf16_to_list(<<>>) -> [].
utf32_roundtrip(Config) when is_list(Config) ->
- ?line {Str,Big,Big,Little,Little} = utf32_data(),
- ?line 4 = utf32_big_len(Big),
- ?line 4 = utf32_little_len(Little),
- ?line Str = big_utf32_to_list(Big),
- ?line Str = little_utf32_to_list(Little),
+ {Str,Big,Big,Little,Little} = utf32_data(),
+ 4 = utf32_big_len(Big),
+ 4 = utf32_little_len(Little),
+ Str = big_utf32_to_list(Big),
+ Str = little_utf32_to_list(Little),
- ?line Big = list_to_big_utf32(Str),
- ?line Little = list_to_little_utf32(Str),
+ Big = list_to_big_utf32(Str),
+ Little = list_to_little_utf32(Str),
ok.
@@ -203,7 +202,7 @@ little_utf32_to_list(<<>>) -> [].
guard(Config) when is_list(Config) ->
- ?line error = do_guard(16#D800),
+ error = do_guard(16#D800),
ok.
do_guard(C) when byte_size(<<C/utf8>>) =/= 42 -> ok;
@@ -215,13 +214,13 @@ do_guard(_) -> error.
%% the delayed creation of sub-binaries works.
extreme_tripping(Config) when is_list(Config) ->
- ?line Unicode = lists:seq(0, 1024),
- ?line Utf8 = unicode_to_utf8(Unicode, <<>>),
- ?line Utf16 = utf8_to_utf16(Utf8, <<>>),
- ?line Utf32 = utf8_to_utf32(Utf8, <<>>),
- ?line Utf32 = utf16_to_utf32(Utf16, <<>>),
- ?line Utf8 = utf32_to_utf8(Utf32, <<>>),
- ?line Unicode = utf32_to_unicode(Utf32),
+ Unicode = lists:seq(0, 1024),
+ Utf8 = unicode_to_utf8(Unicode, <<>>),
+ Utf16 = utf8_to_utf16(Utf8, <<>>),
+ Utf32 = utf8_to_utf32(Utf8, <<>>),
+ Utf32 = utf16_to_utf32(Utf16, <<>>),
+ Utf8 = utf32_to_utf8(Utf32, <<>>),
+ Unicode = utf32_to_unicode(Utf32),
ok.
unicode_to_utf8([C|T], Bin) ->
@@ -249,7 +248,7 @@ utf32_to_unicode(<<C/utf32,T/binary>>) ->
utf32_to_unicode(<<>>) -> [].
utf_data() ->
-%% From RFC-3629.
+ %% From RFC-3629.
%% Give the compiler a change to do some constant propagation.
NotIdentical = 16#2262,
@@ -287,7 +286,7 @@ utf16_data() ->
%% Little endian (the two binaries should be equal).
<<RaHieroglyph/little-utf16,16#3D/little-utf16,
- 16#52/little-utf16,16#61/little-utf16>>,
+ 16#52/little-utf16,16#61/little-utf16>>,
<<16#08,16#D8,16#45,16#DF,16#3D,16#00,16#52,16#00,16#61,16#00>>}.
utf32_data() ->
@@ -301,6 +300,6 @@ utf32_data() ->
%% Little endian.
<<16#0041/little-utf32,NotIdentical/little-utf32,
- 16#0391/little-utf32,16#002E/little-utf32>>,
+ 16#0391/little-utf32,16#002E/little-utf32>>,
<<16#41:32/little,NotIdentical:32/little,
- 16#0391:32/little,16#2E:32/little>>}.
+ 16#0391:32/little,16#2E:32/little>>}.
diff --git a/lib/debugger/test/bug_SUITE.erl b/lib/debugger/test/bug_SUITE.erl
index 542db3f41e..ac73672d2a 100644
--- a/lib/debugger/test/bug_SUITE.erl
+++ b/lib/debugger/test/bug_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -21,14 +21,16 @@
%%
-module(bug_SUITE).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
-export([otp2163/1, otp4845/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[{group, ticket_tests}].
@@ -43,54 +45,52 @@ end_per_suite(_Config) ->
ok.
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
-otp2163(doc) -> ["BIF exit reason"];
-otp2163(suite) -> [];
+%% BIF exit reason.
otp2163(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% First compile and get the expected results:
- ?line FileName = filename:join(DataDir, "otp2163"),
- ?line {module,otp2163} = code:load_abs(FileName),
+ FileName = filename:join(DataDir, "otp2163"),
+ {module,otp2163} = code:load_abs(FileName),
- ?line {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
- ?line {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
+ {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
+ {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
%% Then interpret, and check if the results are OK.
- ?line {module,otp2163} = int:i(FileName),
+ {module,otp2163} = int:i(FileName),
- ?line ok = io:format("Expecting ~p", [ApplyRes]),
- ?line {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
- ?line ok = io:format("Expecting ~p", [ListRes]),
- ?line {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
+ ok = io:format("Expecting ~p", [ApplyRes]),
+ {'EXIT',{badarg,[ApplyRes|_]}} = (catch otp2163:apply_test()),
+ ok = io:format("Expecting ~p", [ListRes]),
+ {'EXIT',{badarg,[ListRes|_]}} = (catch otp2163:list_to_atom_test()),
ok.
-otp4845(doc) -> ["BIF not loading and not bug compatible, OTP-4845 OTP-4859"];
-otp4845(suite) -> [];
+%% BIF not loading and not bug compatible, OTP-4845 OTP-4859.
otp4845(Config) when is_list(Config) ->
- ?line DataDir = ?config(data_dir, Config),
+ DataDir = proplists:get_value(data_dir, Config),
%% First compile and get the expected results:
- ?line FileName = filename:join(DataDir, "otp4845"),
- ?line {module,otp4845} = code:load_abs(FileName),
+ FileName = filename:join(DataDir, "otp4845"),
+ {module,otp4845} = code:load_abs(FileName),
- ?line CompiledRes = (catch otp4845:test()),
- ?line ok = io:format("Compiled ~p", [CompiledRes]),
+ CompiledRes = (catch otp4845:test()),
+ ok = io:format("Compiled ~p", [CompiledRes]),
%% Then interpret, and check if the results are OK.
- ?line {module,otp4845} = int:i(FileName),
+ {module,otp4845} = int:i(FileName),
- ?line IntRes = (catch otp4845:test()),
- ?line ok = io:format("Interpreted ~p", [IntRes]),
+ IntRes = (catch otp4845:test()),
+ ok = io:format("Interpreted ~p", [IntRes]),
- ?line CompiledRes = IntRes,
+ CompiledRes = IntRes,
ok.
diff --git a/lib/debugger/test/bug_SUITE_data/Makefile.src b/lib/debugger/test/bug_SUITE_data/Makefile.src
index 244c9025f0..621eebc389 100644
--- a/lib/debugger/test/bug_SUITE_data/Makefile.src
+++ b/lib/debugger/test/bug_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/bug_SUITE_data/otp2163.erl b/lib/debugger/test/bug_SUITE_data/otp2163.erl
index 6b6dcffa8c..f80b019854 100644
--- a/lib/debugger/test/bug_SUITE_data/otp2163.erl
+++ b/lib/debugger/test/bug_SUITE_data/otp2163.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/bug_SUITE_data/otp4845.erl b/lib/debugger/test/bug_SUITE_data/otp4845.erl
index ffb038cc9e..43e0263df0 100644
--- a/lib/debugger/test/bug_SUITE_data/otp4845.erl
+++ b/lib/debugger/test/bug_SUITE_data/otp4845.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2010. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/cleanup.erl b/lib/debugger/test/cleanup.erl
index b40ae5f82c..7970b53086 100644
--- a/lib/debugger/test/cleanup.erl
+++ b/lib/debugger/test/cleanup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,25 +23,24 @@
-export([all/0,groups/0,init_per_group/2,end_per_group/2, cleanup/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
all() ->
-[cleanup].
+ [cleanup].
groups() ->
[].
init_per_group(_GroupName, Config) ->
- Config.
+ Config.
end_per_group(_GroupName, Config) ->
- Config.
+ Config.
-cleanup(suite) -> [];
cleanup(_) ->
- ?line Mods = int:interpreted(),
- ?line ok = int:n(Mods),
+ Mods = int:interpreted(),
+ ok = int:n(Mods),
case whereis(interpret) of
undefined ->
ok;
diff --git a/lib/debugger/test/dbg_ui_SUITE.erl b/lib/debugger/test/dbg_ui_SUITE.erl
index f0f4e09aa8..32577d48cd 100644
--- a/lib/debugger/test/dbg_ui_SUITE.erl
+++ b/lib/debugger/test/dbg_ui_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,17 +22,17 @@
-module(dbg_ui_SUITE).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-% Test server specific exports
+%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
-% Test cases must be exported.
+%% Test cases must be exported.
-export ([dbg_ui/1]).
-% Manual test suites/cases exports
+%% Manual test suites/cases exports
-export([start1/1, interpret1/1, quit1/1,
start2/1, interpret2/1, break2/1, options2/1, quit2/1,
interpret3/1, all_step3/1,all_next3/1,save3/1,restore3/1,finish3/1,
@@ -44,15 +44,14 @@
-export([init_per_testcase/2, end_per_testcase/2]).
init_per_testcase(_Func, Config) ->
- Dog=test_server:timetrap(60*1000),
- [{watchdog, Dog}|Config].
-
-end_per_testcase(_Func, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog).
+ Config.
+end_per_testcase(_Func, _Config) ->
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[dbg_ui, {group, manual_tests}].
@@ -78,22 +77,17 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-dbg_ui (doc) ->
- ["Debugger GUI"];
-
-dbg_ui (suite) ->
- [];
-
+%% Test Debugger GUI.
dbg_ui (_Config) ->
case os:getenv("DISPLAY") of
false ->
{skipped,"No display"};
Other when is_list(Other) ->
-% ?line {ok, Pid} = debugger:start (),
-% ?line ok = is_pid (Pid),
-% ?line true = erlang:is_process_alive(Pid),
-% ?line ok = debugger:stop(),
-% ?line false = erlang:is_process_alive(Pid)
+ %% {ok, Pid} = debugger:start (),
+ %% ok = is_pid (Pid),
+ %% true = erlang:is_process_alive(Pid),
+ %% ok = debugger:stop(),
+ %% false = erlang:is_process_alive(Pid)
{skipped,"Gunilla: Workaround"}
end.
@@ -105,11 +99,11 @@ dbg_ui (_Config) ->
check(Case, Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ResultFileName = filename:join([DataDir, "manual_results.erl"]),
+ DataDir = proplists:get_value(data_dir, Config),
+ ResultFileName = filename:join([DataDir, "manual_results.erl"]),
case file:consult(ResultFileName) of
{ok, Results} ->
- ?line io:format("Results: ~p~n",[Results]),
+ io:format("Results: ~p~n",[Results]),
case Results of
[] ->
no_result;
@@ -136,29 +130,27 @@ check(Case, Config) ->
-define(MAN_CASE(Name,Doc, Description),
- Name(doc) -> [Doc];
- Name(suite) -> [];
Name(Config) ->
- ?line io:format("Checking ~p~n",[Name]),
- ?line io:format("Config = ~p~n",[Config]),
+ io:format("Checking ~p~n",[Name]),
+ io:format("Config = ~p~n",[Config]),
case check(Name, Config) of
pass ->
- ?line ok;
+ ok;
fail ->
- ?line test_server:fail("Manual test failed");
+ ct:fail("Manual test failed");
unknown ->
- ?line {skipped, "Manual test result unknown"};
+ {skipped, "Manual test result unknown"};
no_result ->
- ?line {skipped, Description};
+ {skipped, Description};
{error, _Reason} ->
-%% Text = lists:flatten(
-%% io_lib:format("[File problem: ~s]~s",
-%% [Reason,Description])),
- ?line {skipped, Description}
+ %% Text = lists:flatten(
+ %% io_lib:format("[File problem: ~s]~s",
+ %% [Reason,Description])),
+ {skipped, Description}
end
- ).
+ ).
%% SET 1
@@ -170,101 +162,101 @@ please start the debugger from the toolbar").
?MAN_CASE(interpret1, "Interpreting modules",
"In this test case and all of the ones following, the source code
files to use can be found in the test data directory for this debugger test
- suite (probably in
-/clearcase/otp/tools/debugger/test/dbg_ui_SUITE_data/manual_data/src ).
+ suite (probably in
+ /clearcase/otp/tools/debugger/test/dbg_ui_SUITE_data/manual_data/src ).
Interpret one module").
?MAN_CASE(quit1, "Quit the debugger",
-"Quit the debugger using File->Exit in the main window").
+ "Quit the debugger using File->Exit in the main window").
%% SET 2
?MAN_CASE(start2, "Start the debugger from the shell",
-"Start the debugger from the shell. Use debugger:start()").
+ "Start the debugger from the shell. Use debugger:start()").
?MAN_CASE(interpret2, "Interpret all modules",
-"Interpret all modules").
+ "Interpret all modules").
?MAN_CASE(break2, "Set break points",
-"Set break points").
+ "Set break points").
?MAN_CASE(options2, "Set options to attach on break",
-"Set options to attach on break").
+ "Set options to attach on break").
?MAN_CASE(quit2, "Quit the debugger",
-"Quit the debugger using the close box in the main window title frame").
+ "Quit the debugger using the close box in the main window title frame").
%% SET3
?MAN_CASE(interpret3, "Test attach options",
-"Start the debugger and interpret the modules [test, lists1, ordsets1]. Close the Interpret dialog. Set Attach on First Call and Attach on Break.").
+ "Start the debugger and interpret the modules [test, lists1, ordsets1]. Close the Interpret dialog. Set Attach on First Call and Attach on Break.").
?MAN_CASE(all_step3, "Click Step through all evaluation",
-"In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "In the shell, call test:test1(). Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(all_next3,"Click Next through all evaluation",
-"Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Again call test:test1() in the shell. This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(save3, "Save the debugger state",
-"Use File->Save Settings to save the debugger state with the name 'three.state'").
+ "Use File->Save Settings to save the debugger state with the name 'three.state'").
?MAN_CASE(restore3,"Quit the debugger, restart and restore the state",
-"Quit the debugger. Start it again. Use File->Load Settings to restore the state saved in 'three.state'. Check that the Attach-options are the same as what you set them to in the interpret3 test case. Check that the three modules [test,lists1,ordsets1] are interpreted.").
+ "Quit the debugger. Start it again. Use File->Load Settings to restore the state saved in 'three.state'. Check that the Attach-options are the same as what you set them to in the interpret3 test case. Check that the three modules [test,lists1,ordsets1] are interpreted.").
?MAN_CASE(finish3, "Finish the current function body",
-"Call the fucntion test:test1() from the shell. Press Finish to evaluate the remaining lines in the function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Call the fucntion test:test1() from the shell. Press Finish to evaluate the remaining lines in the function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(killinit3,"Set up for killing and clearing processes",
-"Call test:test2() from the shell. Set a break point at the last line of test:test2. Click Continue. This should open three new attach windows. One for each spawn called in test:test2/0. ").
+ "Call test:test2() from the shell. Set a break point at the last line of test:test2. Click Continue. This should open three new attach windows. One for each spawn called in test:test2/0. ").
?MAN_CASE(killone3, "Kill a process and clear it",
-"In one of the newly openend Attach windows: select Process->Kill. A message should appear above the Code Area in the Attach window. Use Windows->Monitor to verify that the Monitor window also shows that the process has been killed. In the Monitor window: select Edit->Clear. This should do two things: 1) close/remove the window of the killed process. 2) Remove the entry of the killed process from the monitor window.").
+ "In one of the newly openend Attach windows: select Process->Kill. A message should appear above the Code Area in the Attach window. Use Windows->Monitor to verify that the Monitor window also shows that the process has been killed. In the Monitor window: select Edit->Clear. This should do two things: 1) close/remove the window of the killed process. 2) Remove the entry of the killed process from the monitor window.").
?MAN_CASE(killall3,"KIll all processes, and clear them",
-"In the Monitor window: Select Edit->Kill All. Verify that all processes have been killed (in their respective windows and in the monitor window). Windows will be raised as their processes die. Next select, Edit->Clear. All attach windows should now be closed. Their entris should also disappear from the monitor window. The shell should have reported: ** exited: killed **").
+ "In the Monitor window: Select Edit->Kill All. Verify that all processes have been killed (in their respective windows and in the monitor window). Windows will be raised as their processes die. Next select, Edit->Clear. All attach windows should now be closed. Their entris should also disappear from the monitor window. The shell should have reported: ** exited: killed **").
?MAN_CASE(deleteone3,"Delete/uniterpret one module",
-"In the Monitor window: Select Module->test->Delete. This should remove the breakpoints set in the test module, and the test module should disappear from the Module menu.").
+ "In the Monitor window: Select Module->test->Delete. This should remove the breakpoints set in the test module, and the test module should disappear from the Module menu.").
?MAN_CASE(deleteall3,"Delete/uniterpret all modules",
-"In the Monitor window: Select Module->Delete All Modules. This should remove all modules from the Module menu. ").
+ "In the Monitor window: Select Module->Delete All Modules. This should remove all modules from the Module menu. ").
%% SET 4
?MAN_CASE(viewbreak4, "Test the View window",
-"Restore the settings from the three.state file again. In the Monitor window: Use Module->test->View to view the source code of the test module. In the View window, select Break->Line Break and set a break at line 53. Check that it appears in the View window and in the Monitor Window Break-menu. Also in the View window, select Break->Function Break and set a break at function test:test4. Check that the break (at line 59) appears in the View Window and in the Monitor Window Break-menu.").
+ "Restore the settings from the three.state file again. In the Monitor window: Use Module->test->View to view the source code of the test module. In the View window, select Break->Line Break and set a break at line 53. Check that it appears in the View window and in the Monitor Window Break-menu. Also in the View window, select Break->Function Break and set a break at function test:test4. Check that the break (at line 59) appears in the View Window and in the Monitor Window Break-menu.").
?MAN_CASE(delete4, "Remove breaks",
-"Use the Break->Delete All function in the View window to remove all breaks in the test module. Check that they are all removed. Close the View window.").
+ "Use the Break->Delete All function in the View window to remove all breaks in the test module. Check that they are all removed. Close the View window.").
%% SET 5
?MAN_CASE(attach5,"Set attach options",
-"Set the attach options to only attach on exit").
+ "Set the attach options to only attach on exit").
?MAN_CASE(normal5, "Test normal exit",
-"Call test:test12(normal) in the shell. This should return the atom 'done', and no windows should be opened.").
+ "Call test:test12(normal) in the shell. This should return the atom 'done', and no windows should be opened.").
?MAN_CASE(exit5, "Test abnormal exit",
-"Call test:test12(crash) in the shell. This should give the error message ** exited: crash **, and an attach window should be opened highlighting the last line in the test12-function.").
+ "Call test:test12(crash) in the shell. This should give the error message ** exited: crash **, and an attach window should be opened highlighting the last line in the test12-function.").
?MAN_CASE(options5, "Experiment with the frames in the attach window",
-"Try all possible configurations of the [Button, Evaluator, Bindings, Trace] Frames in the attach window and see that the expected frames are shown/hidden.").
+ "Try all possible configurations of the [Button, Evaluator, Bindings, Trace] Frames in the attach window and see that the expected frames are shown/hidden.").
%% SET 6 (Distribution)
?MAN_CASE(distsetup6,"Set up distribution",
-"Start two erlang systems [foo,bar] (with option -sname), make them aware of eachother using net_adm:ping/1. Start the debugger on foo. Interpret the modules [test, lists1, ordsets1]. Set attach on First call. ").
+ "Start two erlang systems [foo,bar] (with option -sname), make them aware of eachother using net_adm:ping/1. Start the debugger on foo. Interpret the modules [test, lists1, ordsets1]. Set attach on First call. ").
?MAN_CASE(all_step6, "Click Step through all evaluation",
-"In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "In the bar shell, call test:test1().This should open an attach window. Use the Step button, the Process->Step menu item and the ctrl-s shortcut to step through the *entire* execution of the call. (Approx 36 steps). Then close the Attach window. The result printed in the bar shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
?MAN_CASE(all_next6,"Click Next through all evaluation",
-"Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
+ "Again, in the bar shell, call test:test1(). This time Use the Next button, the Process->Next menu and the ctrl-n shortcut to quickly step over the execution of the four lines in the test1-function. The result printed in the shell should be: {\"peter\",[1,2,4,a,b,c],\"olin\"}").
diff --git a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl
index c26ccfceda..32aabfcbb9 100644
--- a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl
+++ b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/lists1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl
index 63224fc493..bb7439aac0 100644
--- a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl
+++ b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/ordsets1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl
index d7af58e573..6c38fd011a 100644
--- a/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl
+++ b/lib/debugger/test/dbg_ui_SUITE_data/manual_data/src/test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/debugger_SUITE.erl b/lib/debugger/test/debugger_SUITE.erl
index 9207df38e4..c72f154928 100644
--- a/lib/debugger/test/debugger_SUITE.erl
+++ b/lib/debugger/test/debugger_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@
%% Test break points.
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
@@ -31,7 +31,9 @@
app_test/1,appup_test/1,erts_debug/1,encrypted_debug_info/1,
no_abstract_code/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[app_test, appup_test, erts_debug, no_abstract_code,
@@ -54,39 +56,37 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- Dog=test_server:timetrap(?t:minutes(0.5)),
- [{watchdog, Dog}|Config].
-end_per_testcase(_Case, Config) ->
- Dog=?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
app_test(Config) when is_list(Config) ->
- ?line ?t:app_test(debugger),
+ test_server:app_test(debugger),
ok.
appup_test(Config) when is_list(Config) ->
- ok = ?t:appup_test(debugger).
+ ok = test_server:appup_test(debugger).
erts_debug(Config) when is_list(Config) ->
c:l(erts_debug),
ok.
no_abstract_code(Config) when is_list(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
%% Compile module without abstract code.
CompileFlags = [{outdir,PrivDir}],
- ?line {ok,_} = compile:file(Source, CompileFlags),
- ?line error = int:i(Simple),
+ {ok,_} = compile:file(Source, CompileFlags),
+ error = int:i(Simple),
%% Cleanup.
- ?line ok = file:delete(Source),
- ?line ok = file:delete(BeamFile),
+ ok = file:delete(Source),
+ ok = file:delete(BeamFile),
ok.
@@ -100,28 +100,28 @@ encrypted_debug_info(Config) when is_list(Config) ->
end.
encrypted_debug_info_1(Config) ->
- ?line PrivDir = ?config(priv_dir, Config),
- ?line Simple = filename:join(PrivDir, "simple"),
- ?line Source = Simple ++ ".erl",
- ?line BeamFile = Simple ++ ".beam",
- ?line simple_file(Source),
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Simple = filename:join(PrivDir, "simple"),
+ Source = Simple ++ ".erl",
+ BeamFile = Simple ++ ".beam",
+ simple_file(Source),
%% Compile module.
Key = "_This a Crypto Key_",
CompileFlags = [{outdir,PrivDir},debug_info,{debug_info_key,Key}],
- ?line {ok,_} = compile:file(Source, CompileFlags),
+ {ok,_} = compile:file(Source, CompileFlags),
%% Interpret module
- ?line ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
- ?line {module,simple} = int:i(Simple),
+ ok = beam_lib:crypto_key_fun(simple_crypto_fun(Key)),
+ {module,simple} = int:i(Simple),
%% Remove key.
- ?line {ok,_} = beam_lib:clear_crypto_key_fun(),
- ?line error = int:i(Simple),
+ {ok,_} = beam_lib:clear_crypto_key_fun(),
+ error = int:i(Simple),
%% Cleanup.
- ?line ok = file:delete(Source),
- ?line ok = file:delete(BeamFile),
+ ok = file:delete(Source),
+ ok = file:delete(BeamFile),
ok.
diff --git a/lib/debugger/test/debugger_test.erl b/lib/debugger/test/debugger_test.erl
index 9a5fb11b8c..d895f25db2 100644
--- a/lib/debugger/test/debugger_test.erl
+++ b/lib/debugger/test/debugger_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/erl_eval_SUITE.erl b/lib/debugger/test/erl_eval_SUITE.erl
index af9b0a6e6e..8907856583 100644
--- a/lib/debugger/test/erl_eval_SUITE.erl
+++ b/lib/debugger/test/erl_eval_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
-module(erl_eval_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
+ init_per_testcase/2, end_per_testcase/2,
init_per_group/2,end_per_group/2]).
-export([guard_1/1, guard_2/1,
@@ -43,38 +44,23 @@
eval_expr_5/1,
eep37/1]).
-%%
-%% Define to run outside of test server
-%%
-%%-define(STANDALONE,1).
+-include_lib("common_test/include/ct.hrl").
-import(lists,[concat/1, sort/1]).
-export([count_down/2, count_down_fun/0, do_apply/2,
local_func/3, local_func_value/2]).
--ifdef(STANDALONE).
--define(config(A,B),config(A,B)).
--export([config/2]).
--define(line, noop, ).
-config(priv_dir,_) ->
- ".".
--else.
--include_lib("test_server/include/test_server.hrl").
--export([init_per_testcase/2, end_per_testcase/2]).
-% Default timetrap timeout (set in init_per_testcase).
--define(default_timeout, ?t:minutes(1)).
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- ?line Dog = ?t:timetrap(?default_timeout),
- [{watchdog, Dog} | Config].
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- test_server:timetrap_cancel(Dog),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
ok.
--endif.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[guard_1, guard_2, match_pattern, string_plusplus,
@@ -99,125 +85,101 @@ end_per_group(_GroupName, Config) ->
Config.
-guard_1(doc) ->
- ["(OTP-2405)"];
-guard_1(suite) ->
- [];
+%% (OTP-2405).
guard_1(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if a+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line no = guard_1_compiled(),
- ?line {value, no, []} = erl_eval:expr(Expr, []),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ no = guard_1_compiled(),
+ {value, no, []} = erl_eval:expr(Expr, []),
ok.
guard_1_compiled() ->
if a+4 == 4 -> yes; true -> no end.
-guard_2(doc) ->
- ["Similar to guard_1, but type-correct"];
-guard_2(suite) ->
- [];
+%% Similar to guard_1, but type-correct.
guard_2(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if 6+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line no = guard_2_compiled(),
- ?line {value, no, []} = erl_eval:expr(Expr, []),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ no = guard_2_compiled(),
+ {value, no, []} = erl_eval:expr(Expr, []),
ok.
guard_2_compiled() ->
if 6+4 == 4 -> yes; true -> no end.
-string_plusplus(doc) ->
- ["OTP-3069: syntactic sugar string ++ ..."];
-string_plusplus(suite) ->
- [];
+%% OTP-3069: syntactic sugar string ++ ...
string_plusplus(Config) when is_list(Config) ->
- ?line check(fun() -> case "abc" of "ab" ++ L -> L end end,
- "case \"abc\" of \"ab\" ++ L -> L end. ",
- "c"),
- ?line check(fun() -> case "abcde" of "ab" ++ "cd" ++ L -> L end end,
- "case \"abcde\" of \"ab\" ++ \"cd\" ++ L -> L end. ",
- "e"),
- ?line check(fun() -> case "abc" of [97, 98] ++ L -> L end end,
- "case \"abc\" of [97, 98] ++ L -> L end. ",
- "c"),
+ check(fun() -> case "abc" of "ab" ++ L -> L end end,
+ "case \"abc\" of \"ab\" ++ L -> L end. ",
+ "c"),
+ check(fun() -> case "abcde" of "ab" ++ "cd" ++ L -> L end end,
+ "case \"abcde\" of \"ab\" ++ \"cd\" ++ L -> L end. ",
+ "e"),
+ check(fun() -> case "abc" of [97, 98] ++ L -> L end end,
+ "case \"abc\" of [97, 98] ++ L -> L end. ",
+ "c"),
ok.
-match_pattern(doc) ->
- ["OTP-2983: match operator in pattern"];
-match_pattern(suite) ->
- [];
+%% OTP-2983: match operator in pattern.
match_pattern(Config) when is_list(Config) ->
- ?line check(fun() -> case {a, b} of {a, _X}=Y -> {x,Y} end end,
- "case {a, b} of {a, X}=Y -> {x,Y} end. ",
- {x, {a, b}}),
- ?line check(fun() -> case {a, b} of Y={a, _X} -> {x,Y} end end,
- "case {a, b} of Y={a, X} -> {x,Y} end. ",
- {x, {a, b}}),
- ?line check(fun() -> case {a, b} of Y={a, _X}=Z -> {Z,Y} end end,
- "case {a, b} of Y={a, X}=Z -> {Z,Y} end. ",
- {{a, b}, {a, b}}),
- ?line check(fun() -> A = 4, B = 28, <<13:(A+(X=B))>>, X end,
- "begin A = 4, B = 28, <<13:(A+(X=B))>>, X end.",
- 28),
+ check(fun() -> case {a, b} of {a, _X}=Y -> {x,Y} end end,
+ "case {a, b} of {a, X}=Y -> {x,Y} end. ",
+ {x, {a, b}}),
+ check(fun() -> case {a, b} of Y={a, _X} -> {x,Y} end end,
+ "case {a, b} of Y={a, X} -> {x,Y} end. ",
+ {x, {a, b}}),
+ check(fun() -> case {a, b} of Y={a, _X}=Z -> {Z,Y} end end,
+ "case {a, b} of Y={a, X}=Z -> {Z,Y} end. ",
+ {{a, b}, {a, b}}),
+ check(fun() -> A = 4, B = 28, <<13:(A+(X=B))>>, X end,
+ "begin A = 4, B = 28, <<13:(A+(X=B))>>, X end.",
+ 28),
ok.
-match_bin(doc) ->
- ["binary match problems"];
-match_bin(suite) ->
- [];
+%% binary match problems.
match_bin(Config) when is_list(Config) ->
- ?line check(fun() -> <<"abc">> = <<"abc">> end,
- "<<\"abc\">> = <<\"abc\">>. ",
- <<"abc">>),
- ?line check(fun() ->
- <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
- {Size,B,Rest}
- end,
- "begin <<Size,B:Size/binary,Rest/binary>> = <<2,\"AB\",\"CD\">>, "
- "{Size,B,Rest} end. ",
- {2,<<"AB">>,<<"CD">>}),
+ check(fun() -> <<"abc">> = <<"abc">> end,
+ "<<\"abc\">> = <<\"abc\">>. ",
+ <<"abc">>),
+ check(fun() ->
+ <<Size,B:Size/binary,Rest/binary>> = <<2,"AB","CD">>,
+ {Size,B,Rest}
+ end,
+ "begin <<Size,B:Size/binary,Rest/binary>> = <<2,\"AB\",\"CD\">>, "
+ "{Size,B,Rest} end. ",
+ {2,<<"AB">>,<<"CD">>}),
ok.
-pattern_expr(doc) ->
- ["OTP-3144: compile-time expressions in pattern"];
-pattern_expr(suite) ->
- [];
+%% OTP-3144: compile-time expressions in pattern.
pattern_expr(Config) when is_list(Config) ->
- ?line check(fun() -> case 4 of 2+2 -> ok end end,
- "case 4 of 2+2 -> ok end. ",
- ok),
- ?line check(fun() -> case 2 of +2 -> ok end end,
- "case 2 of +2 -> ok end. ",
- ok),
+ check(fun() -> case 4 of 2+2 -> ok end end,
+ "case 4 of 2+2 -> ok end. ",
+ ok),
+ check(fun() -> case 2 of +2 -> ok end end,
+ "case 2 of +2 -> ok end. ",
+ ok),
ok.
-guard_3(doc) ->
- ["OTP-4518."];
-guard_3(suite) ->
- [];
+%% OTP-4518.
guard_3(Config) when is_list(Config) ->
- ?line check(fun() -> if false -> false; true -> true end end,
- "if false -> false; true -> true end.",
- true),
- ?line check(fun() -> if <<"hej">> == <<"hopp">> -> true;
- true -> false end end,
- "begin if <<\"hej\">> == <<\"hopp\">> -> true;
+ check(fun() -> if false -> false; true -> true end end,
+ "if false -> false; true -> true end.",
+ true),
+ check(fun() -> if <<"hej">> == <<"hopp">> -> true;
+ true -> false end end,
+ "begin if <<\"hej\">> == <<\"hopp\">> -> true;
true -> false end end.",
false),
- ?line check(fun() -> if <<"hej">> == <<"hej">> -> true;
- true -> false end end,
- "begin if <<\"hej\">> == <<\"hej\">> -> true;
+ check(fun() -> if <<"hej">> == <<"hej">> -> true;
+ true -> false end end,
+ "begin if <<\"hej\">> == <<\"hej\">> -> true;
true -> false end end.",
true),
ok.
-guard_4(doc) ->
- ["OTP-4885."];
-guard_4(suite) ->
- [];
+%% OTP-4885.
guard_4(Config) when is_list(Config) ->
check(fun() -> if erlang:'+'(3,a) -> true ; true -> false end end,
"if erlang:'+'(3,a) -> true ; true -> false end.",
@@ -226,315 +188,300 @@ guard_4(Config) when is_list(Config) ->
end,
"if erlang:is_integer(3) -> true ; true -> false end.",
true),
- ?line check(fun() -> [X || X <- [1,2,3], erlang:is_integer(X)] end,
- "[X || X <- [1,2,3], erlang:is_integer(X)].",
- [1,2,3]),
- ?line check(fun() -> if is_atom(is_integer(a)) -> true ; true -> false end
- end,
- "if is_atom(is_integer(a)) -> true ; true -> false end.",
- true),
+ check(fun() -> [X || X <- [1,2,3], erlang:is_integer(X)] end,
+ "[X || X <- [1,2,3], erlang:is_integer(X)].",
+ [1,2,3]),
+ check(fun() -> if is_atom(is_integer(a)) -> true ; true -> false end
+ end,
+ "if is_atom(is_integer(a)) -> true ; true -> false end.",
+ true),
check(fun() -> if erlang:is_atom(erlang:is_integer(a)) -> true;
true -> false end end,
"if erlang:is_atom(erlang:is_integer(a)) -> true; "
"true -> false end.",
true),
- ?line check(fun() -> if is_atom(3+a) -> true ; true -> false end end,
- "if is_atom(3+a) -> true ; true -> false end.",
- false),
- ?line check(fun() -> if erlang:is_atom(3+a) -> true ; true -> false end
- end,
- "if erlang:is_atom(3+a) -> true ; true -> false end.",
- false),
+ check(fun() -> if is_atom(3+a) -> true ; true -> false end end,
+ "if is_atom(3+a) -> true ; true -> false end.",
+ false),
+ check(fun() -> if erlang:is_atom(3+a) -> true ; true -> false end
+ end,
+ "if erlang:is_atom(3+a) -> true ; true -> false end.",
+ false),
ok.
-lc(doc) ->
- ["OTP-4518."];
-lc(suite) ->
- [];
+%% OTP-4518.
lc(Config) when is_list(Config) ->
- ?line check(fun() -> X = 32, [X || X <- [1,2,3]] end,
- "begin X = 32, [X || X <- [1,2,3]] end.",
- [1,2,3]),
- ?line check(fun() -> X = 32,
- [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
- %% "binsize variable" ^
- "begin X = 32,
+ check(fun() -> X = 32, [X || X <- [1,2,3]] end,
+ "begin X = 32, [X || X <- [1,2,3]] end.",
+ [1,2,3]),
+ check(fun() -> X = 32,
+ [X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end,
+ %% "binsize variable" ^
+ "begin X = 32,
[X || <<X:X>> <- [<<1:32>>,<<2:32>>,<<3:8>>]] end.",
[1,2]),
- ?line check(fun() -> Y = 13,[X || {X,Y} <- [{1,2}]] end,
- "begin Y = 13,[X || {X,Y} <- [{1,2}]] end.",
- [1]),
- ?line error_check("begin [A || X <- [{1,2}], 1 == A] end.",
- {unbound_var,'A'}),
- ?line error_check("begin X = 32,
+ check(fun() -> Y = 13,[X || {X,Y} <- [{1,2}]] end,
+ "begin Y = 13,[X || {X,Y} <- [{1,2}]] end.",
+ [1]),
+ error_check("begin [A || X <- [{1,2}], 1 == A] end.",
+ {unbound_var,'A'}),
+ error_check("begin X = 32,
[{Y,W} || X <- [1,2,32,Y=4], Z <- [1,2,W=3]] end.",
{unbound_var,'Y'}),
- ?line error_check("begin X = 32,<<A:B>> = <<100:X>> end.",
- {unbound_var,'B'}),
- ?line check(fun() -> [X || X <- [1,2,3,4], not (X < 2)] end,
- "begin [X || X <- [1,2,3,4], not (X < 2)] end.",
- [2,3,4]),
- ?line check(fun() -> [X || X <- [true,false], X] end,
- "[X || X <- [true,false], X].", [true]),
+ error_check("begin X = 32,<<A:B>> = <<100:X>> end.",
+ {unbound_var,'B'}),
+ check(fun() -> [X || X <- [1,2,3,4], not (X < 2)] end,
+ "begin [X || X <- [1,2,3,4], not (X < 2)] end.",
+ [2,3,4]),
+ check(fun() -> [X || X <- [true,false], X] end,
+ "[X || X <- [true,false], X].", [true]),
ok.
-simple_cases(doc) ->
- ["Simple cases, just to cover some code."];
-simple_cases(suite) ->
- [];
+%% Simple cases, just to cover some code.
simple_cases(Config) when is_list(Config) ->
- ?line check(fun() -> A = $C end, "A = $C.", $C),
- %% ?line check(fun() -> A = 3.14 end, "A = 3.14.", 3.14),
- ?line check(fun() -> self() ! a, A = receive a -> true end end,
- "begin self() ! a, A = receive a -> true end end.",
- true),
- ?line check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
- receive b -> b end,
- {messages, [a,c]} =
- erlang:process_info(self(), messages),
- c:flush() end,
- "begin c:flush(), self() ! a, self() ! b, self() ! c,"
- "receive b -> b end,"
- "{messages, [a,c]} ="
- " erlang:process_info(self(), messages), c:flush() end.",
- ok),
- ?line check(fun() -> self() ! a, A = receive a -> true
- after 0 -> false end end,
- "begin self() ! a, A = receive a -> true"
- " after 0 -> false end end.",
- true),
- ?line check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
- receive b -> b after 0 -> true end,
- {messages, [a,c]} =
- erlang:process_info(self(), messages),
- c:flush() end,
- "begin c:flush(), self() ! a, self() ! b, self() ! c,"
- "receive b -> b after 0 -> true end,"
- "{messages, [a,c]} ="
- " erlang:process_info(self(), messages), c:flush() end.",
- ok),
- ?line check(fun() -> receive _ -> true after 10 -> false end end,
- "receive _ -> true after 10 -> false end.",
- false),
- ?line check(fun() -> F = fun(A) -> A end, true = 3 == F(3) end,
- "begin F = fun(A) -> A end, true = 3 == F(3) end.",
- true),
- ?line check(fun() -> F = fun(A) -> A end, true = 3 == apply(F, [3]) end,
- "begin F = fun(A) -> A end, true = 3 == apply(F,[3]) end.",
- true),
- ?line check(fun() -> catch throw(a) end, "catch throw(a).", a),
- ?line check(fun() -> catch a end, "catch a.", a),
- ?line check(fun() -> 4 == 3 end, "4 == 3.", false),
- ?line check(fun() -> not true end, "not true.", false),
- ?line check(fun() -> -3 end, "-3.", -3),
-
- ?line error_check("3.0 = 4.0.", {badmatch,4.0}),
- ?line check(fun() -> <<(3.0+2.0):32/float>> = <<5.0:32/float>> end,
- "<<(3.0+2.0):32/float>> = <<5.0:32/float>>.",
- <<5.0:32/float>>),
-
- ?line check(fun() -> false andalso kludd end, "false andalso kludd.",
- false),
- ?line check(fun() -> true andalso true end, "true andalso true.",
- true),
- ?line check(fun() -> true andalso false end, "true andalso false.",
- false),
- ?line check(fun() -> true andalso kludd end, "true andalso kludd.",
- kludd),
- ?line error_check("kladd andalso kludd.", {badarg,kladd}),
-
- ?line check(fun() -> if false andalso kludd -> a; true -> b end end,
- "if false andalso kludd -> a; true -> b end.",
- b),
- ?line check(fun() -> if true andalso true -> a; true -> b end end,
- "if true andalso true -> a; true -> b end.",
- a),
- ?line check(fun() -> if true andalso false -> a; true -> b end end,
- "if true andalso false -> a; true -> b end.",
- b),
-
- ?line check(fun() -> true orelse kludd end,
- "true orelse kludd.", true),
- ?line check(fun() -> false orelse false end,
- "false orelse false.", false),
- ?line check(fun() -> false orelse true end,
- "false orelse true.", true),
- ?line check(fun() -> false orelse kludd end,
- "false orelse kludd.", kludd),
- ?line error_check("kladd orelse kludd.", {badarg,kladd}),
- ?line error_check("[X || X <- [1,2,3], begin 1 end].",{bad_filter,1}),
- ?line error_check("[X || X <- a].",{bad_generator,a}),
-
- ?line check(fun() -> if true orelse kludd -> a; true -> b end end,
- "if true orelse kludd -> a; true -> b end.", a),
- ?line check(fun() -> if false orelse false -> a; true -> b end end,
- "if false orelse false -> a; true -> b end.", b),
- ?line check(fun() -> if false orelse true -> a; true -> b end end,
- "if false orelse true -> a; true -> b end.", a),
-
- ?line check(fun() -> [X || X <- [1,2,3], X+2] end,
- "[X || X <- [1,2,3], X+2].", []),
-
- ?line check(fun() -> [X || X <- [1,2,3], [X] == [X || X <- [2]]] end,
- "[X || X <- [1,2,3], [X] == [X || X <- [2]]].",
- [2]),
- ?line check(fun() -> F = fun(1) -> ett; (2) -> zwei end,
- ett = F(1), zwei = F(2) end,
- "begin F = fun(1) -> ett; (2) -> zwei end,
+ check(fun() -> A = $C end, "A = $C.", $C),
+ %% check(fun() -> A = 3.14 end, "A = 3.14.", 3.14),
+ check(fun() -> self() ! a, A = receive a -> true end end,
+ "begin self() ! a, A = receive a -> true end end.",
+ true),
+ check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
+ receive b -> b end,
+ {messages, [a,c]} =
+ erlang:process_info(self(), messages),
+ c:flush() end,
+ "begin c:flush(), self() ! a, self() ! b, self() ! c,"
+ "receive b -> b end,"
+ "{messages, [a,c]} ="
+ " erlang:process_info(self(), messages), c:flush() end.",
+ ok),
+ check(fun() -> self() ! a, A = receive a -> true
+ after 0 -> false end end,
+ "begin self() ! a, A = receive a -> true"
+ " after 0 -> false end end.",
+ true),
+ check(fun() -> c:flush(), self() ! a, self() ! b, self() ! c,
+ receive b -> b after 0 -> true end,
+ {messages, [a,c]} =
+ erlang:process_info(self(), messages),
+ c:flush() end,
+ "begin c:flush(), self() ! a, self() ! b, self() ! c,"
+ "receive b -> b after 0 -> true end,"
+ "{messages, [a,c]} ="
+ " erlang:process_info(self(), messages), c:flush() end.",
+ ok),
+ check(fun() -> receive _ -> true after 10 -> false end end,
+ "receive _ -> true after 10 -> false end.",
+ false),
+ check(fun() -> F = fun(A) -> A end, true = 3 == F(3) end,
+ "begin F = fun(A) -> A end, true = 3 == F(3) end.",
+ true),
+ check(fun() -> F = fun(A) -> A end, true = 3 == apply(F, [3]) end,
+ "begin F = fun(A) -> A end, true = 3 == apply(F,[3]) end.",
+ true),
+ check(fun() -> catch throw(a) end, "catch throw(a).", a),
+ check(fun() -> catch a end, "catch a.", a),
+ check(fun() -> 4 == 3 end, "4 == 3.", false),
+ check(fun() -> not true end, "not true.", false),
+ check(fun() -> -3 end, "-3.", -3),
+
+ error_check("3.0 = 4.0.", {badmatch,4.0}),
+ check(fun() -> <<(3.0+2.0):32/float>> = <<5.0:32/float>> end,
+ "<<(3.0+2.0):32/float>> = <<5.0:32/float>>.",
+ <<5.0:32/float>>),
+
+ check(fun() -> false andalso kludd end, "false andalso kludd.",
+ false),
+ check(fun() -> true andalso true end, "true andalso true.",
+ true),
+ check(fun() -> true andalso false end, "true andalso false.",
+ false),
+ check(fun() -> true andalso kludd end, "true andalso kludd.",
+ kludd),
+ error_check("kladd andalso kludd.", {badarg,kladd}),
+
+ check(fun() -> if false andalso kludd -> a; true -> b end end,
+ "if false andalso kludd -> a; true -> b end.",
+ b),
+ check(fun() -> if true andalso true -> a; true -> b end end,
+ "if true andalso true -> a; true -> b end.",
+ a),
+ check(fun() -> if true andalso false -> a; true -> b end end,
+ "if true andalso false -> a; true -> b end.",
+ b),
+
+ check(fun() -> true orelse kludd end,
+ "true orelse kludd.", true),
+ check(fun() -> false orelse false end,
+ "false orelse false.", false),
+ check(fun() -> false orelse true end,
+ "false orelse true.", true),
+ check(fun() -> false orelse kludd end,
+ "false orelse kludd.", kludd),
+ error_check("kladd orelse kludd.", {badarg,kladd}),
+ error_check("[X || X <- [1,2,3], begin 1 end].",{bad_filter,1}),
+ error_check("[X || X <- a].",{bad_generator,a}),
+
+ check(fun() -> if true orelse kludd -> a; true -> b end end,
+ "if true orelse kludd -> a; true -> b end.", a),
+ check(fun() -> if false orelse false -> a; true -> b end end,
+ "if false orelse false -> a; true -> b end.", b),
+ check(fun() -> if false orelse true -> a; true -> b end end,
+ "if false orelse true -> a; true -> b end.", a),
+
+ check(fun() -> [X || X <- [1,2,3], X+2] end,
+ "[X || X <- [1,2,3], X+2].", []),
+
+ check(fun() -> [X || X <- [1,2,3], [X] == [X || X <- [2]]] end,
+ "[X || X <- [1,2,3], [X] == [X || X <- [2]]].",
+ [2]),
+ check(fun() -> F = fun(1) -> ett; (2) -> zwei end,
+ ett = F(1), zwei = F(2) end,
+ "begin F = fun(1) -> ett; (2) -> zwei end,
ett = F(1), zwei = F(2) end.",
zwei),
- ?line check(fun() -> F = fun(X) when X == 1 -> ett;
- (X) when X == 2 -> zwei end,
- ett = F(1), zwei = F(2) end,
- "begin F = fun(X) when X == 1 -> ett;
+ check(fun() -> F = fun(X) when X == 1 -> ett;
+ (X) when X == 2 -> zwei end,
+ ett = F(1), zwei = F(2) end,
+ "begin F = fun(X) when X == 1 -> ett;
(X) when X == 2 -> zwei end,
- ett = F(1), zwei = F(2) end.",
+ ett = F(1), zwei = F(2) end.",
zwei),
- ?line error_check("begin F = fun(1) -> ett end, zwei = F(2) end.",
- function_clause),
- ?line check(fun() -> if length([1]) == 1 -> yes;
- true -> no end end,
- "if length([1]) == 1 -> yes;
+ error_check("begin F = fun(1) -> ett end, zwei = F(2) end.",
+ function_clause),
+ check(fun() -> if length([1]) == 1 -> yes;
+ true -> no end end,
+ "if length([1]) == 1 -> yes;
true -> no end.",
yes),
- ?line check(fun() -> if is_integer(3) -> true; true -> false end end,
- "if is_integer(3) -> true; true -> false end.", true),
- ?line check(fun() -> if integer(3) -> true; true -> false end end,
- "if integer(3) -> true; true -> false end.", true),
- ?line check(fun() -> if is_float(3) -> true; true -> false end end,
- "if is_float(3) -> true; true -> false end.", false),
- ?line check(fun() -> if float(3) -> true; true -> false end end,
- "if float(3) -> true; true -> false end.", false),
- ?line check(fun() -> if is_number(3) -> true; true -> false end end,
- "if is_number(3) -> true; true -> false end.", true),
- ?line check(fun() -> if number(3) -> true; true -> false end end,
- "if number(3) -> true; true -> false end.", true),
- ?line check(fun() -> if is_atom(a) -> true; true -> false end end,
- "if is_atom(a) -> true; true -> false end.", true),
- ?line check(fun() -> if atom(a) -> true; true -> false end end,
- "if atom(a) -> true; true -> false end.", true),
- ?line check(fun() -> if is_list([]) -> true; true -> false end end,
- "if is_list([]) -> true; true -> false end.", true),
- ?line check(fun() -> if list([]) -> true; true -> false end end,
- "if list([]) -> true; true -> false end.", true),
- ?line check(fun() -> if is_tuple({}) -> true; true -> false end end,
- "if is_tuple({}) -> true; true -> false end.", true),
- ?line check(fun() -> if tuple({}) -> true; true -> false end end,
- "if tuple({}) -> true; true -> false end.", true),
- ?line check(fun() -> if is_pid(self()) -> true; true -> false end end,
- "if is_pid(self()) -> true; true -> false end.", true),
- ?line check(fun() -> if pid(self()) -> true; true -> false end end,
- "if pid(self()) -> true; true -> false end.", true),
- ?line check(fun() -> R = make_ref(), if is_reference(R) -> true;
- true -> false end end,
- "begin R = make_ref(), if is_reference(R) -> true;"
- "true -> false end end.", true),
- ?line check(fun() -> R = make_ref(), if reference(R) -> true;
- true -> false end end,
- "begin R = make_ref(), if reference(R) -> true;"
- "true -> false end end.", true),
- ?line check(fun() -> if is_port(a) -> true; true -> false end end,
- "if is_port(a) -> true; true -> false end.", false),
- ?line check(fun() -> if port(a) -> true; true -> false end end,
- "if port(a) -> true; true -> false end.", false),
- ?line check(fun() -> if is_function(a) -> true; true -> false end end,
- "if is_function(a) -> true; true -> false end.", false),
- ?line check(fun() -> if function(a) -> true; true -> false end end,
- "if function(a) -> true; true -> false end.", false),
- ?line check(fun() -> if is_binary(<<>>) -> true; true -> false end end,
- "if is_binary(<<>>) -> true; true -> false end.", true),
- ?line check(fun() -> if binary(<<>>) -> true; true -> false end end,
- "if binary(<<>>) -> true; true -> false end.", true),
- ?line check(fun() -> if is_integer(a) == true -> yes;
- true -> no end end,
- "if is_integer(a) == true -> yes;
+ check(fun() -> if is_integer(3) -> true; true -> false end end,
+ "if is_integer(3) -> true; true -> false end.", true),
+ check(fun() -> if integer(3) -> true; true -> false end end,
+ "if integer(3) -> true; true -> false end.", true),
+ check(fun() -> if is_float(3) -> true; true -> false end end,
+ "if is_float(3) -> true; true -> false end.", false),
+ check(fun() -> if float(3) -> true; true -> false end end,
+ "if float(3) -> true; true -> false end.", false),
+ check(fun() -> if is_number(3) -> true; true -> false end end,
+ "if is_number(3) -> true; true -> false end.", true),
+ check(fun() -> if number(3) -> true; true -> false end end,
+ "if number(3) -> true; true -> false end.", true),
+ check(fun() -> if is_atom(a) -> true; true -> false end end,
+ "if is_atom(a) -> true; true -> false end.", true),
+ check(fun() -> if atom(a) -> true; true -> false end end,
+ "if atom(a) -> true; true -> false end.", true),
+ check(fun() -> if is_list([]) -> true; true -> false end end,
+ "if is_list([]) -> true; true -> false end.", true),
+ check(fun() -> if list([]) -> true; true -> false end end,
+ "if list([]) -> true; true -> false end.", true),
+ check(fun() -> if is_tuple({}) -> true; true -> false end end,
+ "if is_tuple({}) -> true; true -> false end.", true),
+ check(fun() -> if tuple({}) -> true; true -> false end end,
+ "if tuple({}) -> true; true -> false end.", true),
+ check(fun() -> if is_pid(self()) -> true; true -> false end end,
+ "if is_pid(self()) -> true; true -> false end.", true),
+ check(fun() -> if pid(self()) -> true; true -> false end end,
+ "if pid(self()) -> true; true -> false end.", true),
+ check(fun() -> R = make_ref(), if is_reference(R) -> true;
+ true -> false end end,
+ "begin R = make_ref(), if is_reference(R) -> true;"
+ "true -> false end end.", true),
+ check(fun() -> R = make_ref(), if reference(R) -> true;
+ true -> false end end,
+ "begin R = make_ref(), if reference(R) -> true;"
+ "true -> false end end.", true),
+ check(fun() -> if is_port(a) -> true; true -> false end end,
+ "if is_port(a) -> true; true -> false end.", false),
+ check(fun() -> if port(a) -> true; true -> false end end,
+ "if port(a) -> true; true -> false end.", false),
+ check(fun() -> if is_function(a) -> true; true -> false end end,
+ "if is_function(a) -> true; true -> false end.", false),
+ check(fun() -> if function(a) -> true; true -> false end end,
+ "if function(a) -> true; true -> false end.", false),
+ check(fun() -> if is_binary(<<>>) -> true; true -> false end end,
+ "if is_binary(<<>>) -> true; true -> false end.", true),
+ check(fun() -> if binary(<<>>) -> true; true -> false end end,
+ "if binary(<<>>) -> true; true -> false end.", true),
+ check(fun() -> if is_integer(a) == true -> yes;
+ true -> no end end,
+ "if is_integer(a) == true -> yes;
true -> no end.",
no),
- ?line check(fun() -> if [] -> true; true -> false end end,
- "if [] -> true; true -> false end.", false),
- ?line error_check("if lists:member(1,[1]) -> true; true -> false end.",
- illegal_guard_expr),
- ?line error_check("if false -> true end.", if_clause),
- ?line check(fun() -> if a+b -> true; true -> false end end,
- "if a + b -> true; true -> false end.", false),
- ?line check(fun() -> if + b -> true; true -> false end end,
- "if + b -> true; true -> false end.", false),
- ?line error_check("case foo of bar -> true end.", {case_clause,foo}),
- ?line error_check("case 4 of 2+a -> true; _ -> false end.",
- illegal_pattern),
- ?line error_check("case 4 of +a -> true; _ -> false end.",
- illegal_pattern),
- ?line check(fun() -> case a of
- X when X == b -> one;
- X when X == a -> two
- end end,
- "begin case a of
+ check(fun() -> if [] -> true; true -> false end end,
+ "if [] -> true; true -> false end.", false),
+ error_check("if lists:member(1,[1]) -> true; true -> false end.",
+ illegal_guard_expr),
+ error_check("if false -> true end.", if_clause),
+ check(fun() -> if a+b -> true; true -> false end end,
+ "if a + b -> true; true -> false end.", false),
+ check(fun() -> if + b -> true; true -> false end end,
+ "if + b -> true; true -> false end.", false),
+ error_check("case foo of bar -> true end.", {case_clause,foo}),
+ error_check("case 4 of 2+a -> true; _ -> false end.",
+ illegal_pattern),
+ error_check("case 4 of +a -> true; _ -> false end.",
+ illegal_pattern),
+ check(fun() -> case a of
+ X when X == b -> one;
+ X when X == a -> two
+ end end,
+ "begin case a of
X when X == b -> one;
- X when X == a -> two
- end end.", two),
- ?line error_check("3 = 4.", {badmatch,4}),
- ?line error_check("a = 3.", {badmatch,3}),
- %% ?line error_check("3.1 = 2.7.",{badmatch,2.7}),
- ?line error_check("$c = 4.", {badmatch,4}),
- ?line check(fun() -> $c = $c end, "$c = $c.", $c),
- ?line check(fun() -> _ = bar end, "_ = bar.", bar),
- ?line check(fun() -> A = 14, A = 14 end,
+ X when X == a -> two
+ end end.", two),
+ error_check("3 = 4.", {badmatch,4}),
+ error_check("a = 3.", {badmatch,3}),
+ %% error_check("3.1 = 2.7.",{badmatch,2.7}),
+ error_check("$c = 4.", {badmatch,4}),
+ check(fun() -> $c = $c end, "$c = $c.", $c),
+ check(fun() -> _ = bar end, "_ = bar.", bar),
+ check(fun() -> A = 14, A = 14 end,
"begin A = 14, A = 14 end.", 14),
- ?line error_check("begin A = 14, A = 16 end.", {badmatch,16}),
- ?line error_check("\"hej\" = \"san\".", {badmatch,"san"}),
- ?line check(fun() -> "hej" = "hej" end,
+ error_check("begin A = 14, A = 16 end.", {badmatch,16}),
+ error_check("\"hej\" = \"san\".", {badmatch,"san"}),
+ check(fun() -> "hej" = "hej" end,
"\"hej\" = \"hej\".", "hej"),
- ?line error_check("[] = [a].", {badmatch,[a]}),
- ?line check(fun() -> [] = [] end, "[] = [].", []),
- ?line error_check("[a] = [].", {badmatch,[]}),
- ?line error_check("{a,b} = 34.", {badmatch,34}),
- ?line check(fun() -> <<X:7>> = <<8:7>>, X end,
+ error_check("[] = [a].", {badmatch,[a]}),
+ check(fun() -> [] = [] end, "[] = [].", []),
+ error_check("[a] = [].", {badmatch,[]}),
+ error_check("{a,b} = 34.", {badmatch,34}),
+ check(fun() -> <<X:7>> = <<8:7>>, X end,
"begin <<X:7>> = <<8:7>>, X end.", 8),
- ?line error_check("<<34:32>> = \"hej\".", {badmatch,"hej"}),
- ?line check(fun() -> trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end,
+ error_check("<<34:32>> = \"hej\".", {badmatch,"hej"}),
+ check(fun() -> trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end,
"begin trunc((1 * 3 div 3 + 4 - 3) / 1) rem 2 end.", 0),
- ?line check(fun() -> (2#101 band 2#10101) bor (2#110 bxor 2#010) end,
+ check(fun() -> (2#101 band 2#10101) bor (2#110 bxor 2#010) end,
"(2#101 band 2#10101) bor (2#110 bxor 2#010).", 5),
- ?line check(fun() -> (2#1 bsl 4) + (2#10000 bsr 3) end,
+ check(fun() -> (2#1 bsl 4) + (2#10000 bsr 3) end,
"(2#1 bsl 4) + (2#10000 bsr 3).", 18),
- ?line check(fun() -> ((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2) end,
+ check(fun() -> ((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2) end,
"((1<3) and ((1 =:= 2) or (1 =/= 2))) xor (1=<2).", false),
- ?line check(fun() -> (a /= b) or (2 > 4) or (3 >= 3) end,
+ check(fun() -> (a /= b) or (2 > 4) or (3 >= 3) end,
"(a /= b) or (2 > 4) or (3 >= 3).", true),
- ?line check(fun() -> "hej" ++ "san" =/= "hejsan" -- "san" end,
+ check(fun() -> "hej" ++ "san" =/= "hejsan" -- "san" end,
"\"hej\" ++ \"san\" =/= \"hejsan\" -- \"san\".", true),
- ?line check(fun() -> (bnot 1) < -0 end, "(bnot (+1)) < -0.", true),
- ok.
+ check(fun() -> (bnot 1) < -0 end, "(bnot (+1)) < -0.", true),
+ ok.
-unary_plus(doc) ->
- ["OTP-4929. Unary plus rejects non-numbers."];
-unary_plus(suite) ->
- [];
+%% OTP-4929. Unary plus rejects non-numbers.
unary_plus(Config) when is_list(Config) ->
- ?line check(fun() -> F = fun(X) -> + X end,
- true = -1 == F(-1) end,
- "begin F = fun(X) -> + X end,"
- " true = -1 == F(-1) end.", true, ['F'], none, none),
- ?line error_check("+a.", badarith),
+ check(fun() -> F = fun(X) -> + X end,
+ true = -1 == F(-1) end,
+ "begin F = fun(X) -> + X end,"
+ " true = -1 == F(-1) end.", true, ['F'], none, none),
+ error_check("+a.", badarith),
ok.
-apply_atom(doc) ->
- ["OTP-5064. Can no longer apply atoms."];
-apply_atom(suite) ->
- [];
+%% OTP-5064. Can no longer apply atoms.
apply_atom(Config) when is_list(Config) ->
- ?line error_check("[X || X <- [[1],[2]],
+ error_check("[X || X <- [[1],[2]],
begin L = length, L(X) =:= 1 end].",
{badfun,length}),
ok.
-otp_5269(doc) ->
- ["OTP-5269. Bugs in the bit syntax."];
-otp_5269(suite) ->
- [];
+%% OTP-5269. Bugs in the bit syntax.
otp_5269(Config) when is_list(Config) ->
- ?line check(fun() -> L = 8,
+ check(fun() -> L = 8,
F = fun(<<A:L,B:A>>) -> B end,
F(<<16:8, 7:16>>)
end,
@@ -542,7 +489,7 @@ otp_5269(Config) when is_list(Config) ->
L = 8, F = fun(<<A:L,B:A>>) -> B end, F(<<16:8, 7:16>>)
end.",
7),
- ?line check(fun() -> L = 8,
+ check(fun() -> L = 8,
F = fun(<<L:L,B:L>>) -> B end,
F(<<16:8, 7:16>>)
end,
@@ -550,24 +497,24 @@ otp_5269(Config) when is_list(Config) ->
L = 8, F = fun(<<L:L,B:L>>) -> B end, F(<<16:8, 7:16>>)
end.",
7),
- ?line check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end,
+ check(fun() -> L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end,
"begin L = 8, <<A:L,B:A>> = <<16:8, 7:16>>, B end.",
7),
- ?line error_check("begin L = 8, <<L:L,B:L>> = <<16:8, 7:16>> end.",
+ error_check("begin L = 8, <<L:L,B:L>> = <<16:8, 7:16>> end.",
{badmatch,<<16:8,7:16>>}),
- ?line error_check("begin <<L:16,L:L>> = <<16:16,8:16>>, L end.",
+ error_check("begin <<L:16,L:L>> = <<16:16,8:16>>, L end.",
{badmatch, <<16:16,8:16>>}),
- ?line check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end,
+ check(fun() -> U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end,
"begin U = 8, (fun(<<U:U>>) -> U end)(<<32:8>>) end.",
32),
- ?line check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end,
+ check(fun() -> U = 8, [U || <<U:U>> <- [<<32:8>>]] end,
"begin U = 8, [U || <<U:U>> <- [<<32:8>>]] end.",
[32]),
- ?line error_check("(fun({3,<<A:32,A:32>>}) -> a end)
+ error_check("(fun({3,<<A:32,A:32>>}) -> a end)
({3,<<17:32,19:32>>}).",
function_clause),
- ?line check(fun() -> [X || <<A:8,
+ check(fun() -> [X || <<A:8,
B:A>> <- [<<16:8,19:16>>],
<<X:8>> <- [<<B:8>>]] end,
"[X || <<A:8,
@@ -576,12 +523,9 @@ otp_5269(Config) when is_list(Config) ->
[19]),
ok.
-otp_6539(doc) ->
- ["OTP-6539. try/catch bugs."];
-otp_6539(suite) ->
- [];
+%% OTP-6539. try/catch bugs.
otp_6539(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
F = fun(A,B) ->
try A+B
catch _:_ -> dontthinkso
@@ -600,152 +544,149 @@ otp_6539(Config) when is_list(Config) ->
[3, 5]),
ok.
-otp_6543(doc) ->
- ["OTP-6543. bitlevel binaries."];
-otp_6543(suite) ->
- [];
+%% OTP-6543. bitlevel binaries.
otp_6543(Config) when is_list(Config) ->
- ?line check(fun() ->
+ check(fun() ->
<< <<X>> || <<X>> <- [1,2,3] >>
end,
"<< <<X>> || <<X>> <- [1,2,3] >>.",
<<>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X>> || X <- [1,2,3] >>
end,
"<< <<X>> || X <- [1,2,3] >>.",
<<1,2,3>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X:8>> || <<X:2>> <= <<"hej">> >>
end,
"<< <<X:8>> || <<X:2>> <= <<\"hej\">> >>.",
<<1,2,2,0,1,2,1,1,1,2,2,2>>),
- ?line check(fun() ->
+ check(fun() ->
<< <<X:8>> ||
<<65,X:4>> <= <<65,7:4,65,3:4,66,8:4>> >>
end,
"<< <<X:8>> ||
<<65,X:4>> <= <<65,7:4,65,3:4,66,8:4>> >>.",
<<7,3>>),
- ?line check(fun() -> <<34:18/big>> end,
+ check(fun() -> <<34:18/big>> end,
"<<34:18/big>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/big-unit:2>> end,
+ check(fun() -> <<34:18/big-unit:2>> end,
"<<34:18/big-unit:2>>.",
<<0,0,0,2,2:4>>),
- ?line check(fun() -> <<34:18/little>> end,
+ check(fun() -> <<34:18/little>> end,
"<<34:18/little>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native>>.") of
+ case eval_string("<<34:18/native>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<34:18/big-signed>> end,
+ check(fun() -> <<34:18/big-signed>> end,
"<<34:18/big-signed>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/little-signed>> end,
+ check(fun() -> <<34:18/little-signed>> end,
"<<34:18/little-signed>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native-signed>>.") of
+ case eval_string("<<34:18/native-signed>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<34:18/big-unsigned>> end,
+ check(fun() -> <<34:18/big-unsigned>> end,
"<<34:18/big-unsigned>>.",
<<0,8,2:2>>),
- ?line check(fun() -> <<34:18/little-unsigned>> end,
+ check(fun() -> <<34:18/little-unsigned>> end,
"<<34:18/little-unsigned>>.",
<<34,0,0:2>>),
- ?line case eval_string("<<34:18/native-unsigned>>.") of
+ case eval_string("<<34:18/native-unsigned>>.") of
<<0,8,2:2>> -> ok;
<<34,0,0:2>> -> ok
end,
- ?line check(fun() -> <<3.14:32/float-big>> end,
+ check(fun() -> <<3.14:32/float-big>> end,
"<<3.14:32/float-big>>.",
<<64,72,245,195>>),
- ?line check(fun() -> <<3.14:32/float-little>> end,
+ check(fun() -> <<3.14:32/float-little>> end,
"<<3.14:32/float-little>>.",
<<195,245,72,64>>),
- ?line case eval_string("<<3.14:32/float-native>>.") of
+ case eval_string("<<3.14:32/float-native>>.") of
<<64,72,245,195>> -> ok;
<<195,245,72,64>> -> ok
end,
- ?line error_check("<<(<<17,3:2>>)/binary>>.", badarg),
- ?line check(fun() -> <<(<<17,3:2>>)/bitstring>> end,
+ error_check("<<(<<17,3:2>>)/binary>>.", badarg),
+ check(fun() -> <<(<<17,3:2>>)/bitstring>> end,
"<<(<<17,3:2>>)/bitstring>>.",
<<17,3:2>>),
- ?line check(fun() -> <<(<<17,3:2>>):10/bitstring>> end,
+ check(fun() -> <<(<<17,3:2>>):10/bitstring>> end,
"<<(<<17,3:2>>):10/bitstring>>.",
<<17,3:2>>),
- ?line check(fun() -> <<<<344:17>>/binary-unit:17>> end,
+ check(fun() -> <<<<344:17>>/binary-unit:17>> end,
"<<<<344:17>>/binary-unit:17>>.",
<<344:17>>),
- ?line check(fun() -> <<X:18/big>> = <<34:18/big>>, X end,
+ check(fun() -> <<X:18/big>> = <<34:18/big>>, X end,
"begin <<X:18/big>> = <<34:18/big>>, X end.",
34),
- ?line check(fun() -> <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end,
+ check(fun() -> <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end,
"begin <<X:18/big-unit:2>> = <<34:18/big-unit:2>>, X end.",
34),
- ?line check(fun() -> <<X:18/little>> = <<34:18/little>>, X end,
+ check(fun() -> <<X:18/little>> = <<34:18/little>>, X end,
"begin <<X:18/little>> = <<34:18/little>>, X end.",
34),
- ?line check(fun() -> <<X:18/native>> = <<34:18/native>>, X end,
+ check(fun() -> <<X:18/native>> = <<34:18/native>>, X end,
"begin <<X:18/native>> = <<34:18/native>>, X end.",
34),
- ?line check(fun() -> <<X:18/big-signed>> = <<34:18/big-signed>>, X end,
+ check(fun() -> <<X:18/big-signed>> = <<34:18/big-signed>>, X end,
"begin <<X:18/big-signed>> = <<34:18/big-signed>>, X end.",
34),
- ?line check(fun() -> <<X:18/little-signed>> = <<34:18/little-signed>>,
+ check(fun() -> <<X:18/little-signed>> = <<34:18/little-signed>>,
X end,
"begin <<X:18/little-signed>> = <<34:18/little-signed>>,
X end.",
34),
- ?line check(fun() -> <<X:18/native-signed>> = <<34:18/native-signed>>,
+ check(fun() -> <<X:18/native-signed>> = <<34:18/native-signed>>,
X end,
"begin <<X:18/native-signed>> = <<34:18/native-signed>>,
X end.",
34),
- ?line check(fun() -> <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
+ check(fun() -> <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
X end,
"begin <<X:18/big-unsigned>> = <<34:18/big-unsigned>>,
X end.",
34),
- ?line check(fun() ->
+ check(fun() ->
<<X:18/little-unsigned>> = <<34:18/little-unsigned>>,
X end,
"begin <<X:18/little-unsigned>> = <<34:18/little-unsigned>>,
X end.",
34),
- ?line check(fun() ->
+ check(fun() ->
<<X:18/native-unsigned>> = <<34:18/native-unsigned>>,
X end,
"begin <<X:18/native-unsigned>> = <<34:18/native-unsigned>>,
X end.",
34),
- ?line check(fun() -> <<X:32/float-big>> = <<2.0:32/float-big>>, X end,
+ check(fun() -> <<X:32/float-big>> = <<2.0:32/float-big>>, X end,
"begin <<X:32/float-big>> = <<2.0:32/float-big>>,
X end.",
2.0),
- ?line check(fun() -> <<X:32/float-little>> = <<2.0:32/float-little>>,
+ check(fun() -> <<X:32/float-little>> = <<2.0:32/float-little>>,
X end,
"begin <<X:32/float-little>> = <<2.0:32/float-little>>,
X end.",
2.0),
- ?line check(fun() -> <<X:32/float-native>> = <<2.0:32/float-native>>,
+ check(fun() -> <<X:32/float-native>> = <<2.0:32/float-native>>,
X end,
"begin <<X:32/float-native>> = <<2.0:32/float-native>>,
X end.",
2.0),
- ?line check(
+ check(
fun() ->
[X || <<"hej",X:8>> <= <<"hej",8,"san",9,"hej",17,"hej">>]
end,
"[X || <<\"hej\",X:8>> <=
<<\"hej\",8,\"san\",9,\"hej\",17,\"hej\">>].",
[8,17]),
- ?line check(
+ check(
fun() ->
L = 8, << <<B:32>> || <<L:L,B:L>> <= <<16:8, 7:16>> >>
end,
@@ -754,41 +695,41 @@ otp_6543(Config) when is_list(Config) ->
<<0,0,0,7>>),
%% Test the Value part of a binary segment.
%% "Old" bugs have been fixed (partial_eval is called on Value).
- ?line check(fun() -> [ 3 || <<17/float>> <= <<17.0/float>>] end,
+ check(fun() -> [ 3 || <<17/float>> <= <<17.0/float>>] end,
"[ 3 || <<17/float>> <= <<17.0/float>>].",
[3]),
- ?line check(fun() -> [ 3 || <<17/float>> <- [<<17.0/float>>]] end,
+ check(fun() -> [ 3 || <<17/float>> <- [<<17.0/float>>]] end,
"[ 3 || <<17/float>> <- [<<17.0/float>>]].",
[3]),
- ?line check(fun() -> [ X || <<17/float,X:3>> <= <<17.0/float,2:3>>] end,
+ check(fun() -> [ X || <<17/float,X:3>> <= <<17.0/float,2:3>>] end,
"[ X || <<17/float,X:3>> <= <<17.0/float,2:3>>].",
[2]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1023)/float>> <= <<(1 bsl 1023)/float>>]
end,
"[ foo || <<(1 bsl 1023)/float>> <= <<(1 bsl 1023)/float>>].",
[foo]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1023)/float>> <- [<<(1 bsl 1023)/float>>]]
end,
"[ foo || <<(1 bsl 1023)/float>> <- [<<(1 bsl 1023)/float>>]].",
[foo]),
- ?line error_check("[ foo || <<(1 bsl 1024)/float>> <-
+ error_check("[ foo || <<(1 bsl 1024)/float>> <-
[<<(1 bsl 1024)/float>>]].",
badarg),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1024)/float>> <- [<<(1 bsl 1023)/float>>]]
end,
"[ foo || <<(1 bsl 1024)/float>> <-
[<<(1 bsl 1023)/float>>]].",
[]),
- ?line check(fun() ->
+ check(fun() ->
[ foo || <<(1 bsl 1024)/float>> <= <<(1 bsl 1023)/float>>]
end,
"[ foo || <<(1 bsl 1024)/float>> <=
<<(1 bsl 1023)/float>>].",
[]),
- ?line check(fun() ->
+ check(fun() ->
L = 8,
[{L,B} || <<L:L,B:L/float>> <= <<32:8,7:32/float>>]
end,
@@ -796,7 +737,7 @@ otp_6543(Config) when is_list(Config) ->
[{L,B} || <<L:L,B:L/float>> <= <<32:8,7:32/float>>]
end.",
[{32,7.0}]),
- ?line check(fun() ->
+ check(fun() ->
L = 8,
[{L,B} || <<L:L,B:L/float>> <- [<<32:8,7:32/float>>]]
end,
@@ -804,127 +745,117 @@ otp_6543(Config) when is_list(Config) ->
[{L,B} || <<L:L,B:L/float>> <- [<<32:8,7:32/float>>]]
end.",
[{32,7.0}]),
- ?line check(fun() ->
+ check(fun() ->
[foo || <<"s">> <= <<"st">>]
end,
"[foo || <<\"s\">> <= <<\"st\">>].",
[foo]),
- ?line check(fun() -> <<_:32>> = <<17:32>> end,
+ check(fun() -> <<_:32>> = <<17:32>> end,
"<<_:32>> = <<17:32>>.",
<<17:32>>),
- ?line check(fun() -> [foo || <<_:32>> <= <<17:32,20:32>>] end,
+ check(fun() -> [foo || <<_:32>> <= <<17:32,20:32>>] end,
"[foo || <<_:32>> <= <<17:32,20:32>>].",
[foo,foo]),
- ?line check(fun() -> << <<X:32>> || X <- [1,2,3], X > 1 >> end,
+ check(fun() -> << <<X:32>> || X <- [1,2,3], X > 1 >> end,
"<< <<X:32>> || X <- [1,2,3], X > 1 >>.",
<<0,0,0,2,0,0,0,3>>),
- ?line error_check("[X || <<X>> <= [a,b]].",{bad_generator,[a,b]}),
+ error_check("[X || <<X>> <= [a,b]].",{bad_generator,[a,b]}),
ok.
-otp_6787(doc) ->
- ["OTP-6787. bitlevel binaries."];
-otp_6787(suite) ->
- [];
+%% OTP-6787. bitlevel binaries.
otp_6787(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() -> <<16:(1024*1024)>> = <<16:(1024*1024)>> end,
"<<16:(1024*1024)>> = <<16:(1024*1024)>>.",
<<16:1048576>>),
ok.
-otp_6977(doc) ->
- ["OTP-6977. ++ bug."];
-otp_6977(suite) ->
- [];
+%% OTP-6977. ++ bug.
otp_6977(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() -> (fun([$X] ++ _) -> ok end)("X") end,
"(fun([$X] ++ _) -> ok end)(\"X\").",
ok),
ok.
-otp_7550(doc) ->
- ["OTP-7550. Support for UTF-8, UTF-16, UTF-32."];
+%% OTP-7550. Support for UTF-8, UTF-16, UTF-32.
otp_7550(Config) when is_list(Config) ->
%% UTF-8.
- ?line check(
+ check(
fun() -> <<65>> = <<65/utf8>> end,
"<<65>> = <<65/utf8>>.",
<<65>>),
- ?line check(
+ check(
fun() -> <<350/utf8>> = <<197,158>> end,
"<<350/utf8>> = <<197,158>>.",
<<197,158>>),
- ?line check(
+ check(
fun() -> <<$b,$j,$\303,$\266,$r,$n>> = <<"bj\366rn"/utf8>> end,
"<<$b,$j,$\303,$\266,$r,$n>> = <<\"bj\366rn\"/utf8>>.",
<<$b,$j,$\303,$\266,$r,$n>>),
%% UTF-16.
- ?line check(
+ check(
fun() -> <<0,65>> = <<65/utf16>> end,
"<<0,65>> = <<65/utf16>>.",
<<0,65>>),
- ?line check(
+ check(
fun() -> <<16#D8,16#08,16#DF,16#45>> = <<16#12345/utf16>> end,
"<<16#D8,16#08,16#DF,16#45>> = <<16#12345/utf16>>.",
<<16#D8,16#08,16#DF,16#45>>),
- ?line check(
+ check(
fun() -> <<16#08,16#D8,16#45,16#DF>> = <<16#12345/little-utf16>> end,
"<<16#08,16#D8,16#45,16#DF>> = <<16#12345/little-utf16>>.",
<<16#08,16#D8,16#45,16#DF>>),
- ?line check(
+ check(
fun() -> <<350/utf16>> = <<1,94>> end,
"<<350/utf16>> = <<1,94>>.",
<<1,94>>),
- ?line check(
+ check(
fun() -> <<350/little-utf16>> = <<94,1>> end,
"<<350/little-utf16>> = <<94,1>>.",
<<94,1>>),
- ?line check(
+ check(
fun() -> <<16#12345/utf16>> = <<16#D8,16#08,16#DF,16#45>> end,
"<<16#12345/utf16>> = <<16#D8,16#08,16#DF,16#45>>.",
<<16#D8,16#08,16#DF,16#45>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf16>> = <<16#08,16#D8,16#45,16#DF>> end,
"<<16#12345/little-utf16>> = <<16#08,16#D8,16#45,16#DF>>.",
<<16#08,16#D8,16#45,16#DF>>),
%% UTF-32.
- ?line check(
+ check(
fun() -> <<16#12345/utf32>> = <<16#0,16#01,16#23,16#45>> end,
"<<16#12345/utf32>> = <<16#0,16#01,16#23,16#45>>.",
<<16#0,16#01,16#23,16#45>>),
- ?line check(
+ check(
fun() -> <<16#0,16#01,16#23,16#45>> = <<16#12345/utf32>> end,
"<<16#0,16#01,16#23,16#45>> = <<16#12345/utf32>>.",
<<16#0,16#01,16#23,16#45>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf32>> = <<16#45,16#23,16#01,16#00>> end,
"<<16#12345/little-utf32>> = <<16#45,16#23,16#01,16#00>>.",
<<16#45,16#23,16#01,16#00>>),
- ?line check(
+ check(
fun() -> <<16#12345/little-utf32>> end,
"<<16#12345/little-utf32>>.",
<<16#45,16#23,16#01,16#00>>),
%% Mixed.
- ?line check(
+ check(
fun() -> <<16#41,16#12345/utf32,16#0391:16,16#2E:8>> end,
"<<16#41,16#12345/utf32,16#0391:16,16#2E:8>>.",
<<16#41,16#00,16#01,16#23,16#45,16#03,16#91,16#2E>>),
ok.
-otp_8133(doc) ->
- ["OTP-8133. Bit comprehension bug."];
-otp_8133(suite) ->
- [];
+%% OTP-8133. Bit comprehension bug.
otp_8133(Config) when is_list(Config) ->
- ?line check(
+ check(
fun() ->
E = fun(N) ->
if
@@ -947,7 +878,7 @@ otp_8133(Config) when is_list(Config) ->
end
end.",
ok),
- ?line check(
+ check(
fun() ->
E = fun(N) ->
if
@@ -972,44 +903,41 @@ otp_8133(Config) when is_list(Config) ->
ok),
ok.
-funs(doc) ->
- ["Simple cases, just to cover some code."];
-funs(suite) ->
- [];
+%% Simple cases, just to cover some code.
funs(Config) when is_list(Config) ->
do_funs(none, none),
do_funs(lfh(), none),
do_funs(lfh(), efh()),
- ?line error_check("nix:foo().", {access_not_allowed,nix}, lfh(), efh()),
- ?line error_check("bar().", undef, none, none),
+ error_check("nix:foo().", {access_not_allowed,nix}, lfh(), efh()),
+ error_check("bar().", undef, none, none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh_value(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], lfh_value_extra(), none),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
"begin F1 = fun(F,N) -> count_down(F, N) end,"
"F1(F1,1000) end.",
0, ['F1'], {?MODULE,local_func_value}, none),
%% This is not documented, and only for backward compatibility (good!).
B0 = erl_eval:new_bindings(),
- ?line check(fun() -> is_function(?MODULE:count_down_fun()) end,
+ check(fun() -> is_function(?MODULE:count_down_fun()) end,
"begin is_function(count_down_fun()) end.",
true, [], {?MODULE,local_func,[B0]},none),
@@ -1017,16 +945,16 @@ funs(Config) when is_list(Config) ->
({M,F}, As) -> apply(M, F, As)
end,
EFH = {value, EF},
- ?line error_check("apply(timer, sleep, [1]).", got_it, none, EFH),
- ?line error_check("begin F = fun(T) -> timer:sleep(T) end,F(1) end.",
+ error_check("apply(timer, sleep, [1]).", got_it, none, EFH),
+ error_check("begin F = fun(T) -> timer:sleep(T) end,F(1) end.",
got_it, none, EFH),
- ?line error_check("fun c/1.", undef),
- ?line error_check("fun a:b/0().", undef),
+ error_check("fun c/1.", undef),
+ error_check("fun a:b/0().", undef),
MaxArgs = 20,
- ?line [true] =
+ [true] =
lists:usort([run_many_args(SAs) || SAs <- many_args(MaxArgs)]),
- ?line {'EXIT',{{argument_limit,_},_}} =
+ {'EXIT',{{argument_limit,_},_}} =
(catch run_many_args(many_args1(MaxArgs+1))),
ok.
@@ -1053,17 +981,17 @@ do_funs(LFH, EFH) ->
%% manually with 1000 replaced by 1000000.
M = atom_to_list(?MODULE),
- ?line check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
+ check(fun() -> F1 = fun(F,N) -> ?MODULE:count_down(F, N) end,
F1(F1, 1000) end,
concat(["begin F1 = fun(F,N) -> ", M,
":count_down(F, N) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line check(fun() -> F1 = fun(F,N) -> apply(?MODULE,count_down,[F,N])
+ check(fun() -> F1 = fun(F,N) -> apply(?MODULE,count_down,[F,N])
end, F1(F1, 1000) end,
concat(["begin F1 = fun(F,N) -> apply(", M,
",count_down,[F, N]) end, F1(F1,1000) end."]),
0, ['F1'], LFH, EFH),
- ?line check(fun() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
+ check(fun() -> F = fun(F,N) when N > 0 -> apply(F,[F,N-1]);
(_F,0) -> ok end,
F(F, 1000)
end,
@@ -1071,7 +999,7 @@ do_funs(LFH, EFH) ->
"(_F,0) -> ok end,"
"F(F, 1000) end.",
ok, ['F'], LFH, EFH),
- ?line check(fun() -> F = fun(F,N) when N > 0 ->
+ check(fun() -> F = fun(F,N) when N > 0 ->
apply(erlang,apply,[F,[F,N-1]]);
(_F,0) -> ok end,
F(F, 1000)
@@ -1081,7 +1009,7 @@ do_funs(LFH, EFH) ->
"(_F,0) -> ok end,"
"F(F, 1000) end.",
ok, ['F'], LFH, EFH),
- ?line check(fun() -> F = count_down_fun(),
+ check(fun() -> F = count_down_fun(),
SF = fun(SF, F1, N) -> F(SF, F1, N) end,
SF(SF, F, 1000) end,
concat(["begin F = ", M, ":count_down_fun(),"
@@ -1090,17 +1018,17 @@ do_funs(LFH, EFH) ->
ok, ['F','SF'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> A = 1+X, {X,A} end,
+ check(fun() -> F = fun(X) -> A = 1+X, {X,A} end,
true = {2,3} == F(2) end,
"begin F = fun(X) -> A = 1+X, {X,A} end,
true = {2,3} == F(2) end.", true, ['F'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> byte_size(X) end,
+ check(fun() -> F = fun(X) -> byte_size(X) end,
?MODULE:do_apply(F,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
M,":do_apply(F,<<\"hej\">>) end."]),
3, ['F'], LFH, EFH),
- ?line check(fun() -> F1 = fun(X, Z) -> {X,Z} end,
+ check(fun() -> F1 = fun(X, Z) -> {X,Z} end,
Z = 5,
F2 = fun(X, Y) -> F1(Z,{X,Y}) end,
F3 = fun(X, Y) -> {a,F1(Z,{X,Y})} end,
@@ -1117,26 +1045,26 @@ do_funs(LFH, EFH) ->
{5,{5,y}} = F2(Z,y),
true = {5,{x,5}} == F2(x,Z) end.",
true, ['F1','Z','F2','F3'], LFH, EFH),
- ?line check(fun() -> F = fun(X) -> byte_size(X) end,
+ check(fun() -> F = fun(X) -> byte_size(X) end,
F2 = fun(Y) -> F(Y) end,
?MODULE:do_apply(F2,<<"hej">>) end,
concat(["begin F = fun(X) -> size(X) end,",
"F2 = fun(Y) -> F(Y) end,",
M,":do_apply(F2,<<\"hej\">>) end."]),
3, ['F','F2'], LFH, EFH),
- ?line check(fun() -> Z = 5, F = fun(X) -> {Z,X} end,
+ check(fun() -> Z = 5, F = fun(X) -> {Z,X} end,
F2 = fun(Z) -> F(Z) end, F2(3) end,
"begin Z = 5, F = fun(X) -> {Z,X} end,
F2 = fun(Z) -> F(Z) end, F2(3) end.",
{5,3},['F','F2','Z'], LFH, EFH),
- ?line check(fun() -> F = fun(Z) -> Z end,
+ check(fun() -> F = fun(Z) -> Z end,
F2 = fun(X) -> F(X), Z = {X,X}, Z end,
{1,1} = F2(1), Z = 7, Z end,
"begin F = fun(Z) -> Z end,
F2 = fun(X) -> F(X), Z = {X,X}, Z end,
{1,1} = F2(1), Z = 7, Z end.", 7, ['F','F2','Z'],
LFH, EFH),
- ?line check(fun() -> F = fun(F, N) -> [?MODULE:count_down(F,N) || X <-[1]]
+ check(fun() -> F = fun(F, N) -> [?MODULE:count_down(F,N) || X <-[1]]
end, F(F,2) end,
concat(["begin F = fun(F, N) -> [", M,
":count_down(F,N) || X <-[1]] end, F(F,2) end."]),
@@ -1195,45 +1123,42 @@ external_func({M,F}, As) ->
-try_catch(doc) ->
- ["Test try-of-catch-after-end statement"];
-try_catch(suite) ->
- [];
+%% Test try-of-catch-after-end statement.
try_catch(Config) when is_list(Config) ->
%% Match in of with catch
- ?line check(fun() -> try 1 of 1 -> 2 catch _:_ -> 3 end end,
+ check(fun() -> try 1 of 1 -> 2 catch _:_ -> 3 end end,
"try 1 of 1 -> 2 catch _:_ -> 3 end.", 2),
- ?line check(fun() -> try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
+ check(fun() -> try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
"try 1 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end.", 2),
- ?line check(fun() -> try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
+ check(fun() -> try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end end,
"try 3 of 1 -> 2; 3 -> 4 catch _:_ -> 5 end.", 4),
%% Just after
- ?line check(fun () -> X = try 1 after put(try_catch, 2) end,
+ check(fun () -> X = try 1 after put(try_catch, 2) end,
{X,get(try_catch)} end,
"begin X = try 1 after put(try_catch, 2) end, "
"{X,get(try_catch)} end.", {1,2}),
%% Match in of with after
- ?line check(fun() -> X = try 1 of 1 -> 2 after put(try_catch, 3) end,
+ check(fun() -> X = try 1 of 1 -> 2 after put(try_catch, 3) end,
{X,get(try_catch)} end,
"begin X = try 1 of 1 -> 2 after put(try_catch, 3) end, "
"{X,get(try_catch)} end.", {2,3}),
- ?line check(fun() -> X = try 1 of 1 -> 2; 3 -> 4
+ check(fun() -> X = try 1 of 1 -> 2; 3 -> 4
after put(try_catch, 5) end,
{X,get(try_catch)} end,
"begin X = try 1 of 1 -> 2; 3 -> 4 "
" after put(try_catch, 5) end, "
" {X,get(try_catch)} end.", {2,5}),
- ?line check(fun() -> X = try 3 of 1 -> 2; 3 -> 4
+ check(fun() -> X = try 3 of 1 -> 2; 3 -> 4
after put(try_catch, 5) end,
{X,get(try_catch)} end,
"begin X = try 3 of 1 -> 2; 3 -> 4 "
" after put(try_catch, 5) end, "
" {X,get(try_catch)} end.", {4,5}),
%% Nomatch in of
- ?line error_check("try 1 of 2 -> 3 catch _:_ -> 4 end.",
+ error_check("try 1 of 2 -> 3 catch _:_ -> 4 end.",
{try_clause,1}),
%% Nomatch in of with after
- ?line check(fun () -> {'EXIT',{{try_clause,1},_}} =
+ check(fun () -> {'EXIT',{{try_clause,1},_}} =
begin catch try 1 of 2 -> 3
after put(try_catch, 4) end end,
get(try_catch) end,
@@ -1242,14 +1167,14 @@ try_catch(Config) when is_list(Config) ->
" after put(try_catch, 4) end end, "
" get(try_catch) end. ", 4),
%% Exception in try
- ?line check(fun () -> try 1=2 catch error:{badmatch,2} -> 3 end end,
+ check(fun () -> try 1=2 catch error:{badmatch,2} -> 3 end end,
"try 1=2 catch error:{badmatch,2} -> 3 end.", 3),
- ?line check(fun () -> try 1=2 of 3 -> 4
+ check(fun () -> try 1=2 of 3 -> 4
catch error:{badmatch,2} -> 5 end end,
"try 1=2 of 3 -> 4 "
"catch error:{badmatch,2} -> 5 end.", 5),
%% Exception in try with after
- ?line check(fun () -> X = try 1=2
+ check(fun () -> X = try 1=2
catch error:{badmatch,2} -> 3
after put(try_catch, 4) end,
{X,get(try_catch)} end,
@@ -1257,7 +1182,7 @@ try_catch(Config) when is_list(Config) ->
" catch error:{badmatch,2} -> 3 "
" after put(try_catch, 4) end, "
" {X,get(try_catch)} end. ", {3,4}),
- ?line check(fun () -> X = try 1=2 of 3 -> 4
+ check(fun () -> X = try 1=2 of 3 -> 4
catch error:{badmatch,2} -> 5
after put(try_catch, 6) end,
{X,get(try_catch)} end,
@@ -1266,12 +1191,12 @@ try_catch(Config) when is_list(Config) ->
" after put(try_catch, 6) end, "
" {X,get(try_catch)} end. ", {5,6}),
%% Uncaught exception
- ?line error_check("try 1=2 catch error:undefined -> 3 end. ",
+ error_check("try 1=2 catch error:undefined -> 3 end. ",
{badmatch,2}),
- ?line error_check("try 1=2 of 3 -> 4 catch error:undefined -> 5 end. ",
+ error_check("try 1=2 of 3 -> 4 catch error:undefined -> 5 end. ",
{badmatch,2}),
%% Uncaught exception with after
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2
after put(try_catch, 3) end end,
get(try_catch) end,
@@ -1279,7 +1204,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 "
" after put(try_catch, 3) end end, "
" get(try_catch) end. ", 3),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 of 3 -> 4
after put(try_catch, 5) end end,
get(try_catch) end,
@@ -1287,7 +1212,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 of 3 -> 4"
" after put(try_catch, 5) end end, "
" get(try_catch) end. ", 5),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 catch error:undefined -> 3
after put(try_catch, 4) end end,
get(try_catch) end,
@@ -1295,7 +1220,7 @@ try_catch(Config) when is_list(Config) ->
" begin catch try 1=2 catch error:undefined -> 3 "
" after put(try_catch, 4) end end, "
" get(try_catch) end. ", 4),
- ?line check(fun () -> {'EXIT',{{badmatch,2},_}} =
+ check(fun () -> {'EXIT',{{badmatch,2},_}} =
begin catch try 1=2 of 3 -> 4
catch error:undefined -> 5
after put(try_catch, 6) end end,
@@ -1308,19 +1233,16 @@ try_catch(Config) when is_list(Config) ->
ok.
-eval_expr_5(doc) ->
- ["(OTP-7933)"];
-eval_expr_5(suite) ->
- [];
+%% (OTP-7933).
eval_expr_5(Config) when is_list(Config) ->
- ?line {ok,Tokens ,_} =
+ {ok,Tokens ,_} =
erl_scan:string("if a+4 == 4 -> yes; true -> no end. "),
- ?line {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
- ?line {value, no, []} = erl_eval:expr(Expr, [], none, none, none),
- ?line no = erl_eval:expr(Expr, [], none, none, value),
+ {ok, [Expr]} = erl_parse:parse_exprs(Tokens),
+ {value, no, []} = erl_eval:expr(Expr, [], none, none, none),
+ no = erl_eval:expr(Expr, [], none, none, value),
try
erl_eval:expr(Expr, [], none, none, 4711),
- ?line function_clause = should_never_reach_here
+ function_clause = should_never_reach_here
catch
error:function_clause ->
ok
@@ -1362,7 +1284,7 @@ check1(F, String, Result) ->
{value, Result, _} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
check(F, String, Result, BoundVars, LFH, EFH) ->
@@ -1375,11 +1297,11 @@ check(F, String, Result, BoundVars, LFH, EFH) ->
true ->
ok;
false ->
- test_server:fail({check, BoundVars, Keys})
+ ct:fail({check, BoundVars, Keys})
end,
ok;
Other ->
- test_server:fail({check, Other, Result})
+ ct:fail({check, Other, Result})
end.
error_check(String, Result) ->
@@ -1387,7 +1309,7 @@ error_check(String, Result) ->
{'EXIT', {Result,_}} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
error_check(String, Result, LFH, EFH) ->
@@ -1395,7 +1317,7 @@ error_check(String, Result, LFH, EFH) ->
{'EXIT', {Result,_}} ->
ok;
Other ->
- test_server:fail({eval, Other, Result})
+ ct:fail({eval, Other, Result})
end.
eval_string(String) ->
diff --git a/lib/debugger/test/exception_SUITE.erl b/lib/debugger/test/exception_SUITE.erl
index f42dbc7776..ef824b00be 100644
--- a/lib/debugger/test/exception_SUITE.erl
+++ b/lib/debugger/test/exception_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,15 +28,15 @@
-export([bad_guy/2]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
%% Filler.
%%
%%
-%%
-%%
%% This is line 40.
even(N) when is_integer(N), N > 1, (N rem 2) == 0 ->
odd(N-1)++[N].
@@ -68,17 +68,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -87,25 +84,25 @@ end_per_suite(Config) when is_list(Config) ->
%% Test that deliberately bad matches are reported correctly.
badmatch(Config) when is_list(Config) ->
- ?line ?try_match(a),
- ?line ?try_match(42),
- ?line ?try_match({a, b, c}),
- ?line ?try_match([]),
- ?line ?try_match(1.0),
+ ?try_match(a),
+ ?try_match(42),
+ ?try_match({a, b, c}),
+ ?try_match([]),
+ ?try_match(1.0),
ok.
%% Test various exceptions, in the presence of a previous error suppressed
%% in a guard.
pending_errors(Config) when is_list(Config) ->
- ?line pending(e_badmatch, {badmatch, b}),
- ?line pending(x, function_clause),
- ?line pending(e_case, {case_clause, xxx}),
- ?line pending(e_if, if_clause),
- ?line pending(e_badarith, badarith),
- ?line pending(e_undef, undef),
- ?line pending(e_timeoutval, timeout_value),
- ?line pending(e_badarg, badarg),
- ?line pending(e_badarg_spawn, badarg),
+ pending(e_badmatch, {badmatch, b}),
+ pending(x, function_clause),
+ pending(e_case, {case_clause, xxx}),
+ pending(e_if, if_clause),
+ pending(e_badarith, badarith),
+ pending(e_undef, undef),
+ pending(e_timeoutval, timeout_value),
+ pending(e_badarg, badarg),
+ pending(e_badarg_spawn, badarg),
ok.
bad_guy(pe_badarith, Other) when Other+1 == 0 -> % badarith (suppressed)
@@ -126,9 +123,9 @@ bad_guy(_, e_undef) ->
non_existing_module:foo(); % undef
bad_guy(_, e_timeoutval) ->
receive
- after arne -> % timeout_value
- ok
- end;
+ after arne -> % timeout_value
+ ok
+ end;
bad_guy(_, e_badarg) ->
node(xxx); % badarg
bad_guy(_, e_badarg_spawn) ->
@@ -150,7 +147,7 @@ pending_catched(First, Second, Expected) ->
{'EXIT', Reason} ->
pending(Reason, bad_guy, [First, Second], Expected);
Other ->
- test_server:fail({not_exit, Other})
+ ct:fail({not_exit, Other})
end.
pending_exit_message(Args, Expected) ->
@@ -162,9 +159,9 @@ pending_exit_message(Args, Expected) ->
{'EXIT', Pid, Reason} ->
pending(Reason, bad_guy, Args, Expected);
Other ->
- test_server:fail({unexpected_message, Other})
+ ct:fail({unexpected_message, Other})
after 10000 ->
- test_server:fail(timeout)
+ ct:fail(timeout)
end,
process_flag(trap_exit, false).
@@ -180,67 +177,67 @@ pending({Code,[{?MODULE,Func,Arity,_}|_]}, Func, Args, Code)
when length(Args) == Arity ->
ok;
pending(Reason, _Function, _Args, _Code) ->
- test_server:fail({bad_exit_reason,Reason}).
+ ct:fail({bad_exit_reason,Reason}).
%% Test that doing arithmetics on [] gives a badarith EXIT and not a crash.
nil_arith(Config) when is_list(Config) ->
- ?line ba_plus_minus_times([], []),
-
- ?line ba_plus_minus_times([], 0),
- ?line ba_plus_minus_times([], 42),
- ?line ba_plus_minus_times([], 38724978123478923784),
- ?line ba_plus_minus_times([], 38.72),
-
- ?line ba_plus_minus_times(0, []),
- ?line ba_plus_minus_times(334, []),
- ?line ba_plus_minus_times(387249797813478923784, []),
- ?line ba_plus_minus_times(344.22, []),
-
- ?line ba_div_rem([], []),
-
- ?line ba_div_rem([], 0),
- ?line ba_div_rem([], 1),
- ?line ba_div_rem([], 42),
- ?line ba_div_rem([], 38724978123478923784),
- ?line ba_div_rem(344.22, []),
-
- ?line ba_div_rem(0, []),
- ?line ba_div_rem(1, []),
- ?line ba_div_rem(334, []),
- ?line ba_div_rem(387249797813478923784, []),
- ?line ba_div_rem(344.22, []),
-
- ?line ba_div_rem(344.22, 0.0),
- ?line ba_div_rem(1, 0.0),
- ?line ba_div_rem(392873498733971, 0.0),
-
- ?line ba_bop([], []),
- ?line ba_bop(0, []),
- ?line ba_bop(42, []),
- ?line ba_bop(-42342742987343, []),
- ?line ba_bop(238.342, []),
- ?line ba_bop([], 0),
- ?line ba_bop([], -243),
- ?line ba_bop([], 243),
- ?line ba_bop([], 2438724982478933),
- ?line ba_bop([], 3987.37),
-
- ?line ba_bnot([]),
- ?line ba_bnot(23.33),
-
- ?line ba_shift([], []),
- ?line ba_shift([], 0),
- ?line ba_shift([], 4),
- ?line ba_shift([], -4),
- ?line ba_shift([], 2343333333333),
- ?line ba_shift([], -333333333),
- ?line ba_shift([], 234.00),
- ?line ba_shift(23, []),
- ?line ba_shift(0, []),
- ?line ba_shift(-3433443433433323, []),
- ?line ba_shift(433443433433323, []),
- ?line ba_shift(343.93, []),
+ ba_plus_minus_times([], []),
+
+ ba_plus_minus_times([], 0),
+ ba_plus_minus_times([], 42),
+ ba_plus_minus_times([], 38724978123478923784),
+ ba_plus_minus_times([], 38.72),
+
+ ba_plus_minus_times(0, []),
+ ba_plus_minus_times(334, []),
+ ba_plus_minus_times(387249797813478923784, []),
+ ba_plus_minus_times(344.22, []),
+
+ ba_div_rem([], []),
+
+ ba_div_rem([], 0),
+ ba_div_rem([], 1),
+ ba_div_rem([], 42),
+ ba_div_rem([], 38724978123478923784),
+ ba_div_rem(344.22, []),
+
+ ba_div_rem(0, []),
+ ba_div_rem(1, []),
+ ba_div_rem(334, []),
+ ba_div_rem(387249797813478923784, []),
+ ba_div_rem(344.22, []),
+
+ ba_div_rem(344.22, 0.0),
+ ba_div_rem(1, 0.0),
+ ba_div_rem(392873498733971, 0.0),
+
+ ba_bop([], []),
+ ba_bop(0, []),
+ ba_bop(42, []),
+ ba_bop(-42342742987343, []),
+ ba_bop(238.342, []),
+ ba_bop([], 0),
+ ba_bop([], -243),
+ ba_bop([], 243),
+ ba_bop([], 2438724982478933),
+ ba_bop([], 3987.37),
+
+ ba_bnot([]),
+ ba_bnot(23.33),
+
+ ba_shift([], []),
+ ba_shift([], 0),
+ ba_shift([], 4),
+ ba_shift([], -4),
+ ba_shift([], 2343333333333),
+ ba_shift([], -333333333),
+ ba_shift([], 234.00),
+ ba_shift(23, []),
+ ba_shift(0, []),
+ ba_shift(-3433443433433323, []),
+ ba_shift(433443433433323, []),
+ ba_shift(343.93, []),
ok.
ba_plus_minus_times(A, B) ->
@@ -279,29 +276,29 @@ ba_bnot(A) ->
stacktrace(Conf) when is_list(Conf) ->
Tag = make_ref(),
- ?line {_,Mref} = spawn_monitor(fun() -> exit({Tag,erlang:get_stacktrace()}) end),
- ?line {Tag,[]} = receive {'DOWN',Mref,_,_,Info} -> Info end,
+ {_,Mref} = spawn_monitor(fun() -> exit({Tag,erlang:get_stacktrace()}) end),
+ {Tag,[]} = receive {'DOWN',Mref,_,_,Info} -> Info end,
V = [make_ref()|self()],
- ?line {value2,{caught1,badarg,[{erlang,abs,[V],_}|_]=St1}} =
+ {value2,{caught1,badarg,[{erlang,abs,[V],_}|_]=St1}} =
stacktrace_1({'abs',V}, error, {value,V}),
- ?line St1 = erase(stacktrace1),
- ?line St1 = erase(stacktrace2),
- ?line St1 = erlang:get_stacktrace(),
- ?line {caught2,{error,badarith},[{?MODULE,my_add,2,_}|_]=St2} =
+ St1 = erase(stacktrace1),
+ St1 = erase(stacktrace2),
+ St1 = erlang:get_stacktrace(),
+ {caught2,{error,badarith},[{?MODULE,my_add,2,_}|_]=St2} =
stacktrace_1({'div',{1,0}}, error, {'add',{0,a}}),
- ?line [{?MODULE,my_div,2,_}|_] = erase(stacktrace1),
- ?line St2 = erase(stacktrace2),
- ?line St2 = erlang:get_stacktrace(),
- ?line {caught2,{error,{try_clause,V}},[{?MODULE,stacktrace_1,3,_}|_]=St3} =
+ [{?MODULE,my_div,2,_}|_] = erase(stacktrace1),
+ St2 = erase(stacktrace2),
+ St2 = erlang:get_stacktrace(),
+ {caught2,{error,{try_clause,V}},[{?MODULE,stacktrace_1,3,_}|_]=St3} =
stacktrace_1({value,V}, error, {value,V}),
- ?line St3 = erase(stacktrace1),
- ?line St3 = erase(stacktrace2),
- ?line St3 = erlang:get_stacktrace(),
- ?line {caught2,{throw,V},[{?MODULE,foo,1,_}|_]=St4} =
+ St3 = erase(stacktrace1),
+ St3 = erase(stacktrace2),
+ St3 = erlang:get_stacktrace(),
+ {caught2,{throw,V},[{?MODULE,foo,1,_}|_]=St4} =
stacktrace_1({value,V}, error, {throw,V}),
- ?line [{?MODULE,stacktrace_1,3,_}|_] = erase(stacktrace1),
- ?line St4 = erase(stacktrace2),
- ?line St4 = erlang:get_stacktrace(),
+ [{?MODULE,stacktrace_1,3,_}|_] = erase(stacktrace1),
+ St4 = erase(stacktrace2),
+ St4 = erlang:get_stacktrace(),
ok.
stacktrace_1(X, C1, Y) ->
@@ -326,19 +323,19 @@ stacktrace_1(X, C1, Y) ->
nested_stacktrace(Conf) when is_list(Conf) ->
V = [{make_ref()}|[self()]],
- ?line value1 =
+ value1 =
nested_stacktrace_1({{value,{V,x1}},void,{V,x1}},
{void,void,void}),
- ?line {caught1,
- [{?MODULE,my_add,2,_}|_],
- value2,
- [{?MODULE,my_add,2,_}|_]} =
+ {caught1,
+ [{?MODULE,my_add,2,_}|_],
+ value2,
+ [{?MODULE,my_add,2,_}|_]} =
nested_stacktrace_1({{'add',{V,x1}},error,badarith},
{{value,{V,x2}},void,{V,x2}}),
- ?line {caught1,
- [{?MODULE,my_add,2,_}|_],
- {caught2,[{erlang,abs,[V],_}|_]},
- [{erlang,abs,[V],_}|_]} =
+ {caught1,
+ [{?MODULE,my_add,2,_}|_],
+ {caught2,[{erlang,abs,[V],_}|_]},
+ [{erlang,abs,[V],_}|_]} =
nested_stacktrace_1({{'add',{V,x1}},error,badarith},
{{'abs',V},error,badarg}),
ok.
@@ -361,42 +358,42 @@ nested_stacktrace_1({X1,C1,V1}, {X2,C2,V2}) ->
raise(Conf) when is_list(Conf) ->
- ?line erase(raise),
- ?line A =
+ erase(raise),
+ A =
try
- ?line try foo({'div',{1,0}})
- catch
- error:badarith ->
- put(raise, A0 = erlang:get_stacktrace()),
- ?line erlang:raise(error, badarith, A0)
- end
+ try foo({'div',{1,0}})
+ catch
+ error:badarith ->
+ put(raise, A0 = erlang:get_stacktrace()),
+ erlang:raise(error, badarith, A0)
+ end
catch
error:badarith ->
- ?line A1 = erlang:get_stacktrace(),
- ?line A1 = get(raise)
+ A1 = erlang:get_stacktrace(),
+ A1 = get(raise)
end,
- ?line A = erlang:get_stacktrace(),
- ?line A = get(raise),
- ?line [{?MODULE,my_div,2,_}|_] = A,
+ A = erlang:get_stacktrace(),
+ A = get(raise),
+ [{?MODULE,my_div,2,_}|_] = A,
%%
N = 8, % Must be even
- ?line N = erlang:system_flag(backtrace_depth, N),
- ?line try even(N)
- catch error:function_clause -> ok
- end,
- ?line B = odd_even(N, []),
- ?line B = erlang:get_stacktrace(),
+ N = erlang:system_flag(backtrace_depth, N),
+ try even(N)
+ catch error:function_clause -> ok
+ end,
+ B = odd_even(N, []),
+ B = erlang:get_stacktrace(),
%%
- ?line C0 = odd_even(N+1, []),
- ?line C = lists:sublist(C0, N),
- ?line try odd(N+1)
- catch error:function_clause -> ok
- end,
- ?line C = erlang:get_stacktrace(),
- ?line try erlang:raise(error, function_clause, C0)
- catch error:function_clause -> ok
- end,
- ?line C = erlang:get_stacktrace(),
+ C0 = odd_even(N+1, []),
+ C = lists:sublist(C0, N),
+ try odd(N+1)
+ catch error:function_clause -> ok
+ end,
+ C = erlang:get_stacktrace(),
+ try erlang:raise(error, function_clause, C0)
+ catch error:function_clause -> ok
+ end,
+ C = erlang:get_stacktrace(),
ok.
odd_even(N, R) when is_integer(N), N > 1 ->
@@ -438,8 +435,8 @@ my_add(A, B) ->
my_abs(X) -> abs(X).
gunilla(Config) when is_list(Config) ->
- ?line {throw,kalle} = gunilla_1(),
- ?line [] = erlang:get_stacktrace(),
+ {throw,kalle} = gunilla_1(),
+ [] = erlang:get_stacktrace(),
ok.
gunilla_1() ->
@@ -466,9 +463,9 @@ per(Config) when is_list(Config) ->
end.
t1(_,X,_) ->
- (1 bsl X) + 1.
+ (1 bsl X) + 1.
t2(_,X,_) ->
- (X bsl 1) + 1.
+ (X bsl 1) + 1.
id(I) -> I.
diff --git a/lib/debugger/test/fun_SUITE.erl b/lib/debugger/test/fun_SUITE.erl
index fabee16cee..7eb53e4ce4 100644
--- a/lib/debugger/test/fun_SUITE.erl
+++ b/lib/debugger/test/fun_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,9 +30,11 @@
%% Internal exports.
-export([nothing/0,call_me/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -53,43 +55,38 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
good_call(Config) when is_list(Config) ->
- ?line F = fun() -> ok end,
- ?line ok = F(),
- ?line FF = fun ?MODULE:nothing/0,
- ?line ok = FF(),
+ F = fun() -> ok end,
+ ok = F(),
+ FF = fun ?MODULE:nothing/0,
+ ok = FF(),
ok.
-bad_apply(doc) ->
- "Test that the correct EXIT code is returned for all types of bad funs.";
-bad_apply(suite) -> [];
+%% Test that the correct EXIT code is returned for all types of bad funs.
bad_apply(Config) when is_list(Config) ->
- ?line bad_apply_fc(42, [0]),
- ?line bad_apply_fc(xx, [1]),
- ?line bad_apply_fc({}, [2]),
- ?line bad_apply_fc({1}, [3]),
- ?line bad_apply_fc({1,2,3}, [4]),
- ?line bad_apply_fc({1,2,3}, [5]),
- ?line bad_apply_fc({1,2,3,4}, [6]),
- ?line bad_apply_fc({1,2,3,4,5,6}, [7]),
- ?line bad_apply_fc({1,2,3,4,5}, [8]),
- ?line bad_apply_badarg({1,2}, [9]),
+ bad_apply_fc(42, [0]),
+ bad_apply_fc(xx, [1]),
+ bad_apply_fc({}, [2]),
+ bad_apply_fc({1}, [3]),
+ bad_apply_fc({1,2,3}, [4]),
+ bad_apply_fc({1,2,3}, [5]),
+ bad_apply_fc({1,2,3,4}, [6]),
+ bad_apply_fc({1,2,3,4,5,6}, [7]),
+ bad_apply_fc({1,2,3,4,5}, [8]),
+ bad_apply_badarg({1,2}, [9]),
ok.
bad_apply_fc(Fun, Args) ->
@@ -101,7 +98,7 @@ bad_apply_fc(Fun, Args) ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]);
Other ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]),
- ?t:fail({bad_result,Other})
+ ct:fail({bad_result,Other})
end.
bad_apply_badarg(Fun, Args) ->
@@ -113,23 +110,21 @@ bad_apply_badarg(Fun, Args) ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]);
Other ->
ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res]),
- ?t:fail({bad_result, Other})
+ ct:fail({bad_result, Other})
end.
-bad_fun_call(doc) ->
- "Try directly calling bad funs.";
-bad_fun_call(suite) -> [];
+%% Try directly calling bad funs.
bad_fun_call(Config) when is_list(Config) ->
- ?line bad_call_fc(42),
- ?line bad_call_fc(xx),
- ?line bad_call_fc({}),
- ?line bad_call_fc({1}),
- ?line bad_call_fc({1,2,3}),
- ?line bad_call_fc({1,2,3}),
- ?line bad_call_fc({1,2,3,4}),
- ?line bad_call_fc({1,2,3,4,5,6}),
- ?line bad_call_fc({1,2,3,4,5}),
- ?line bad_call_fc({1,2}),
+ bad_call_fc(42),
+ bad_call_fc(xx),
+ bad_call_fc({}),
+ bad_call_fc({1}),
+ bad_call_fc({1,2,3}),
+ bad_call_fc({1,2,3}),
+ bad_call_fc({1,2,3,4}),
+ bad_call_fc({1,2,3,4,5,6}),
+ bad_call_fc({1,2,3,4,5}),
+ bad_call_fc({1,2}),
ok.
bad_call_fc(Fun) ->
@@ -140,104 +135,101 @@ bad_call_fc(Fun) ->
ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
Other ->
ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
- ?t:fail({bad_result,Other})
+ ct:fail({bad_result,Other})
end.
%% Call and apply valid external funs with wrong number of arguments.
badarity(Config) when is_list(Config) ->
- ?line Fun = fun() -> ok end,
- ?line Stupid = {stupid,arguments},
- ?line Args = [some,{stupid,arguments},here],
+ Fun = fun() -> ok end,
+ Stupid = {stupid,arguments},
+ Args = [some,{stupid,arguments},here],
%% Simple call.
- ?line Res = (catch Fun(some, Stupid, here)),
+ Res = (catch Fun(some, Stupid, here)),
erlang:garbage_collect(),
erlang:yield(),
case Res of
{'EXIT',{{badarity,{Fun,Args}},[_|_]}} ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
_ ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
- ?line ?t:fail({bad_result,Res})
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
+ ct:fail({bad_result,Res})
end,
%% Apply.
- ?line Res2 = (catch apply(Fun, Args)),
+ Res2 = (catch apply(Fun, Args)),
erlang:garbage_collect(),
erlang:yield(),
case Res2 of
{'EXIT',{{badarity,{Fun,Args}},[_|_]}} ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
_ ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
- ?line ?t:fail({bad_result,Res2})
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
+ ct:fail({bad_result,Res2})
end,
ok.
%% Call and apply valid external funs with wrong number of arguments.
ext_badarity(Config) when is_list(Config) ->
- ?line Fun = fun ?MODULE:nothing/0,
- ?line Stupid = {stupid,arguments},
- ?line Args = [some,{stupid,arguments},here],
+ Fun = fun ?MODULE:nothing/0,
+ Stupid = {stupid,arguments},
+ Args = [some,{stupid,arguments},here],
%% Simple call.
- ?line Res = (catch Fun(some, Stupid, here)),
+ Res = (catch Fun(some, Stupid, here)),
erlang:garbage_collect(),
erlang:yield(),
case Res of
{'EXIT',{{badarity,{Fun,Args}},_}} ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]);
_ ->
- ?line ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
- ?line ?t:fail({bad_result,Res})
+ ok = io:format("~p(~p) -> ~p\n", [Fun,Args,Res]),
+ ct:fail({bad_result,Res})
end,
%% Apply.
- ?line Res2 = (catch apply(Fun, Args)),
+ Res2 = (catch apply(Fun, Args)),
erlang:garbage_collect(),
erlang:yield(),
case Res2 of
{'EXIT',{{badarity,{Fun,Args}},_}} ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]);
_ ->
- ?line ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
- ?line ?t:fail({bad_result,Res2})
+ ok = io:format("apply(~p, ~p) -> ~p\n", [Fun,Args,Res2]),
+ ct:fail({bad_result,Res2})
end,
ok.
nothing() ->
ok.
-otp_6061(suite) ->
- [];
-otp_6061(doc) ->
- ["Test handling of fun expression referring to uninterpreted code"];
+%% Test handling of fun expression referring to uninterpreted code.
otp_6061(Config) when is_list(Config) ->
- ?line OrigFlag = process_flag(trap_exit, true),
+ OrigFlag = process_flag(trap_exit, true),
- ?line Self = self(),
- ?line Pid = spawn_link(fun() -> test_otp_6061(Self) end),
+ Self = self(),
+ Pid = spawn_link(fun() -> test_otp_6061(Self) end),
receive
working ->
- ?line ok;
+ ok;
not_working ->
- ?line ?t:fail(not_working);
+ ct:fail(not_working);
{'EXIT', Pid, Reason} ->
- ?line ?t:fail({crash, Reason})
+ ct:fail({crash, Reason})
after
5000 ->
- ?line ?t:fail(timeout)
+ ct:fail(timeout)
end,
- ?line process_flag(trap_exit, OrigFlag),
+ process_flag(trap_exit, OrigFlag),
ok.
diff --git a/lib/debugger/test/guard_SUITE.erl b/lib/debugger/test/guard_SUITE.erl
index 880c89532b..f7874f79df 100644
--- a/lib/debugger/test/guard_SUITE.erl
+++ b/lib/debugger/test/guard_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,12 +39,14 @@
check_qlc_hrl/1,andalso_semi/1,t_tuple_size/1,binary_part/1,
bad_constants/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-export([init/4]).
-import(lists, [member/2]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -72,29 +74,25 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- ?line Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
-bad_arith(doc) -> "Test that a bad arithmetic operation in a guard works correctly.";
-bad_arith(suite) -> [];
+%% Test that a bad arithmetic operation in a guard works correctly.
bad_arith(Config) when list(Config) ->
- ?line 5 = bad_arith1(2, 3),
- ?line 10 = bad_arith1(1, infinity),
- ?line 10 = bad_arith1(infinity, 1),
- ?line 42 = bad_div(24, 0),
+ 5 = bad_arith1(2, 3),
+ 10 = bad_arith1(1, infinity),
+ 10 = bad_arith1(infinity, 1),
+ 42 = bad_div(24, 0),
ok.
bad_arith1(T1, T2) when T1+T2 < 10 ->
@@ -109,37 +107,35 @@ bad_div(A, B) when A div B > 0 ->
bad_div(_A, _B) ->
42.
-bad_tuple(doc) -> "Test that bad arguments to element/2 are handled correctly.";
-bad_tuple(suite) -> [];
+%% Test that bad arguments to element/2 are handled correctly.
bad_tuple(Config) when list(Config) ->
- ?line error = bad_tuple1(a),
- ?line error = bad_tuple1({a, b}),
- ?line x = bad_tuple1({x, b}),
- ?line y = bad_tuple1({a, b, y}),
+ error = bad_tuple1(a),
+ error = bad_tuple1({a, b}),
+ x = bad_tuple1({x, b}),
+ y = bad_tuple1({a, b, y}),
ok.
bad_tuple1(T) when element(1, T) == x -> x;
bad_tuple1(T) when element(3, T) == y -> y;
bad_tuple1(_) -> error.
-test_heap_guards(doc) -> "";
-test_heap_guards(suite) -> [];
+%% .
test_heap_guards(Config) when list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Tuple = {a, tuple, is, built, here, xxx},
- ?line List = [a, list, is, built, here],
+ process_flag(trap_exit, true),
+ Tuple = {a, tuple, is, built, here, xxx},
+ List = [a, list, is, built, here],
- ?line try_fun(fun a_case/1, [Tuple], [Tuple]),
- ?line try_fun(fun a_case/1, [List], [List, List]),
- ?line try_fun(fun a_case/1, [a], [a]),
+ try_fun(fun a_case/1, [Tuple], [Tuple]),
+ try_fun(fun a_case/1, [List], [List, List]),
+ try_fun(fun a_case/1, [a], [a]),
- ?line try_fun(fun an_if/1, [Tuple], [Tuple]),
- ?line try_fun(fun an_if/1, [List], [List, List]),
- ?line try_fun(fun an_if/1, [a], [a]),
+ try_fun(fun an_if/1, [Tuple], [Tuple]),
+ try_fun(fun an_if/1, [List], [List, List]),
+ try_fun(fun an_if/1, [a], [a]),
- ?line try_fun(fun receive_test/1, [Tuple], [Tuple]),
- ?line try_fun(fun receive_test/1, [List], [List, List]),
- ?line try_fun(fun receive_test/1, [a], [a]),
+ try_fun(fun receive_test/1, [Tuple], [Tuple]),
+ try_fun(fun receive_test/1, [List], [List, List]),
+ try_fun(fun receive_test/1, [a], [a]),
ok.
a_case(V) ->
@@ -185,12 +181,12 @@ try_fun(Iter, Fun, Args, Result, Filler) ->
Pid = spawn_link(?MODULE, init, [self(),Fun,Args,list_to_tuple(Filler)]),
receive
{'EXIT',Pid,{result,Result}} ->
- ?line try_fun(Iter-1, Fun, Args, Result, [0|Filler]);
+ try_fun(Iter-1, Fun, Args, Result, [0|Filler]);
{'EXIT',Pid,{result,Other}} ->
- ?line io:format("Expected ~p; got ~p~n", [Result,Other]),
- ?line test_server:fail();
+ io:format("Expected ~p; got ~p~n", [Result,Other]),
+ ct:fail(failed);
Other ->
- ?line test_server:fail({unexpected_message,Other})
+ ct:fail({unexpected_message,Other})
end.
init(_ReplyTo, Fun, Args, Filler) ->
@@ -202,87 +198,86 @@ init(_ReplyTo, Fun, Args, Filler) ->
dummy(_) ->
ok.
-guard_bifs(doc) -> "Test all guard bifs with nasty (but legal arguments).";
-guard_bifs(suite) -> [];
+%% Test all guard bifs with nasty (but legal arguments).
guard_bifs(Config) when list(Config) ->
- ?line Big = -237849247829874297658726487367328971246284736473821617265433,
- ?line Float = 387924.874,
+ Big = -237849247829874297658726487367328971246284736473821617265433,
+ Float = 387924.874,
%% Succeding use of guard bifs.
- ?line try_gbif('abs/1', Big, -Big),
- ?line try_gbif('float/1', Big, float(Big)),
- ?line try_gbif('trunc/1', Float, 387924.0),
- ?line try_gbif('round/1', Float, 387925.0),
- ?line try_gbif('length/1', [], 0),
+ try_gbif('abs/1', Big, -Big),
+ try_gbif('float/1', Big, float(Big)),
+ try_gbif('trunc/1', Float, 387924.0),
+ try_gbif('round/1', Float, 387925.0),
+ try_gbif('length/1', [], 0),
- ?line try_gbif('length/1', [a], 1),
- ?line try_gbif('length/1', [a, b], 2),
- ?line try_gbif('length/1', lists:seq(0, 31), 32),
+ try_gbif('length/1', [a], 1),
+ try_gbif('length/1', [a, b], 2),
+ try_gbif('length/1', lists:seq(0, 31), 32),
- ?line try_gbif('hd/1', [a], a),
- ?line try_gbif('hd/1', [a, b], a),
+ try_gbif('hd/1', [a], a),
+ try_gbif('hd/1', [a, b], a),
- ?line try_gbif('tl/1', [a], []),
- ?line try_gbif('tl/1', [a, b], [b]),
- ?line try_gbif('tl/1', [a, b, c], [b, c]),
+ try_gbif('tl/1', [a], []),
+ try_gbif('tl/1', [a, b], [b]),
+ try_gbif('tl/1', [a, b, c], [b, c]),
- ?line try_gbif('size/1', {}, 0),
- ?line try_gbif('size/1', {a}, 1),
- ?line try_gbif('size/1', {a, b}, 2),
- ?line try_gbif('size/1', {a, b, c}, 3),
- ?line try_gbif('size/1', list_to_binary([]), 0),
- ?line try_gbif('size/1', list_to_binary([1]), 1),
- ?line try_gbif('size/1', list_to_binary([1, 2]), 2),
- ?line try_gbif('size/1', list_to_binary([1, 2, 3]), 3),
+ try_gbif('size/1', {}, 0),
+ try_gbif('size/1', {a}, 1),
+ try_gbif('size/1', {a, b}, 2),
+ try_gbif('size/1', {a, b, c}, 3),
+ try_gbif('size/1', list_to_binary([]), 0),
+ try_gbif('size/1', list_to_binary([1]), 1),
+ try_gbif('size/1', list_to_binary([1, 2]), 2),
+ try_gbif('size/1', list_to_binary([1, 2, 3]), 3),
- ?line try_gbif('element/2', {x}, {1, x}),
- ?line try_gbif('element/2', {x, y}, {1, x}),
- ?line try_gbif('element/2', {x, y}, {2, y}),
+ try_gbif('element/2', {x}, {1, x}),
+ try_gbif('element/2', {x, y}, {1, x}),
+ try_gbif('element/2', {x, y}, {2, y}),
- ?line try_gbif('self/0', 0, self()),
- ?line try_gbif('node/0', 0, node()),
- ?line try_gbif('node/1', self(), node()),
+ try_gbif('self/0', 0, self()),
+ try_gbif('node/0', 0, node()),
+ try_gbif('node/1', self(), node()),
%% Failing use of guard bifs.
- ?line try_fail_gbif('abs/1', Big, 1),
- ?line try_fail_gbif('abs/1', [], 1),
+ try_fail_gbif('abs/1', Big, 1),
+ try_fail_gbif('abs/1', [], 1),
- ?line try_fail_gbif('float/1', Big, 42),
- ?line try_fail_gbif('float/1', [], 42),
+ try_fail_gbif('float/1', Big, 42),
+ try_fail_gbif('float/1', [], 42),
- ?line try_fail_gbif('trunc/1', Float, 0.0),
- ?line try_fail_gbif('trunc/1', [], 0.0),
+ try_fail_gbif('trunc/1', Float, 0.0),
+ try_fail_gbif('trunc/1', [], 0.0),
- ?line try_fail_gbif('round/1', Float, 1.0),
- ?line try_fail_gbif('round/1', [], a),
+ try_fail_gbif('round/1', Float, 1.0),
+ try_fail_gbif('round/1', [], a),
- ?line try_fail_gbif('length/1', [], 1),
- ?line try_fail_gbif('length/1', [a], 0),
- ?line try_fail_gbif('length/1', a, 0),
- ?line try_fail_gbif('length/1', {a}, 0),
+ try_fail_gbif('length/1', [], 1),
+ try_fail_gbif('length/1', [a], 0),
+ try_fail_gbif('length/1', a, 0),
+ try_fail_gbif('length/1', {a}, 0),
- ?line try_fail_gbif('hd/1', [], 0),
- ?line try_fail_gbif('hd/1', [a], x),
- ?line try_fail_gbif('hd/1', x, x),
+ try_fail_gbif('hd/1', [], 0),
+ try_fail_gbif('hd/1', [a], x),
+ try_fail_gbif('hd/1', x, x),
- ?line try_fail_gbif('tl/1', [], 0),
- ?line try_fail_gbif('tl/1', [a], x),
- ?line try_fail_gbif('tl/1', x, x),
+ try_fail_gbif('tl/1', [], 0),
+ try_fail_gbif('tl/1', [a], x),
+ try_fail_gbif('tl/1', x, x),
- ?line try_fail_gbif('size/1', {}, 1),
- ?line try_fail_gbif('size/1', [], 0),
- ?line try_fail_gbif('size/1', [a], 1),
+ try_fail_gbif('size/1', {}, 1),
+ try_fail_gbif('size/1', [], 0),
+ try_fail_gbif('size/1', [a], 1),
- ?line try_fail_gbif('element/2', {}, {1, x}),
- ?line try_fail_gbif('element/2', {x}, {1, y}),
- ?line try_fail_gbif('element/2', [], {1, z}),
+ try_fail_gbif('element/2', {}, {1, x}),
+ try_fail_gbif('element/2', {x}, {1, y}),
+ try_fail_gbif('element/2', [], {1, z}),
- ?line try_fail_gbif('self/0', 0, list_to_pid("<0.0.0>")),
- ?line try_fail_gbif('node/0', 0, xxxx),
- ?line try_fail_gbif('node/1', self(), xxx),
- ?line try_fail_gbif('node/1', yyy, xxx),
+ try_fail_gbif('self/0', 0, list_to_pid("<0.0.0>")),
+ try_fail_gbif('node/0', 0, xxxx),
+ try_fail_gbif('node/1', self(), xxx),
+ try_fail_gbif('node/1', yyy, xxx),
ok.
try_gbif(Id, X, Y) ->
@@ -290,9 +285,9 @@ try_gbif(Id, X, Y) ->
{Id, X, Y} ->
io:format("guard_bif(~p, ~p, ~p) -- ok", [Id, X, Y]);
Other ->
- ?line ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
- [Id, X, Y, Other]),
- ?line test_server:fail()
+ ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
+ [Id, X, Y, Other]),
+ ct:fail(failed)
end.
try_fail_gbif(Id, X, Y) ->
@@ -300,9 +295,9 @@ try_fail_gbif(Id, X, Y) ->
{'EXIT', {function_clause,[{?MODULE,guard_bif,[Id,X,Y],_}|_]}} ->
io:format("guard_bif(~p, ~p, ~p) -- ok", [Id,X,Y]);
Other ->
- ?line ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
- [Id, X, Y, Other]),
- ?line test_server:fail()
+ ok = io:format("guard_bif(~p, ~p, ~p) -- bad result: ~p\n",
+ [Id, X, Y, Other]),
+ ct:fail(failed)
end.
guard_bif('abs/1', X, Y) when abs(X) == Y ->
@@ -330,24 +325,23 @@ guard_bif('node/0', X, Y) when node() == Y ->
guard_bif('node/1', X, Y) when node(X) == Y ->
{'node/1', X, Y}.
-type_tests(doc) -> "Test the type tests.";
-type_tests(suite) -> [];
+%% Test the type tests.
type_tests(Config) when list(Config) ->
- ?line Types = all_types(),
- ?line Tests = type_test_desc(),
- ?line put(errors, 0),
- ?line put(violations, 0),
- ?line type_tests(Tests, Types),
- ?line case {get(errors), get(violations)} of
- {0, 0} ->
- ok;
- {0, N} ->
- {comment, integer_to_list(N) ++ " standard violation(s)"};
- {Errors, Violations} ->
- io:format("~p sub test(s) failed, ~p violation(s)",
- [Errors, Violations]),
- ?line test_server:fail()
- end.
+ Types = all_types(),
+ Tests = type_test_desc(),
+ put(errors, 0),
+ put(violations, 0),
+ type_tests(Tests, Types),
+ case {get(errors), get(violations)} of
+ {0, 0} ->
+ ok;
+ {0, N} ->
+ {comment, integer_to_list(N) ++ " standard violation(s)"};
+ {Errors, Violations} ->
+ io:format("~p sub test(s) failed, ~p violation(s)",
+ [Errors, Violations]),
+ ct:fail(failed)
+ end.
type_tests([{Test, AllowedTypes}| T], AllTypes) ->
type_tests(Test, AllTypes, AllowedTypes),
@@ -372,7 +366,7 @@ type_tests(Test, [Type|T], Allowed) ->
[{?MODULE,type_test,[Test,Value],_}|_]}} ->
ok;
{'EXIT',Other} ->
- ?line test_server:fail({unexpected_error_reason,Other});
+ ct:fail({unexpected_error_reason,Other});
tuple when function(Value) ->
io:format("Standard violation: Test ~p(~p) should fail",
[Test, Value]),
@@ -442,18 +436,18 @@ type_test(function, X) when function(X) ->
function.
const_guard(Config) when is_list(Config) ->
- ?line if
- (0 == 0) and ((0 == 0) or (0 == 0)) ->
- ok
- end.
+ if
+ (0 == 0) and ((0 == 0) or (0 == 0)) ->
+ ok
+ end.
const_cond(Config) when is_list(Config) ->
- ?line ok = const_cond({}, 0),
- ?line ok = const_cond({a}, 1),
- ?line error = const_cond({a,b}, 3),
- ?line error = const_cond({a}, 0),
- ?line error = const_cond({a,b}, 1),
+ ok = const_cond({}, 0),
+ ok = const_cond({a}, 1),
+ error = const_cond({a,b}, 3),
+ error = const_cond({a}, 0),
+ error = const_cond({a,b}, 1),
ok.
const_cond(T, Sz) ->
@@ -474,59 +468,59 @@ basic_not(Config) when is_list(Config) ->
D = id(5),
ATuple = {False,True,Glurf},
- ?line check(fun() -> if not false -> ok; true -> error end end, ok),
- ?line check(fun() -> if not true -> ok; true -> error end end, error),
- ?line check(fun() -> if not False -> ok; true -> error end end, ok),
- ?line check(fun() -> if not True -> ok; true -> error end end, error),
+ check(fun() -> if not false -> ok; true -> error end end, ok),
+ check(fun() -> if not true -> ok; true -> error end end, error),
+ check(fun() -> if not False -> ok; true -> error end end, ok),
+ check(fun() -> if not True -> ok; true -> error end end, error),
- ?line check(fun() -> if A > B -> gt; A < B -> lt; A == B -> eq end end, lt),
- ?line check(fun() -> if A > C -> gt; A < C -> lt; A == C -> eq end end, gt),
- ?line check(fun() -> if A > D -> gt; A < D -> lt; A == D -> eq end end, eq),
+ check(fun() -> if A > B -> gt; A < B -> lt; A == B -> eq end end, lt),
+ check(fun() -> if A > C -> gt; A < C -> lt; A == C -> eq end end, gt),
+ check(fun() -> if A > D -> gt; A < D -> lt; A == D -> eq end end, eq),
- ?line check(fun() -> if not (7 > 453) -> le; not (7 < 453) -> ge;
- not (7 == 453) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not (7 > -8) -> le; not (7 < -8) -> ge;
- not (7 == -8) -> ne; true -> eq end end, ge),
- ?line check(fun() -> if not (7 > 7) -> le; not (7 < 7) -> ge;
- not (7 == 7) -> ne; true -> eq end end, le),
+ check(fun() -> if not (7 > 453) -> le; not (7 < 453) -> ge;
+ not (7 == 453) -> ne; true -> eq end end, le),
+ check(fun() -> if not (7 > -8) -> le; not (7 < -8) -> ge;
+ not (7 == -8) -> ne; true -> eq end end, ge),
+ check(fun() -> if not (7 > 7) -> le; not (7 < 7) -> ge;
+ not (7 == 7) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not (A > B) -> le; not (A < B) -> ge;
- not (A == B) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not (A > C) -> le; not (A < C) -> ge;
- not (A == C) -> ne; true -> eq end end, ge),
- ?line check(fun() -> if not (A > D) -> le; not (A < D) -> ge;
- not (A == D) -> ne; true -> eq end end, le),
+ check(fun() -> if not (A > B) -> le; not (A < B) -> ge;
+ not (A == B) -> ne; true -> eq end end, le),
+ check(fun() -> if not (A > C) -> le; not (A < C) -> ge;
+ not (A == C) -> ne; true -> eq end end, ge),
+ check(fun() -> if not (A > D) -> le; not (A < D) -> ge;
+ not (A == D) -> ne; true -> eq end end, le),
- ?line check(fun() -> if not element(1, ATuple) -> ok; true -> error end end, ok),
- ?line check(fun() -> if not element(2, ATuple) -> ok; true -> error end end, error),
- ?line check(fun() -> if not element(3, ATuple) -> ok; true -> error end end, error),
+ check(fun() -> if not element(1, ATuple) -> ok; true -> error end end, ok),
+ check(fun() -> if not element(2, ATuple) -> ok; true -> error end end, error),
+ check(fun() -> if not element(3, ATuple) -> ok; true -> error end end, error),
- ?line check(fun() -> if not glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if not Glurf -> ok; true -> error end end, error),
+ check(fun() -> if not glurf -> ok; true -> error end end, error),
+ check(fun() -> if not Glurf -> ok; true -> error end end, error),
ok.
complex_not(Config) when is_list(Config) ->
ATuple = id({false,true,gurka}),
- ?line check(fun() -> if not(element(1, ATuple)) -> ok; true -> error end end, ok),
- ?line check(fun() -> if not(element(2, ATuple)) -> ok; true -> error end end, error),
+ check(fun() -> if not(element(1, ATuple)) -> ok; true -> error end end, ok),
+ check(fun() -> if not(element(2, ATuple)) -> ok; true -> error end end, error),
- ?line check(fun() -> if not(element(3, ATuple) == gurka) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if not(element(3, ATuple) =/= gurka) -> ok;
- true -> error end end, ok),
+ check(fun() -> if not(element(3, ATuple) == gurka) -> ok;
+ true -> error end end, error),
+ check(fun() -> if not(element(3, ATuple) =/= gurka) -> ok;
+ true -> error end end, ok),
- ?line check(fun() -> if {a,not(element(2, ATuple))} == {a,false} -> ok;
- true -> error end end, ok),
- ?line check(fun() -> if {a,not(element(1, ATuple))} == {a,false} -> ok;
- true -> error end end, error),
+ check(fun() -> if {a,not(element(2, ATuple))} == {a,false} -> ok;
+ true -> error end end, ok),
+ check(fun() -> if {a,not(element(1, ATuple))} == {a,false} -> ok;
+ true -> error end end, error),
- ?line check(fun() -> if not(element(1, ATuple) or element(3, ATuple)) -> ok;
- true -> error end end, error),
+ check(fun() -> if not(element(1, ATuple) or element(3, ATuple)) -> ok;
+ true -> error end end, error),
%% orelse
- ?line check(fun() -> if not(element(1, ATuple) orelse element(3, ATuple)) -> ok;
- true -> error end end, error),
+ check(fun() -> if not(element(1, ATuple) orelse element(3, ATuple)) -> ok;
+ true -> error end end, error),
ok.
@@ -534,100 +528,100 @@ semicolon(Config) when is_list(Config) ->
%% True/false combined using ';' (literal atoms).
- ?line check(fun() -> if true; false -> ok end end, ok),
- ?line check(fun() -> if false; true -> ok end end, ok),
- ?line check(fun() -> if true; true -> ok end end, ok),
- ?line check(fun() -> if false; false -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if false; false -> ok end),
- exit
- end, exit),
+ check(fun() -> if true; false -> ok end end, ok),
+ check(fun() -> if false; true -> ok end end, ok),
+ check(fun() -> if true; true -> ok end end, ok),
+ check(fun() -> if false; false -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if false; false -> ok end),
+ exit
+ end, exit),
%% True/false combined used ';'.
True = id(true),
False = id(false),
- ?line check(fun() -> if True; False -> ok end end, ok),
- ?line check(fun() -> if False; True -> ok end end, ok),
- ?line check(fun() -> if True; True -> ok end end, ok),
- ?line check(fun() -> if False; False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if False; False -> ok end),
- exit
- end, exit),
+ check(fun() -> if True; False -> ok end end, ok),
+ check(fun() -> if False; True -> ok end end, ok),
+ check(fun() -> if True; True -> ok end end, ok),
+ check(fun() -> if False; False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if False; False -> ok end),
+ exit
+ end, exit),
%% Combine true/false with a non-boolean value.
Glurf = id(glurf),
- ?line check(fun() -> if True; Glurf -> ok end end, ok),
- ?line check(fun() -> if Glurf; True -> ok end end, ok),
- ?line check(fun() -> if Glurf; Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if False; Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf; False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if Glurf; Glurf -> ok end),
- exit
- end, exit),
+ check(fun() -> if True; Glurf -> ok end end, ok),
+ check(fun() -> if Glurf; True -> ok end end, ok),
+ check(fun() -> if Glurf; Glurf -> ok; true -> error end end, error),
+ check(fun() -> if False; Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf; False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if Glurf; Glurf -> ok end),
+ exit
+ end, exit),
%% Combine true/false with errors.
ATuple = id({false,true,gurka}),
- ?line check(fun() -> if True; element(42, ATuple) -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple); True -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple); element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if False; element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if element(42, ATuple);
- False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if element(42, ATuple);
- element(42, ATuple) -> ok end),
- exit
- end, exit),
+ check(fun() -> if True; element(42, ATuple) -> ok end end, ok),
+ check(fun() -> if element(42, ATuple); True -> ok end end, ok),
+ check(fun() -> if element(42, ATuple); element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if False; element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if element(42, ATuple);
+ False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if element(42, ATuple);
+ element(42, ATuple) -> ok end),
+ exit
+ end, exit),
ok.
complex_semicolon(Config) when is_list(Config) ->
- ?line ok = csemi1(int, {blurf}),
- ?line ok = csemi1(string, {blurf}),
- ?line ok = csemi1(float, [a]),
- ?line error = csemi1(35, 42),
+ ok = csemi1(int, {blurf}),
+ ok = csemi1(string, {blurf}),
+ ok = csemi1(float, [a]),
+ error = csemi1(35, 42),
%% 2
- ?line ok = csemi2({}, {a,b,c}),
- ?line ok = csemi2({1,3.5}, {a,b,c}),
- ?line ok = csemi2(dum, {a,b,c}),
+ ok = csemi2({}, {a,b,c}),
+ ok = csemi2({1,3.5}, {a,b,c}),
+ ok = csemi2(dum, {a,b,c}),
- ?line ok = csemi2({45,-19.3}, {}),
- ?line ok = csemi2({45,-19.3}, {dum}),
- ?line ok = csemi2({45,-19.3}, {dum,dum}),
+ ok = csemi2({45,-19.3}, {}),
+ ok = csemi2({45,-19.3}, {dum}),
+ ok = csemi2({45,-19.3}, {dum,dum}),
- ?line error = csemi2({45}, {dum}),
- ?line error = csemi2([], {dum}),
- ?line error = csemi2({dum}, []),
- ?line error = csemi2([], []),
+ error = csemi2({45}, {dum}),
+ error = csemi2([], {dum}),
+ error = csemi2({dum}, []),
+ error = csemi2([], []),
%% 3
- ?line csemi3(fun csemi3a/4),
- ?line csemi3(fun csemi3b/4),
- ?line csemi3(fun csemi3c/4),
+ csemi3(fun csemi3a/4),
+ csemi3(fun csemi3b/4),
+ csemi3(fun csemi3c/4),
%% 4
- ?line csemi4(fun csemi4a/4),
- ?line csemi4(fun csemi4b/4),
- ?line csemi4(fun csemi4c/4),
- ?line csemi4(fun csemi4d/4),
+ csemi4(fun csemi4a/4),
+ csemi4(fun csemi4b/4),
+ csemi4(fun csemi4c/4),
+ csemi4(fun csemi4d/4),
%% 4, 'orelse' instead of 'or'
- ?line csemi4_orelse(fun csemi4_orelse_a/4),
- ?line csemi4_orelse(fun csemi4_orelse_b/4),
- ?line csemi4_orelse(fun csemi4_orelse_c/4),
- ?line csemi4_orelse(fun csemi4_orelse_d/4),
+ csemi4_orelse(fun csemi4_orelse_a/4),
+ csemi4_orelse(fun csemi4_orelse_b/4),
+ csemi4_orelse(fun csemi4_orelse_c/4),
+ csemi4_orelse(fun csemi4_orelse_d/4),
ok.
@@ -713,24 +707,24 @@ csemi4_orelse(Test) ->
ok = Test({}, 2, blurf, 0),
ok = Test({}, 2, {1}, 2),
- ?line error = Test([], 1, {}, 0),
+ error = Test([], 1, {}, 0),
ok.
csemi4_orelse_a(A, X, B, Y) when (size(A) > 1) orelse (X > 1);
- (size(B) > 1) orelse (Y > 1) -> ok;
+ (size(B) > 1) orelse (Y > 1) -> ok;
csemi4_orelse_a(_, _, _, _) -> error.
csemi4_orelse_b(A, X, B, Y) when (X > 1) orelse (size(A) > 1);
- (size(B) > 1) orelse (Y > 1) -> ok;
+ (size(B) > 1) orelse (Y > 1) -> ok;
csemi4_orelse_b(_, _, _, _) -> error.
csemi4_orelse_c(A, X, B, Y) when (size(A) > 1) orelse (X > 1);
- (Y > 1) orelse (size(B) > 1) -> ok;
+ (Y > 1) orelse (size(B) > 1) -> ok;
csemi4_orelse_c(_, _, _, _) -> error.
csemi4_orelse_d(A, X, B, Y) when (X > 1) or (size(A) > 1);
- (Y > 1) or (size(B) > 1) -> ok;
+ (Y > 1) or (size(B) > 1) -> ok;
csemi4_orelse_d(_, _, _, _) -> error.
@@ -738,72 +732,72 @@ comma(Config) when is_list(Config) ->
%% ',' combinations of literal true/false.
- ?line check(fun() -> if true, false -> ok; true -> error end end, error),
- ?line check(fun() -> if false, true -> ok; true -> error end end, error),
- ?line check(fun() -> if true, true -> ok end end, ok),
- ?line check(fun() -> if false, false -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if true, false -> ok;
- false, true -> ok;
- false, false -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if true, false -> ok; true -> error end end, error),
+ check(fun() -> if false, true -> ok; true -> error end end, error),
+ check(fun() -> if true, true -> ok end end, ok),
+ check(fun() -> if false, false -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if true, false -> ok;
+ false, true -> ok;
+ false, false -> ok
+ end),
+ exit
+ end, exit),
%% ',' combinations of true/false in variables.
True = id(true),
False = id(false),
- ?line check(fun() -> if True, False -> ok; true -> error end end, error),
- ?line check(fun() -> if False, True -> ok; true -> error end end, error),
- ?line check(fun() -> if True, True -> ok end end, ok),
- ?line check(fun() -> if False, False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True, False -> ok;
- False, True -> ok;
- False, False -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True, False -> ok; true -> error end end, error),
+ check(fun() -> if False, True -> ok; true -> error end end, error),
+ check(fun() -> if True, True -> ok end end, ok),
+ check(fun() -> if False, False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True, False -> ok;
+ False, True -> ok;
+ False, False -> ok
+ end),
+ exit
+ end, exit),
%% ',' combinations of true/false, and non-boolean in variables.
Glurf = id(glurf),
- ?line check(fun() -> if True, Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf, True -> ok; true -> error end end, error),
- ?line check(fun() -> if True, True -> ok end end, ok),
- ?line check(fun() -> if Glurf, Glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True, Glurf -> ok;
- Glurf, True -> ok;
- Glurf, Glurf -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True, Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf, True -> ok; true -> error end end, error),
+ check(fun() -> if True, True -> ok end end, ok),
+ check(fun() -> if Glurf, Glurf -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True, Glurf -> ok;
+ Glurf, True -> ok;
+ Glurf, Glurf -> ok
+ end),
+ exit
+ end, exit),
%% ',' combinations of true/false with errors.
ATuple = id({a,b,c}),
- ?line check(fun() -> if True, element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if element(42, ATuple), True -> ok;
- true -> error end end, error),
- ?line check(fun() -> if True, True -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple), element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True, element(42, ATuple) -> ok;
- element(42, ATuple), True -> ok;
- element(42, ATuple), element(42, ATuple) -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True, element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if element(42, ATuple), True -> ok;
+ true -> error end end, error),
+ check(fun() -> if True, True -> ok end end, ok),
+ check(fun() -> if element(42, ATuple), element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True, element(42, ATuple) -> ok;
+ element(42, ATuple), True -> ok;
+ element(42, ATuple), element(42, ATuple) -> ok
+ end),
+ exit
+ end, exit),
ok.
@@ -813,35 +807,35 @@ or_guard(Config) when is_list(Config) ->
Glurf = id(glurf),
%% 'or' combinations of literal true/false.
- ?line check(fun() -> if true or false -> ok end end, ok),
- ?line check(fun() -> if false or true -> ok end end, ok),
- ?line check(fun() -> if true or true -> ok end end, ok),
- ?line check(fun() -> if false or false -> ok; true -> error end end, error),
+ check(fun() -> if true or false -> ok end end, ok),
+ check(fun() -> if false or true -> ok end end, ok),
+ check(fun() -> if true or true -> ok end end, ok),
+ check(fun() -> if false or false -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf or true -> ok; true -> error end end, error),
- ?line check(fun() -> if true or glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf or glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf or true -> ok; true -> error end end, error),
+ check(fun() -> if true or glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf or glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if false or false -> ok end),
- exit
- end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if false or false -> ok end),
+ exit
+ end, exit),
%% 'or' combinations using variables containing true/false.
- ?line check(fun() -> if True or False -> ok end end, ok),
- ?line check(fun() -> if False or True -> ok end end, ok),
- ?line check(fun() -> if True or True -> ok end end, ok),
- ?line check(fun() -> if False or False -> ok; true -> error end end, error),
+ check(fun() -> if True or False -> ok end end, ok),
+ check(fun() -> if False or True -> ok end end, ok),
+ check(fun() -> if True or True -> ok end end, ok),
+ check(fun() -> if False or False -> ok; true -> error end end, error),
- ?line check(fun() -> if True or Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf or True -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf or Glurf -> ok; true -> error end end, error),
+ check(fun() -> if True or Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf or True -> ok; true -> error end end, error),
+ check(fun() -> if Glurf or Glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if False or False -> ok end),
- exit
- end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if False or False -> ok end),
+ exit
+ end, exit),
ok.
@@ -850,142 +844,142 @@ more_or_guards(Config) when is_list(Config) ->
False = id(false),
ATuple = id({false,true,gurka}),
- ?line check(fun() ->
- if element(42, ATuple) or False -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if False or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(18, ATuple) or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if True or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(42, ATuple) or True -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(1, ATuple) or element(42, ATuple) or True -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(1, ATuple) or True or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if
- (<<False:8>> == <<0>>) or element(2, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if
- element(2, ATuple) or (<<True:8>> == <<1>>) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(2, ATuple) or element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if
- element(1, ATuple) or
- element(2, ATuple) or
- element(19, ATuple) -> ok;
- true -> error end
- end, error),
+ check(fun() ->
+ if element(42, ATuple) or False -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if False or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(18, ATuple) or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if True or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(42, ATuple) or True -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(1, ATuple) or element(42, ATuple) or True -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(1, ATuple) or True or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if
+ (<<False:8>> == <<0>>) or element(2, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if
+ element(2, ATuple) or (<<True:8>> == <<1>>) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(2, ATuple) or element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if
+ element(1, ATuple) or
+ element(2, ATuple) or
+ element(19, ATuple) -> ok;
+ true -> error end
+ end, error),
ok.
complex_or_guards(Config) when is_list(Config) ->
%% complex_or_1/2
- ?line ok = complex_or_1({a,b,c,d}, {1,2,3}),
- ?line ok = complex_or_1({a,b,c,d}, {1}),
- ?line ok = complex_or_1({a}, {1,2,3}),
- ?line error = complex_or_1({a}, {1}),
+ ok = complex_or_1({a,b,c,d}, {1,2,3}),
+ ok = complex_or_1({a,b,c,d}, {1}),
+ ok = complex_or_1({a}, {1,2,3}),
+ error = complex_or_1({a}, {1}),
- ?line error = complex_or_1(1, 2),
- ?line error = complex_or_1([], {a,b,c,d}),
- ?line error = complex_or_1({a,b,c,d}, []),
+ error = complex_or_1(1, 2),
+ error = complex_or_1([], {a,b,c,d}),
+ error = complex_or_1({a,b,c,d}, []),
%% complex_or_2/1
- ?line ok = complex_or_2({true,{}}),
- ?line ok = complex_or_2({false,{a}}),
- ?line ok = complex_or_2({false,{a,b,c}}),
- ?line ok = complex_or_2({true,{a,b,c,d}}),
+ ok = complex_or_2({true,{}}),
+ ok = complex_or_2({false,{a}}),
+ ok = complex_or_2({false,{a,b,c}}),
+ ok = complex_or_2({true,{a,b,c,d}}),
- ?line error = complex_or_2({blurf,{a,b,c}}),
+ error = complex_or_2({blurf,{a,b,c}}),
- ?line error = complex_or_2({true}),
- ?line error = complex_or_2({true,no_tuple}),
- ?line error = complex_or_2({true,[]}),
+ error = complex_or_2({true}),
+ error = complex_or_2({true,no_tuple}),
+ error = complex_or_2({true,[]}),
%% complex_or_3/2
- ?line ok = complex_or_3({true}, {}),
- ?line ok = complex_or_3({false}, {a}),
- ?line ok = complex_or_3({false}, {a,b,c}),
- ?line ok = complex_or_3({true}, {a,b,c,d}),
- ?line ok = complex_or_3({false}, <<1,2,3>>),
- ?line ok = complex_or_3({true}, <<1,2,3,4>>),
+ ok = complex_or_3({true}, {}),
+ ok = complex_or_3({false}, {a}),
+ ok = complex_or_3({false}, {a,b,c}),
+ ok = complex_or_3({true}, {a,b,c,d}),
+ ok = complex_or_3({false}, <<1,2,3>>),
+ ok = complex_or_3({true}, <<1,2,3,4>>),
- ?line error = complex_or_3(blurf, {a,b,c}),
+ error = complex_or_3(blurf, {a,b,c}),
- ?line error = complex_or_3({false}, <<1,2,3,4>>),
- ?line error = complex_or_3([], <<1,2>>),
- ?line error = complex_or_3({true}, 45),
- ?line error = complex_or_3(<<>>, <<>>),
+ error = complex_or_3({false}, <<1,2,3,4>>),
+ error = complex_or_3([], <<1,2>>),
+ error = complex_or_3({true}, 45),
+ error = complex_or_3(<<>>, <<>>),
%% complex_or_4/2
- ?line ok = complex_or_4(<<1,2,3>>, {true}),
- ?line ok = complex_or_4(<<1,2,3>>, {false}),
- ?line ok = complex_or_4(<<1,2,3>>, {true}),
- ?line ok = complex_or_4({1,2,3}, {true}),
- ?line error = complex_or_4({1,2,3,4}, {false}),
+ ok = complex_or_4(<<1,2,3>>, {true}),
+ ok = complex_or_4(<<1,2,3>>, {false}),
+ ok = complex_or_4(<<1,2,3>>, {true}),
+ ok = complex_or_4({1,2,3}, {true}),
+ error = complex_or_4({1,2,3,4}, {false}),
- ?line error = complex_or_4(<<1,2,3,4>>, []),
- ?line error = complex_or_4([], {true}),
+ error = complex_or_4(<<1,2,3,4>>, []),
+ error = complex_or_4([], {true}),
%% complex_or_5/2
- ?line ok = complex_or_5(<<1>>, {false}),
- ?line ok = complex_or_5(<<1,2,3>>, {true}),
- ?line ok = complex_or_5(<<1,2,3,4>>, {false}),
- ?line ok = complex_or_5({1,2,3}, {false}),
- ?line ok = complex_or_5({1,2,3,4}, {false}),
+ ok = complex_or_5(<<1>>, {false}),
+ ok = complex_or_5(<<1,2,3>>, {true}),
+ ok = complex_or_5(<<1,2,3,4>>, {false}),
+ ok = complex_or_5({1,2,3}, {false}),
+ ok = complex_or_5({1,2,3,4}, {false}),
- ?line error = complex_or_5(blurf, {false}),
- ?line error = complex_or_5(<<1>>, klarf),
- ?line error = complex_or_5(blurf, klarf),
+ error = complex_or_5(blurf, {false}),
+ error = complex_or_5(<<1>>, klarf),
+ error = complex_or_5(blurf, klarf),
%% complex_or_6/2
- ?line ok = complex_or_6({true,true}, {1,2,3,4}),
- ?line ok = complex_or_6({true,true}, <<1,2,3,4>>),
- ?line ok = complex_or_6({false,false}, <<1,2,3,4>>),
- ?line ok = complex_or_6({false,true}, <<1>>),
- ?line ok = complex_or_6({true,false}, {1}),
- ?line ok = complex_or_6({true,true}, {1}),
+ ok = complex_or_6({true,true}, {1,2,3,4}),
+ ok = complex_or_6({true,true}, <<1,2,3,4>>),
+ ok = complex_or_6({false,false}, <<1,2,3,4>>),
+ ok = complex_or_6({false,true}, <<1>>),
+ ok = complex_or_6({true,false}, {1}),
+ ok = complex_or_6({true,true}, {1}),
- ?line error = complex_or_6({false,false}, {1}),
+ error = complex_or_6({false,false}, {1}),
- ?line error = complex_or_6({true}, {1,2,3,4}),
- ?line error = complex_or_6({}, {1,2,3,4}),
- ?line error = complex_or_6([], {1,2,3,4}),
- ?line error = complex_or_6([], {1,2,3,4}),
- ?line error = complex_or_6({true,false}, klurf),
+ error = complex_or_6({true}, {1,2,3,4}),
+ error = complex_or_6({}, {1,2,3,4}),
+ error = complex_or_6([], {1,2,3,4}),
+ error = complex_or_6([], {1,2,3,4}),
+ error = complex_or_6({true,false}, klurf),
ok.
@@ -1031,79 +1025,79 @@ and_guard(Config) when is_list(Config) ->
%% 'and' combinations of literal true/false.
- ?line check(fun() -> if true and false -> ok; true -> error end end, error),
- ?line check(fun() -> if false and true -> ok; true -> error end end, error),
- ?line check(fun() -> if true and true -> ok end end, ok),
- ?line check(fun() -> if false and false -> ok; true -> error end end, error),
+ check(fun() -> if true and false -> ok; true -> error end end, error),
+ check(fun() -> if false and true -> ok; true -> error end end, error),
+ check(fun() -> if true and true -> ok end end, ok),
+ check(fun() -> if false and false -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf and true -> ok; true -> error end end, error),
- ?line check(fun() -> if true and glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if glurf and glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf and true -> ok; true -> error end end, error),
+ check(fun() -> if true and glurf -> ok; true -> error end end, error),
+ check(fun() -> if glurf and glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if true and false -> ok;
- false and true -> ok;
- false and false -> ok
- end),
- exit
- end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if true and false -> ok;
+ false and true -> ok;
+ false and false -> ok
+ end),
+ exit
+ end, exit),
%% 'and' combinations of true/false in variables.
True = id(true),
False = id(false),
- ?line check(fun() -> if True and False -> ok; true -> error end end, error),
- ?line check(fun() -> if False and True -> ok; true -> error end end, error),
- ?line check(fun() -> if True and True -> ok end end, ok),
- ?line check(fun() -> if False and False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True and False -> ok;
- False and True -> ok;
- False and False -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True and False -> ok; true -> error end end, error),
+ check(fun() -> if False and True -> ok; true -> error end end, error),
+ check(fun() -> if True and True -> ok end end, ok),
+ check(fun() -> if False and False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True and False -> ok;
+ False and True -> ok;
+ False and False -> ok
+ end),
+ exit
+ end, exit),
%% 'and' combinations of true/false and a non-boolean in variables.
Glurf = id(glurf),
- ?line check(fun() -> if True and Glurf -> ok; true -> error end end, error),
- ?line check(fun() -> if Glurf and True -> ok; true -> error end end, error),
- ?line check(fun() -> if True and True -> ok end end, ok),
- ?line check(fun() -> if Glurf and Glurf -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True and Glurf -> ok;
- Glurf and True -> ok;
- Glurf and Glurf -> ok
- end),
- exit
- end, exit),
+ check(fun() -> if True and Glurf -> ok; true -> error end end, error),
+ check(fun() -> if Glurf and True -> ok; true -> error end end, error),
+ check(fun() -> if True and True -> ok end end, ok),
+ check(fun() -> if Glurf and Glurf -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True and Glurf -> ok;
+ Glurf and True -> ok;
+ Glurf and Glurf -> ok
+ end),
+ exit
+ end, exit),
%% 'and' combinations of true/false with errors.
ATuple = id({a,b,c}),
- ?line check(fun() -> if True and element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() -> if element(42, ATuple) and True -> ok;
- true -> error end end, error),
- ?line check(fun() -> if True and True -> ok end end, ok),
- ?line check(fun() -> if element(42, ATuple) and element(42, ATuple) -> ok;
- true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} =
- (catch if True and element(42, ATuple) -> ok;
- element(42, ATuple) and True -> ok;
- element(42, ATuple) and element(42, ATuple) -> ok
- end),
- exit
- end, exit),
-
- ?line ok = relprod({'Set',a,b}, {'Set',a,b}),
+ check(fun() -> if True and element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() -> if element(42, ATuple) and True -> ok;
+ true -> error end end, error),
+ check(fun() -> if True and True -> ok end end, ok),
+ check(fun() -> if element(42, ATuple) and element(42, ATuple) -> ok;
+ true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} =
+ (catch if True and element(42, ATuple) -> ok;
+ element(42, ATuple) and True -> ok;
+ element(42, ATuple) and element(42, ATuple) -> ok
+ end),
+ exit
+ end, exit),
+
+ ok = relprod({'Set',a,b}, {'Set',a,b}),
ok.
@@ -1114,18 +1108,18 @@ relprod(R1, R2) when (erlang:size(R1) =:= 3) and (erlang:element(1,R1) =:= 'Set'
xor_guard(Config) when is_list(Config) ->
%% 'xor' combinations of literal true/false.
- ?line check(fun() -> if true xor false -> ok end end, ok),
- ?line check(fun() -> if false xor true -> ok end end, ok),
- ?line check(fun() -> if true xor true -> ok; true -> error end end, error),
- ?line check(fun() -> if false xor false -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if false xor false -> ok end),
- exit
- end, exit),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if true xor true -> ok end),
- exit
- end, exit),
+ check(fun() -> if true xor false -> ok end end, ok),
+ check(fun() -> if false xor true -> ok end end, ok),
+ check(fun() -> if true xor true -> ok; true -> error end end, error),
+ check(fun() -> if false xor false -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if false xor false -> ok end),
+ exit
+ end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if true xor true -> ok end),
+ exit
+ end, exit),
%% 'xor' combinations using variables containing true/false.
@@ -1133,18 +1127,18 @@ xor_guard(Config) when is_list(Config) ->
True = id(true),
False = id(false),
- ?line check(fun() -> if True xor False -> ok end end, ok),
- ?line check(fun() -> if False xor True -> ok end end, ok),
- ?line check(fun() -> if True xor True -> ok; true -> error end end, error),
- ?line check(fun() -> if False xor False -> ok; true -> error end end, error),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if False xor False -> ok end),
- exit
- end, exit),
- ?line check(fun() ->
- {'EXIT',{if_clause,_}} = (catch if True xor True -> ok end),
- exit
- end, exit),
+ check(fun() -> if True xor False -> ok end end, ok),
+ check(fun() -> if False xor True -> ok end end, ok),
+ check(fun() -> if True xor True -> ok; true -> error end end, error),
+ check(fun() -> if False xor False -> ok; true -> error end end, error),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if False xor False -> ok end),
+ exit
+ end, exit),
+ check(fun() ->
+ {'EXIT',{if_clause,_}} = (catch if True xor True -> ok end),
+ exit
+ end, exit),
ok.
@@ -1153,53 +1147,53 @@ more_xor_guards(Config) when is_list(Config) ->
False = id(false),
ATuple = id({false,true,gurka}),
- ?line check(fun() ->
- if element(42, ATuple) xor False -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if False xor element(42, ATuple) xor False -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(18, ATuple) xor element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if True xor element(42, ATuple) -> ok;
- true -> error end
- end, error),
-
- ?line check(fun() ->
- if element(42, ATuple) xor True -> ok;
- true -> error end
- end, error),
+ check(fun() ->
+ if element(42, ATuple) xor False -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if False xor element(42, ATuple) xor False -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(18, ATuple) xor element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if True xor element(42, ATuple) -> ok;
+ true -> error end
+ end, error),
+
+ check(fun() ->
+ if element(42, ATuple) xor True -> ok;
+ true -> error end
+ end, error),
ok.
build_in_guard(Config) when is_list(Config) ->
SubBin = <<5.0/float>>,
- ?line B = <<1,SubBin/binary,3.5/float>>,
- ?line if
- B =:= <<1,SubBin/binary,3.5/float>> -> ok
- end.
+ B = <<1,SubBin/binary,3.5/float>>,
+ if
+ B =:= <<1,SubBin/binary,3.5/float>> -> ok
+ end.
old_guard_tests(Config) when list(Config) ->
%% Check that all the old guard tests are still recognized.
- ?line list = og(Config),
- ?line atom = og(an_atom),
- ?line binary = og(<<1,2>>),
- ?line float = og(3.14),
- ?line integer = og(43),
- ?line a_function = og(fun() -> ok end),
- ?line pid = og(self()),
- ?line reference = og(make_ref()),
- ?line tuple = og({}),
-
- ?line number = on(45.333),
- ?line number = on(-19),
+ list = og(Config),
+ atom = og(an_atom),
+ binary = og(<<1,2>>),
+ float = og(3.14),
+ integer = og(43),
+ a_function = og(fun() -> ok end),
+ pid = og(self()),
+ reference = og(make_ref()),
+ tuple = og({}),
+
+ number = on(45.333),
+ number = on(-19),
ok.
og(V) when atom(V) -> atom;
@@ -1218,8 +1212,8 @@ on(V) when number(V) -> number;
on(_) -> not_number.
gbif(Config) when is_list(Config) ->
- ?line error = gbif_1(1, {false,true}),
- ?line ok = gbif_1(2, {false,true}),
+ error = gbif_1(1, {false,true}),
+ ok = gbif_1(2, {false,true}),
ok.
gbif_1(P, T) when element(P, T) -> ok;
@@ -1227,49 +1221,49 @@ gbif_1(_, _) -> error.
t_is_boolean(Config) when is_list(Config) ->
- ?line true = is_boolean(true),
- ?line true = is_boolean(false),
- ?line true = is_boolean(id(true)),
- ?line true = is_boolean(id(false)),
-
- ?line false = is_boolean(glurf),
- ?line false = is_boolean(id(glurf)),
-
- ?line false = is_boolean([]),
- ?line false = is_boolean(id([])),
- ?line false = is_boolean(42),
- ?line false = is_boolean(id(-42)),
-
- ?line false = is_boolean(math:pi()),
- ?line false = is_boolean(384793478934378924978439789873478934897),
-
- ?line false = is_boolean(id(self())),
- ?line false = is_boolean(id({x,y,z})),
- ?line false = is_boolean(id([a,b,c])),
- ?line false = is_boolean(id(make_ref())),
- ?line false = is_boolean(id(<<1,2,3>>)),
-
- ?line ok = bool(true),
- ?line ok = bool(false),
- ?line ok = bool(id(true)),
- ?line ok = bool(id(false)),
-
- ?line error = bool(glurf),
- ?line error = bool(id(glurf)),
-
- ?line error = bool([]),
- ?line error = bool(id([])),
- ?line error = bool(42),
- ?line error = bool(id(-42)),
-
- ?line error = bool(math:pi()),
- ?line error = bool(384793478934378924978439789873478934897),
-
- ?line error = bool(id(self())),
- ?line error = bool(id({x,y,z})),
- ?line error = bool(id([a,b,c])),
- ?line error = bool(id(make_ref())),
- ?line error = bool(id(<<1,2,3>>)),
+ true = is_boolean(true),
+ true = is_boolean(false),
+ true = is_boolean(id(true)),
+ true = is_boolean(id(false)),
+
+ false = is_boolean(glurf),
+ false = is_boolean(id(glurf)),
+
+ false = is_boolean([]),
+ false = is_boolean(id([])),
+ false = is_boolean(42),
+ false = is_boolean(id(-42)),
+
+ false = is_boolean(math:pi()),
+ false = is_boolean(384793478934378924978439789873478934897),
+
+ false = is_boolean(id(self())),
+ false = is_boolean(id({x,y,z})),
+ false = is_boolean(id([a,b,c])),
+ false = is_boolean(id(make_ref())),
+ false = is_boolean(id(<<1,2,3>>)),
+
+ ok = bool(true),
+ ok = bool(false),
+ ok = bool(id(true)),
+ ok = bool(id(false)),
+
+ error = bool(glurf),
+ error = bool(id(glurf)),
+
+ error = bool([]),
+ error = bool(id([])),
+ error = bool(42),
+ error = bool(id(-42)),
+
+ error = bool(math:pi()),
+ error = bool(384793478934378924978439789873478934897),
+
+ error = bool(id(self())),
+ error = bool(id({x,y,z})),
+ error = bool(id([a,b,c])),
+ error = bool(id(make_ref())),
+ error = bool(id(<<1,2,3>>)),
ok.
@@ -1289,14 +1283,14 @@ is_function_2(Config) when is_list(Config) ->
end.
tricky(Config) when is_list(Config) ->
- ?line not_ok = tricky_1(1, 2),
- ?line not_ok = tricky_1(1, blurf),
- ?line not_ok = tricky_1(foo, 2),
- ?line not_ok = tricky_1(a, b),
-
- ?line false = rb(100000, [1], 42),
- ?line true = rb(100000, [], 42),
- ?line true = rb(555, [a,b,c], 19),
+ not_ok = tricky_1(1, 2),
+ not_ok = tricky_1(1, blurf),
+ not_ok = tricky_1(foo, 2),
+ not_ok = tricky_1(a, b),
+
+ false = rb(100000, [1], 42),
+ true = rb(100000, [], 42),
+ true = rb(555, [a,b,c], 19),
ok.
tricky_1(X, Y) when abs((X == 1) or (Y == 2)) -> ok;
@@ -1331,66 +1325,66 @@ rb(_, _, _) -> false.
rel_ops(Config) when is_list(Config) ->
- ?line ?T(=/=, 1, 1.0),
- ?line ?F(=/=, 2, 2),
- ?line ?F(=/=, {a}, {a}),
+ ?T(=/=, 1, 1.0),
+ ?F(=/=, 2, 2),
+ ?F(=/=, {a}, {a}),
- ?line ?F(/=, a, a),
- ?line ?F(/=, 0, 0.0),
- ?line ?T(/=, 0, 1),
- ?line ?F(/=, {a}, {a}),
+ ?F(/=, a, a),
+ ?F(/=, 0, 0.0),
+ ?T(/=, 0, 1),
+ ?F(/=, {a}, {a}),
- ?line ?T(==, 1, 1.0),
- ?line ?F(==, a, {}),
+ ?T(==, 1, 1.0),
+ ?F(==, a, {}),
- ?line ?F(=:=, 1, 1.0),
- ?line ?T(=:=, 42.0, 42.0),
+ ?F(=:=, 1, 1.0),
+ ?T(=:=, 42.0, 42.0),
- ?line ?F(>, a, b),
- ?line ?T(>, 42, 1.0),
- ?line ?F(>, 42, 42.0),
+ ?F(>, a, b),
+ ?T(>, 42, 1.0),
+ ?F(>, 42, 42.0),
- ?line ?T(<, a, b),
- ?line ?F(<, 42, 1.0),
- ?line ?F(<, 42, 42.0),
+ ?T(<, a, b),
+ ?F(<, 42, 1.0),
+ ?F(<, 42, 42.0),
- ?line ?T(=<, 1.5, 5),
- ?line ?F(=<, -9, -100.344),
- ?line ?T(=<, 42, 42.0),
+ ?T(=<, 1.5, 5),
+ ?F(=<, -9, -100.344),
+ ?T(=<, 42, 42.0),
- ?line ?T(>=, 42, 42.0),
- ?line ?F(>=, a, b),
- ?line ?T(>=, 1.0, 0),
+ ?T(>=, 42, 42.0),
+ ?F(>=, a, b),
+ ?T(>=, 1.0, 0),
ok.
-undef(TestOp).
basic_andalso_orelse(Config) when is_list(Config) ->
- ?line T = id({type,integers,23,42}),
- ?line 65 = if
- ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
- element(2, T) == integers) ->
- element(3, T) + element(4, T);
- true -> error
- end,
- ?line 65 = case [] of
- [] when ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
- element(2, T) == integers) ->
- element(3, T) + element(4, T)
- end,
-
- ?line 42 = basic_rt({type,integers,40,2}),
- ?line 5.0 = basic_rt({vector,{3.0,4.0}}),
- ?line 20 = basic_rt(['+',3,7]),
- ?line {'Set',a,b} = basic_rt({{'Set',a,b},{'Set',a,b}}),
- ?line 12 = basic_rt({klurf,4}),
-
- ?line error = basic_rt({type,integers,40,2,3}),
- ?line error = basic_rt({kalle,integers,40,2}),
- ?line error = basic_rt({kalle,integers,40,2}),
- ?line error = basic_rt({1,2}),
- ?line error = basic_rt([]),
+ T = id({type,integers,23,42}),
+ 65 = if
+ ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
+ element(2, T) == integers) ->
+ element(3, T) + element(4, T);
+ true -> error
+ end,
+ 65 = case [] of
+ [] when ((element(1, T) =:= type) andalso (size(T) =:= 4) andalso
+ element(2, T) == integers) ->
+ element(3, T) + element(4, T)
+ end,
+
+ 42 = basic_rt({type,integers,40,2}),
+ 5.0 = basic_rt({vector,{3.0,4.0}}),
+ 20 = basic_rt(['+',3,7]),
+ {'Set',a,b} = basic_rt({{'Set',a,b},{'Set',a,b}}),
+ 12 = basic_rt({klurf,4}),
+
+ error = basic_rt({type,integers,40,2,3}),
+ error = basic_rt({kalle,integers,40,2}),
+ error = basic_rt({kalle,integers,40,2}),
+ error = basic_rt({1,2}),
+ error = basic_rt([]),
RelProdBody =
fun(R1, R2) ->
@@ -1401,7 +1395,7 @@ basic_andalso_orelse(Config) when is_list(Config) ->
end
end,
- ?line ok = RelProdBody({'Set',a,b}, {'Set',a,b}),
+ ok = RelProdBody({'Set',a,b}, {'Set',a,b}),
ok.
basic_rt(T) when is_tuple(T) andalso size(T) =:= 4 andalso element(1, T) =:= type andalso
@@ -1445,9 +1439,9 @@ traverse_dcd(Config) when is_list(Config) ->
traverse_dcd({Cont,[LogH|Rest]},Log,Fun)
when is_tuple(LogH) andalso size(LogH) =:= 6 andalso element(1, LogH) =:= log_header
-andalso erlang:element(2,LogH) == dcd_log,
-is_tuple(LogH) andalso size(LogH) =:= 6 andalso element(1, LogH) =:= log_header
-andalso erlang:element(3,LogH) >= "1.0" ->
+ andalso erlang:element(2,LogH) == dcd_log,
+ is_tuple(LogH) andalso size(LogH) =:= 6 andalso element(1, LogH) =:= log_header
+ andalso erlang:element(3,LogH) >= "1.0" ->
traverse_dcd({Cont,Rest},Log,Fun);
traverse_dcd({Cont,Recs},Log,Fun) ->
{Cont,Recs,Log,Fun}.
@@ -1455,14 +1449,14 @@ traverse_dcd({Cont,Recs},Log,Fun) ->
check_qlc_hrl(Config) when is_list(Config) ->
St = {r1,false,dum},
- ?line foo = cqlc(qlc, q, [{lc,1,2,3}], St),
- ?line foo = cqlc(qlc, q, [{lc,1,2,3},b], St),
- ?line St = cqlc(qlc, q, [], St),
- ?line St = cqlc(qlc, blurf, [{lc,1,2,3},b], St),
- ?line St = cqlc(q, q, [{lc,1,2,3},b], St),
- ?line St = cqlc(qlc, q, [{lc,1,2,3},b,c], St),
- ?line St = cqlc(qlc, q, [a,b], St),
- ?line {r1,true,kalle} = cqlc(qlc, q, [{lc,1,2,3},b], {r1,true,kalle}),
+ foo = cqlc(qlc, q, [{lc,1,2,3}], St),
+ foo = cqlc(qlc, q, [{lc,1,2,3},b], St),
+ St = cqlc(qlc, q, [], St),
+ St = cqlc(qlc, blurf, [{lc,1,2,3},b], St),
+ St = cqlc(q, q, [{lc,1,2,3},b], St),
+ St = cqlc(qlc, q, [{lc,1,2,3},b,c], St),
+ St = cqlc(qlc, q, [a,b], St),
+ {r1,true,kalle} = cqlc(qlc, q, [{lc,1,2,3},b], {r1,true,kalle}),
ok.
%% From erl_lint.erl; original name was check_qlc_hrl/4.
@@ -1479,29 +1473,29 @@ cqlc(M, F, As, St) ->
%% OTP-7679: Thanks to Hunter Morris.
andalso_semi(Config) when is_list(Config) ->
- ?line ok = andalso_semi_foo(0),
- ?line ok = andalso_semi_foo(1),
- ?line fc(catch andalso_semi_foo(2)),
+ ok = andalso_semi_foo(0),
+ ok = andalso_semi_foo(1),
+ fc(catch andalso_semi_foo(2)),
- ?line ok = andalso_semi_bar([a,b,c]),
- ?line ok = andalso_semi_bar(1),
- ?line fc(catch andalso_semi_bar([a,b])),
+ ok = andalso_semi_bar([a,b,c]),
+ ok = andalso_semi_bar(1),
+ fc(catch andalso_semi_bar([a,b])),
ok.
andalso_semi_foo(Bar) when is_integer(Bar) andalso Bar =:= 0; Bar =:= 1 ->
- ok.
+ ok.
andalso_semi_bar(Bar) when is_list(Bar) andalso length(Bar) =:= 3; Bar =:= 1 ->
- ok.
+ ok.
t_tuple_size(Config) when is_list(Config) ->
- ?line 10 = do_tuple_size({1,2,3,4}),
- ?line fc(catch do_tuple_size({1,2,3})),
- ?line fc(catch do_tuple_size(42)),
+ 10 = do_tuple_size({1,2,3,4}),
+ fc(catch do_tuple_size({1,2,3})),
+ fc(catch do_tuple_size(42)),
- ?line error = ludicrous_tuple_size({a,b,c}),
- ?line error = ludicrous_tuple_size([a,b,c]),
+ error = ludicrous_tuple_size({a,b,c}),
+ error = ludicrous_tuple_size([a,b,c]),
ok.
@@ -1528,77 +1522,76 @@ mask_error({'EXIT',{Err,_}}) ->
mask_error(Else) ->
Else.
-binary_part(doc) ->
- ["Tests the binary_part/2,3 guard (GC) bif's"];
+%% Tests the binary_part/2,3 guard (GC) bif's.
binary_part(Config) when is_list(Config) ->
%% This is more or less a copy of what the guard_SUITE in emulator
%% does to cover the guard bif's
- ?line 1 = bptest(<<1,2,3>>),
- ?line 2 = bptest(<<2,1,3>>),
- ?line error = bptest(<<1>>),
- ?line error = bptest(<<>>),
- ?line error = bptest(apa),
- ?line 3 = bptest(<<2,3,3>>),
- % With one variable (pos)
- ?line 1 = bptest(<<1,2,3>>,1),
- ?line 2 = bptest(<<2,1,3>>,1),
- ?line error = bptest(<<1>>,1),
- ?line error = bptest(<<>>,1),
- ?line error = bptest(apa,1),
- ?line 3 = bptest(<<2,3,3>>,1),
- % With one variable (length)
- ?line 1 = bptesty(<<1,2,3>>,1),
- ?line 2 = bptesty(<<2,1,3>>,1),
- ?line error = bptesty(<<1>>,1),
- ?line error = bptesty(<<>>,1),
- ?line error = bptesty(apa,1),
- ?line 3 = bptesty(<<2,3,3>>,2),
- % With one variable (whole tuple)
- ?line 1 = bptestx(<<1,2,3>>,{1,1}),
- ?line 2 = bptestx(<<2,1,3>>,{1,1}),
- ?line error = bptestx(<<1>>,{1,1}),
- ?line error = bptestx(<<>>,{1,1}),
- ?line error = bptestx(apa,{1,1}),
- ?line 3 = bptestx(<<2,3,3>>,{1,2}),
- % With two variables
- ?line 1 = bptest(<<1,2,3>>,1,1),
- ?line 2 = bptest(<<2,1,3>>,1,1),
- ?line error = bptest(<<1>>,1,1),
- ?line error = bptest(<<>>,1,1),
- ?line error = bptest(apa,1,1),
- ?line 3 = bptest(<<2,3,3>>,1,2),
- % Direct (autoimported) call, these will be evaluated by the compiler...
- ?line <<2>> = binary_part(<<1,2,3>>,1,1),
- ?line <<1>> = binary_part(<<2,1,3>>,1,1),
- % Compiler warnings due to constant evaluation expected (3)
- ?line badarg = ?MASK_ERROR(binary_part(<<1>>,1,1)),
- ?line badarg = ?MASK_ERROR(binary_part(<<>>,1,1)),
- ?line badarg = ?MASK_ERROR(binary_part(apa,1,1)),
- ?line <<3,3>> = binary_part(<<2,3,3>>,1,2),
- % Direct call through apply
- ?line <<2>> = apply(erlang,binary_part,[<<1,2,3>>,1,1]),
- ?line <<1>> = apply(erlang,binary_part,[<<2,1,3>>,1,1]),
- % Compiler warnings due to constant evaluation expected (3)
- ?line badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<1>>,1,1])),
- ?line badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<>>,1,1])),
- ?line badarg = ?MASK_ERROR(apply(erlang,binary_part,[apa,1,1])),
- ?line <<3,3>> = apply(erlang,binary_part,[<<2,3,3>>,1,2]),
- % Constant propagation
- ?line Bin = <<1,2,3>>,
- ?line ok = if
- binary_part(Bin,1,1) =:= <<2>> ->
- ok;
- %% Compiler warning, clause cannot match (expected)
- true ->
- error
- end,
- ?line ok = if
- binary_part(Bin,{1,1}) =:= <<2>> ->
- ok;
- %% Compiler warning, clause cannot match (expected)
- true ->
- error
- end,
+ 1 = bptest(<<1,2,3>>),
+ 2 = bptest(<<2,1,3>>),
+ error = bptest(<<1>>),
+ error = bptest(<<>>),
+ error = bptest(apa),
+ 3 = bptest(<<2,3,3>>),
+ %% With one variable (pos)
+ 1 = bptest(<<1,2,3>>,1),
+ 2 = bptest(<<2,1,3>>,1),
+ error = bptest(<<1>>,1),
+ error = bptest(<<>>,1),
+ error = bptest(apa,1),
+ 3 = bptest(<<2,3,3>>,1),
+ %% With one variable (length)
+ 1 = bptesty(<<1,2,3>>,1),
+ 2 = bptesty(<<2,1,3>>,1),
+ error = bptesty(<<1>>,1),
+ error = bptesty(<<>>,1),
+ error = bptesty(apa,1),
+ 3 = bptesty(<<2,3,3>>,2),
+ %% With one variable (whole tuple)
+ 1 = bptestx(<<1,2,3>>,{1,1}),
+ 2 = bptestx(<<2,1,3>>,{1,1}),
+ error = bptestx(<<1>>,{1,1}),
+ error = bptestx(<<>>,{1,1}),
+ error = bptestx(apa,{1,1}),
+ 3 = bptestx(<<2,3,3>>,{1,2}),
+ %% With two variables
+ 1 = bptest(<<1,2,3>>,1,1),
+ 2 = bptest(<<2,1,3>>,1,1),
+ error = bptest(<<1>>,1,1),
+ error = bptest(<<>>,1,1),
+ error = bptest(apa,1,1),
+ 3 = bptest(<<2,3,3>>,1,2),
+ %% Direct (autoimported) call, these will be evaluated by the compiler...
+ <<2>> = binary_part(<<1,2,3>>,1,1),
+ <<1>> = binary_part(<<2,1,3>>,1,1),
+ %% Compiler warnings due to constant evaluation expected (3)
+ badarg = ?MASK_ERROR(binary_part(<<1>>,1,1)),
+ badarg = ?MASK_ERROR(binary_part(<<>>,1,1)),
+ badarg = ?MASK_ERROR(binary_part(apa,1,1)),
+ <<3,3>> = binary_part(<<2,3,3>>,1,2),
+ %% Direct call through apply
+ <<2>> = apply(erlang,binary_part,[<<1,2,3>>,1,1]),
+ <<1>> = apply(erlang,binary_part,[<<2,1,3>>,1,1]),
+ %% Compiler warnings due to constant evaluation expected (3)
+ badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<1>>,1,1])),
+ badarg = ?MASK_ERROR(apply(erlang,binary_part,[<<>>,1,1])),
+ badarg = ?MASK_ERROR(apply(erlang,binary_part,[apa,1,1])),
+ <<3,3>> = apply(erlang,binary_part,[<<2,3,3>>,1,2]),
+ %% Constant propagation
+ Bin = <<1,2,3>>,
+ ok = if
+ binary_part(Bin,1,1) =:= <<2>> ->
+ ok;
+ %% Compiler warning, clause cannot match (expected)
+ true ->
+ error
+ end,
+ ok = if
+ binary_part(Bin,{1,1}) =:= <<2>> ->
+ ok;
+ %% Compiler warning, clause cannot match (expected)
+ true ->
+ error
+ end,
ok.
@@ -1659,24 +1652,24 @@ bptest(_,_,_) ->
-define(FAILING(C),
if
- C -> ?t:fail(should_fail);
+ C -> ct:fail(should_fail);
true -> ok
end,
if
- true, C -> ?t:fail(should_fail);
+ true, C -> ct:fail(should_fail);
true -> ok
end).
bad_constants(Config) when is_list(Config) ->
- ?line ?FAILING(false),
- ?line ?FAILING([]),
- ?line ?FAILING([a]),
- ?line ?FAILING([Config]),
- ?line ?FAILING({a,b}),
- ?line ?FAILING({a,Config}),
- ?line ?FAILING(<<1>>),
- ?line ?FAILING(42),
- ?line ?FAILING(3.14),
+ ?FAILING(false),
+ ?FAILING([]),
+ ?FAILING([a]),
+ ?FAILING([Config]),
+ ?FAILING({a,b}),
+ ?FAILING({a,Config}),
+ ?FAILING(<<1>>),
+ ?FAILING(42),
+ ?FAILING(3.14),
ok.
%% Call this function to turn off constant propagation.
@@ -1688,7 +1681,7 @@ check(F, Result) ->
Other ->
io:format("Expected: ~p\n", [Result]),
io:format(" Got: ~p\n", [Other]),
- test_server:fail()
+ ct:fail(failed)
end.
fc({'EXIT',{function_clause,_}}) -> ok.
diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl
index 5f2e4dd84d..f697ace4e5 100644
--- a/lib/debugger/test/int_SUITE.erl
+++ b/lib/debugger/test/int_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
%%
-module(int_SUITE).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
%% Test server specific exports
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
@@ -31,37 +31,30 @@
-export([interpret/1, guards/1, interpretable/1]).
-export([ append_1/1, append_2/1, member/1, reverse/1]).
-%% Default timetrap timeout (set in init_per_testcase)
--define(default_timeout, ?t:minutes(1)).
-
init_per_testcase(interpretable, Config) ->
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config];
+ Config;
init_per_testcase(_Case, Config) ->
%% Interpret some existing and non-existing modules
- ?line DataDir = ?config(data_dir, Config),
- ?line {module, lists1} = int:i(filename:join([DataDir,lists1])),
- ?line {module, guards} = int:i(filename:join([DataDir,guards])),
+ DataDir = proplists:get_value(data_dir, Config),
+ {module, lists1} = int:i(filename:join([DataDir,lists1])),
+ {module, guards} = int:i(filename:join([DataDir,guards])),
- ?line Dog=test_server:timetrap(?default_timeout),
- [{watchdog, Dog}|Config].
+ Config.
-end_per_testcase(interpretable, Config) ->
- ?line Dog=?config(watchdog, Config),
- ?line test_server:timetrap_cancel(Dog),
+end_per_testcase(interpretable, _Config) ->
ok;
end_per_testcase(_Case, Config) ->
%% Quit interpreting
- ?line ok = int:n(lists1),
- ?line ok = int:n(guards),
+ ok = int:n(lists1),
+ ok = int:n(guards),
- ?line Dog=?config(watchdog, Config),
- ?line test_server:timetrap_cancel(Dog),
- ?line ok.
+ ok.
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[interpret, guards, {group, list_suite}, interpretable].
@@ -71,6 +64,14 @@ groups() ->
{append, [], [append_1, append_2]}].
init_per_suite(Config) ->
+ DataDir = proplists:get_value(data_dir, Config),
+ {ok,OldCwd} = file:get_cwd(),
+ try
+ ok = file:set_cwd(DataDir),
+ make:all()
+ after
+ file:set_cwd(OldCwd)
+ end,
Config.
end_per_suite(_Config) ->
@@ -83,83 +84,62 @@ end_per_group(_GroupName, Config) ->
Config.
-interpret(suite) ->
- [];
-interpret(doc) ->
- ["Interpreting modules"];
+%% Interpreting modules.
interpret(Config) when is_list(Config) ->
- ?line int:n(int:interpreted()),
+ int:n(int:interpreted()),
%% Interpret some existing and non-existing modules
- ?line DataDir = ?config(data_dir, Config),
- ?line {module, lists1} = int:i(filename:join([DataDir,lists1])),
- ?line {module, ordsets1} = int:i(filename:join([DataDir,ordsets1])),
- ?line error = int:i(non_existent_module),
+ DataDir = proplists:get_value(data_dir, Config),
+ {module, lists1} = int:i(filename:join([DataDir,lists1])),
+ {module, ordsets1} = int:i(filename:join([DataDir,ordsets1])),
+ error = int:i(non_existent_module),
%% Check that the interpreter has the right view.
- ?line ExpectedResult = lists:sort([lists1, ordsets1]),
- ?line Result = int:interpreted(),
- ?line ExpectedResult = lists:sort(Result),
+ ExpectedResult = lists:sort([lists1, ordsets1]),
+ Result = int:interpreted(),
+ ExpectedResult = lists:sort(Result),
%% Uniterpret the modules.
- ?line ok = int:n(non_existent_module),
- ?line ok = int:n(lists1),
- ?line [ordsets1] = int:interpreted(),
- ?line ok = int:n("ordsets1"),
- ?line [] = int:interpreted(),
+ ok = int:n(non_existent_module),
+ ok = int:n(lists1),
+ [ordsets1] = int:interpreted(),
+ ok = int:n("ordsets1"),
+ [] = int:interpreted(),
ok.
-guards(suite) ->
- [];
-guards(doc) ->
- "Evaluate guards.";
+%% Evaluate guards.
guards(Config) when is_list(Config) ->
ok = guards:guards().
-
-
-
-append_1(suite) ->
- [];
-append_1(doc) ->
- [];
append_1(Config) when is_list(Config) ->
- ?line test_server:format("In append_1~n"),
- ?line test_server:format("code:which(lists1)=~p~n",
- [code:which(lists1)]),
- ?line test_server:format("lists1:append([a],[b])=~p~n",
- [spawn_eval(lists1,append,[[a],[b]])]),
-
- ?line "abcdef"=spawn_eval(lists1,append,[["abc","def"]]),
- ?line [hej, du,[glade, [bagare]]]=
+ io:format("In append_1~n"),
+ io:format("code:which(lists1)=~p~n",
+ [code:which(lists1)]),
+ io:format("lists1:append([a],[b])=~p~n",
+ [spawn_eval(lists1,append,[[a],[b]])]),
+
+ "abcdef"=spawn_eval(lists1,append,[["abc","def"]]),
+ [hej, du,[glade, [bagare]]]=
spawn_eval(lists1,append,[[[hej], [du], [[glade, [bagare]]]]]),
- ?line [10, [elem]]=spawn_eval(lists1,append,[[[10], [[elem]]]]),
+ [10, [elem]]=spawn_eval(lists1,append,[[[10], [[elem]]]]),
ok.
-append_2(suite) ->
- [];
-append_2(doc) ->
- [];
append_2(Config) when is_list(Config) ->
- ?line test_server:format("In append_2~n"),
- ?line test_server:format("code:which(lists1)=~p~n",
- [code:which(lists1)]),
+ io:format("In append_2~n"),
+ io:format("code:which(lists1)=~p~n",
+ [code:which(lists1)]),
- ?line "abcdef"=spawn_eval(lists1,append,["abc", "def"]),
- ?line [hej, du]=spawn_eval(lists1,append,[[hej], [du]]),
- ?line [10, [elem]]=spawn_eval(lists1,append,[[10], [[elem]]]),
+ "abcdef"=spawn_eval(lists1,append,["abc", "def"]),
+ [hej, du]=spawn_eval(lists1,append,[[hej], [du]]),
+ [10, [elem]]=spawn_eval(lists1,append,[[10], [[elem]]]),
ok.
-reverse(suite) ->
- [];
-reverse(doc) ->
- [];
reverse(Config) when is_list(Config) ->
- ?line ok=reverse_test(0),
- ?line ok=reverse_test(1),
- ?line ok=reverse_test(2),
- ?line ok=reverse_test(537),
+ ok=reverse_test(0),
+ ok=reverse_test(1),
+ ok=reverse_test(2),
+ ok=reverse_test(537),
ok.
reverse_test(0) ->
@@ -179,19 +159,16 @@ reverse_test(Num) ->
error
end.
-member(suite) ->
- [];
-member(doc) ->
- ["Tests the lists1:member() implementation. The function "
- "is `non-blocking', and only processes 2000 elements "
- "at a time.",
- "This test case depends on lists1:reverse() to work, "
- "wich is tested in a separate test case."];
+%% Tests the lists1:member() implementation. The function
+%% is `non-blocking', and only processes 2000 elements
+%% at a time.
+%% This test case depends on lists1:reverse() to work,
+%% which is tested in a separate test case.
member(Config) when list(Config) ->
- ?line ok=member_test(0),
- ?line ok=member_test(1),
- ?line ok=member_test(100),
- ?line ok=member_test(537),
+ ok=member_test(0),
+ ok=member_test(1),
+ ok=member_test(100),
+ ok=member_test(537),
ok.
member_test(0) ->
@@ -223,69 +200,79 @@ spawn_eval(M,F,A) ->
evaluator(Pid, M,F,A) ->
Pid ! (catch apply(M,F,A)).
-interpretable(suite) ->
- [];
-interpretable(doc) ->
- ["Test int:interpretable/1"];
+%% Test int:interpretable/1.
interpretable(Config) when is_list(Config) ->
%% First make sure that 'lists1' is not loaded
case code:is_loaded(lists1) of
{file, _Loaded} ->
- ?line code:purge(lists1),
- ?line code:delete(lists1),
- ?line code:purge(lists1);
+ code:purge(lists1),
+ code:delete(lists1),
+ code:purge(lists1);
false -> ignore
end,
%% true
- ?line DataDir = filename:dirname(?config(data_dir, Config)),
- ?line true = code:add_patha(DataDir),
- ?line true = int:interpretable(lists1),
- ?line true = int:interpretable(filename:join([DataDir,lists1])),
- ?line true = code:del_path(DataDir),
-
- %% {error, no_src}
- ?line PrivDir = filename:join(?config(priv_dir, Config), ""),
- ?line {ok, _} = file:copy(filename:join([DataDir,"lists1.beam"]),
- filename:join([PrivDir,"lists1.beam"])),
- ?line true = code:add_patha(PrivDir),
-
- ?line {error, no_src} = int:interpretable(lists1),
- ?line ok = file:delete(filename:join([PrivDir,"lists1.beam"])),
+ DataDir = filename:dirname(proplists:get_value(data_dir, Config)),
+ true = code:add_patha(DataDir),
+ true = int:interpretable(lists1),
+ true = int:interpretable(filename:join([DataDir,lists1])),
+ true = code:del_path(DataDir),
+
+ %% true (from source)
+ PrivDir = filename:join(proplists:get_value(priv_dir, Config), ""),
+ {ok, _} = file:copy(filename:join([DataDir,"lists1.beam"]),
+ filename:join([PrivDir,"lists1.beam"])),
+ true = code:add_patha(PrivDir),
+ true = int:interpretable(lists1),
+ ok = file:delete(filename:join([PrivDir,"lists1.beam"])),
%% {error, no_beam}
Src = filename:join([PrivDir,"lists1.erl"]),
- ?line {ok, _} = file:copy(filename:join([DataDir,"lists1.erl"]),
- Src),
- ?line {error, no_beam} = int:interpretable(Src),
+ {ok, _} = file:copy(filename:join([DataDir,"lists1.erl"]),
+ Src),
+ {error, no_beam} = int:interpretable(Src),
%% {error, no_debug_info}
- ?line {ok, _} = compile:file(Src, [{outdir,PrivDir}]),
- ?line {error, no_debug_info} = int:interpretable(Src),
- ?line {error, no_debug_info} = int:interpretable(lists1),
- ?line ok = file:delete(Src),
- ?line true = code:del_path(PrivDir),
+ {ok, _} = compile:file(Src, [{outdir,PrivDir}]),
+ {error, no_debug_info} = int:interpretable(Src),
+ {error, no_debug_info} = int:interpretable(lists1),
+ ok = file:delete(Src),
+ true = code:del_path(PrivDir),
+
+ %% {error, no_src}
+ {ok, lists2, Binary} = compile:forms([{attribute,1,module,lists2}], []),
+ code:load_binary(lists2, "unknown", Binary),
+ {error, no_src} = int:interpretable(lists2),
%% {error, badarg}
- ?line {error, badarg} = int:interpretable(pride),
- ?line {error, badarg} = int:interpretable("prejudice.erl"),
+ {error, badarg} = int:interpretable(pride),
+ {error, badarg} = int:interpretable("prejudice.erl"),
%% {error, {app,App}}
- ?line {error, {app,_}} = int:interpretable(file),
- ?line {error, {app,_}} = int:interpretable(lists),
- ?line case int:interpretable(dbg_ieval) of
- {error, {app,_}} ->
- ok;
- {error, badarg} ->
- case code:which(dbg_ieval) of
- cover_compiled ->
- ok;
- Other1 ->
- ?line ?t:fail({unexpected_result, Other1})
- end;
- Other2 ->
- ?line ?t:fail({unexpected_result, Other2})
- end,
-
+ case filename:basename(code:lib_dir(kernel)) of
+ "kernel" ->
+ %% Development system (not installed). We are allowed
+ %% to interpret modules in kernel and stdlib
+ %% (at our own risk).
+ ok;
+ "kernel-" ++ _ ->
+ %% Installed system. Certain applications (including
+ %% kernel and stdlib) cannot be interpreted.
+ {error, {app,_}} = int:interpretable(file),
+ {error, {app,_}} = int:interpretable(lists),
+ case int:interpretable(dbg_ieval) of
+ {error, {app,_}} ->
+ ok;
+ {error, badarg} ->
+ case code:which(dbg_ieval) of
+ cover_compiled ->
+ ok;
+ Other1 ->
+ ct:fail({unexpected_result, Other1})
+ end;
+ Other2 ->
+ ct:fail({unexpected_result, Other2})
+ end
+ end,
ok.
diff --git a/lib/debugger/test/int_SUITE_data/Emakefile b/lib/debugger/test/int_SUITE_data/Emakefile
new file mode 100644
index 0000000000..6158d66764
--- /dev/null
+++ b/lib/debugger/test/int_SUITE_data/Emakefile
@@ -0,0 +1 @@
+{[guards,lists1,my_lists,ordsets1,test,test1],[{outdir,"."},debug_info]}.
diff --git a/lib/debugger/test/int_SUITE_data/Makefile.src b/lib/debugger/test/int_SUITE_data/Makefile.src
deleted file mode 100644
index 0bbb90734f..0000000000
--- a/lib/debugger/test/int_SUITE_data/Makefile.src
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
-#
-# 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.
-#
-# %CopyrightEnd%
-#
-EFLAGS=+debug_info
-all: guards.@EMULATOR@ lists1.@EMULATOR@ my_lists.@EMULATOR@ \
- ordsets1.@EMULATOR@ test.@EMULATOR@ test1.@EMULATOR@
-
-guards.@EMULATOR@: guards.erl
- erlc $(EFLAGS) guards.erl
-
-lists1.@EMULATOR@: lists1.erl
- erlc $(EFLAGS) lists1.erl
-
-my_lists.@EMULATOR@: my_lists.erl
- erlc $(EFLAGS) my_lists.erl
-
-ordsets1.@EMULATOR@: ordsets1.erl
- erlc $(EFLAGS) ordsets1.erl
-
-test.@EMULATOR@: test.erl
- erlc $(EFLAGS) test.erl
-
-test1.@EMULATOR@: test1.erl
- erlc $(EFLAGS) test1.erl
diff --git a/lib/debugger/test/int_SUITE_data/guards.erl b/lib/debugger/test/int_SUITE_data/guards.erl
index d148974e53..b790bc5934 100644
--- a/lib/debugger/test/int_SUITE_data/guards.erl
+++ b/lib/debugger/test/int_SUITE_data/guards.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/lists1.erl b/lib/debugger/test/int_SUITE_data/lists1.erl
index c26ccfceda..32aabfcbb9 100644
--- a/lib/debugger/test/int_SUITE_data/lists1.erl
+++ b/lib/debugger/test/int_SUITE_data/lists1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/my_lists.erl b/lib/debugger/test/int_SUITE_data/my_lists.erl
index 0ec2a7585f..dade8e824c 100644
--- a/lib/debugger/test/int_SUITE_data/my_lists.erl
+++ b/lib/debugger/test/int_SUITE_data/my_lists.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/ordsets1.erl b/lib/debugger/test/int_SUITE_data/ordsets1.erl
index 349921b951..f96548a52c 100644
--- a/lib/debugger/test/int_SUITE_data/ordsets1.erl
+++ b/lib/debugger/test/int_SUITE_data/ordsets1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/test.erl b/lib/debugger/test/int_SUITE_data/test.erl
index b29394302b..c2165a9856 100644
--- a/lib/debugger/test/int_SUITE_data/test.erl
+++ b/lib/debugger/test/int_SUITE_data/test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_SUITE_data/test1.erl b/lib/debugger/test/int_SUITE_data/test1.erl
index cb60c67bc4..2a7b8ab329 100644
--- a/lib/debugger/test/int_SUITE_data/test1.erl
+++ b/lib/debugger/test/int_SUITE_data/test1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_break_SUITE.erl b/lib/debugger/test/int_break_SUITE.erl
index 21b53a8d30..9894c27b81 100644
--- a/lib/debugger/test/int_break_SUITE.erl
+++ b/lib/debugger/test/int_break_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
%% Test break points.
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
@@ -31,7 +31,9 @@
-export([auto_attach/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, cleanup].
@@ -53,38 +55,33 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line Mod = ordsets1,
- ?line {module,Mod} = int:i(filename:join(DataDir, Mod)),
- ?line ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
- ?line Dog = test_server:timetrap(?t:minutes(0.5)),
- [{watchdog,Dog}|Config].
-
-end_per_testcase(_Case, Config) ->
- ?line ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
- ?line Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+ DataDir = proplists:get_value(data_dir, Config),
+ Mod = ordsets1,
+ {module,Mod} = int:i(filename:join(DataDir, Mod)),
+ ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
+ Config.
+
+end_per_testcase(_Case, _Config) ->
+ ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
ok.
-basic(doc) -> "Tests setting a few break points.";
-basic(suite) -> [];
+%% Tests setting a few break points.
basic(Config) when list(Config) ->
- ?line int:auto_attach([init], {?MODULE,auto_attach}),
- ?line S1 = [] = ordsets1:new_set(),
- ?line ok = i:ib(ordsets1, 86),
- ?line S2 = [xxx] = ordsets1:add_element(xxx, S1),
- ?line S3 = [xxx,y] = ordsets1:add_element(y, S2),
- ?line ok = i:ib(ordsets1, union, 2),
- ?line [xxx,y,z] = ordsets1:union(S3, [z]),
+ int:auto_attach([init], {?MODULE,auto_attach}),
+ S1 = [] = ordsets1:new_set(),
+ ok = i:ib(ordsets1, 86),
+ S2 = [xxx] = ordsets1:add_element(xxx, S1),
+ S3 = [xxx,y] = ordsets1:add_element(y, S2),
+ ok = i:ib(ordsets1, union, 2),
+ [xxx,y,z] = ordsets1:union(S3, [z]),
All = [{{ordsets1,86}, _}, {{ordsets1,_},_}|_] = lists:sort(int:all_breaks()),
[] = lists:sort(int:all_breaks(foobar)),
All = lists:sort(int:all_breaks(ordsets1)),
ok.
-cleanup(doc) -> "Make sure that the auto-attach flag is turned off.";
-cleanup(suite) -> [];
+%% Make sure that the auto-attach flag is turned off.
cleanup(Config) when list(Config) ->
- ?line int:auto_attach(false),
+ int:auto_attach(false),
ok.
auto_attach(Pid) ->
diff --git a/lib/debugger/test/int_break_SUITE_data/Makefile.src b/lib/debugger/test/int_break_SUITE_data/Makefile.src
index 7b79aec4aa..2002b51a41 100644
--- a/lib/debugger/test/int_break_SUITE_data/Makefile.src
+++ b/lib/debugger/test/int_break_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_break_SUITE_data/ordsets1.erl b/lib/debugger/test/int_break_SUITE_data/ordsets1.erl
index b2c7221eea..a23c057fbe 100644
--- a/lib/debugger/test/int_break_SUITE_data/ordsets1.erl
+++ b/lib/debugger/test/int_break_SUITE_data/ordsets1.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_eval_SUITE.erl b/lib/debugger/test/int_eval_SUITE.erl
index f30d386de9..27ca4852b5 100644
--- a/lib/debugger/test/int_eval_SUITE.erl
+++ b/lib/debugger/test/int_eval_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@
-define(IM, my_int_eval_module).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
suite() -> [{ct_hooks,[ts_install_cth]},
{timetrap,{minutes,1}}].
@@ -64,19 +64,16 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line {module,?IM} = int:i(filename:join(DataDir, ?IM)),
- ?line ok = io:format("Interpreted modules: ~p",[int:interpreted()]),
+ DataDir = proplists:get_value(data_dir, Config),
+ {module,?IM} = int:i(filename:join(DataDir, ?IM)),
+ ok = io:format("Interpreted modules: ~p",[int:interpreted()]),
Config.
end_per_testcase(_Case, _Config) ->
ok = io:format("Interpreted modules: ~p", [int:interpreted()]),
ok.
-bifs_outside_erlang(doc) ->
- "Test that BIFs outside the erlang module are correctly evaluated.";
-bifs_outside_erlang(suite) ->
- [];
+%% Test that BIFs outside the erlang module are correctly evaluated.
bifs_outside_erlang(Config) when is_list(Config) ->
Fun = fun() ->
Id = ?IM:ets_new(),
@@ -87,164 +84,145 @@ bifs_outside_erlang(Config) when is_list(Config) ->
?IM:ets_delete(Id),
ok
end,
- ?line ok = spawn_eval(Fun),
+ ok = spawn_eval(Fun),
ok.
-spawning(doc) ->
- "Try evalutate spawn_link/3.";
-spawning(suite) ->
- [];
+%% Try evalutate spawn_link/3.
spawning(Config) when is_list(Config) ->
- ?line ok = spawn_eval(fun() -> ?IM:spawn_test() end).
+ ok = spawn_eval(fun() -> ?IM:spawn_test() end).
-applying(doc) ->
- "Try various sorts of applies.";
-applying(suite) ->
- [];
+%% Try various sorts of applies.
applying(Config) when is_list(Config) ->
Fun = fun({number,X}, {number,Y}) -> X+Y end,
- ?line ok = spawn_eval(fun() -> ?IM:apply_test(Fun) end).
+ ok = spawn_eval(fun() -> ?IM:apply_test(Fun) end).
-catch_and_throw(doc) ->
- "Test catch and throw/1.";
-catch_and_throw(suite) ->
- [];
+%% Test catch and throw/1.
catch_and_throw(Config) when is_list(Config) ->
- {a,ball} = spawn_eval(fun() -> ok = ?IM:catch_a_ball(),
- catch ?IM:throw_a_ball() end),
-
- %% Throw and catch without any extra outer catch.
-
- ?line process_flag(trap_exit, true),
- ?line Pid1 = spawn_link(fun() -> exit(?IM:catch_a_ball()) end),
- receive
- {'EXIT',Pid1,ok} -> ok;
- {'EXIT',Pid1,Bad1} -> ?line ?t:fail({bad_message,Bad1})
- after 5000 ->
- ?line ?t:fail(timeout)
- end,
+ {a,ball} = spawn_eval(fun() -> ok = ?IM:catch_a_ball(),
+ catch ?IM:throw_a_ball() end),
+
+ %% Throw and catch without any extra outer catch.
+
+ process_flag(trap_exit, true),
+ Pid1 = spawn_link(fun() -> exit(?IM:catch_a_ball()) end),
+ receive
+ {'EXIT',Pid1,ok} -> ok;
+ {'EXIT',Pid1,Bad1} -> ct:fail({bad_message,Bad1})
+ after 5000 ->
+ ct:fail(timeout)
+ end,
- %% Throw without catch.
+ %% Throw without catch.
- ?line Pid2 = spawn_link(fun() -> ?IM:throw_a_ball() end),
- receive
- {'EXIT',Pid2,{{nocatch,{a,ball}},[_|_]}} -> ok;
- {'EXIT',Pid2,Bad2} -> ?line ?t:fail({bad_message,Bad2})
- after 5000 ->
- ?line ?t:fail(timeout)
- end,
+ Pid2 = spawn_link(fun() -> ?IM:throw_a_ball() end),
+ receive
+ {'EXIT',Pid2,{{nocatch,{a,ball}},[_|_]}} -> ok;
+ {'EXIT',Pid2,Bad2} -> ct:fail({bad_message,Bad2})
+ after 5000 ->
+ ct:fail(timeout)
+ end,
- ?line ok = ?IM:more_catch(fun(_) -> ?IM:exit_me() end),
- ?line ok = ?IM:more_catch(fun(_) -> exit({unint, exit}) end),
- ?line {a, ball} = ?IM:more_catch(fun(_) -> ?IM:throw_a_ball() end),
- ?line {b, ball} = ?IM:more_catch(fun(_) -> throw({b,ball}) end),
+ ok = ?IM:more_catch(fun(_) -> ?IM:exit_me() end),
+ ok = ?IM:more_catch(fun(_) -> exit({unint, exit}) end),
+ {a, ball} = ?IM:more_catch(fun(_) -> ?IM:throw_a_ball() end),
+ {b, ball} = ?IM:more_catch(fun(_) -> throw({b,ball}) end),
- ExitInt = {'EXIT',{int,exit}},
- ExitU = {'EXIT',{unint,exit}},
+ ExitInt = {'EXIT',{int,exit}},
+ ExitU = {'EXIT',{unint,exit}},
- ?line ExitInt = (catch ?IM:more_nocatch(fun(_) -> ?IM:exit_me() end)),
- ?line ExitU = (catch ?IM:more_nocatch(fun(_) -> exit({unint, exit}) end)),
- ?line {a, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> ?IM:throw_a_ball() end)}),
- ?line {b, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> throw({b,ball}) end)}),
- ok.
+ ExitInt = (catch ?IM:more_nocatch(fun(_) -> ?IM:exit_me() end)),
+ ExitU = (catch ?IM:more_nocatch(fun(_) -> exit({unint, exit}) end)),
+ {a, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> ?IM:throw_a_ball() end)}),
+ {b, ball} = (catch {error, ?IM:more_nocatch(fun(_) -> throw({b,ball}) end)}),
+ ok.
-external_call(doc) ->
- "Test external calls.";
-external_call(suite) ->
- [];
+%% Test external calls.
external_call(Config) when is_list(Config) ->
- ?line ok = spawn_eval(fun() -> ?IM:external_call_test({some,stupid,data}) end).
+ ok = spawn_eval(fun() -> ?IM:external_call_test({some,stupid,data}) end).
-test_module_info(doc) ->
- "Test the module_info/0,1 functions.";
-test_module_info(suite) ->
- [];
+%% Test the module_info/0,1 functions.
test_module_info(Config) when is_list(Config) ->
- ?line ModInfo = ?IM:module_info(),
- ?line {value,{exports,Exp}} = lists:keysearch(exports, 1, ModInfo),
- ?line {value,{attributes,Attr}} = lists:keysearch(attributes, 1, ModInfo),
- ?line Exp = ?IM:module_info(exports),
- ?line Attr = ?IM:module_info(attributes),
- ?line {value,{stupid_attribute,[{a,b}]}} =
+ ModInfo = ?IM:module_info(),
+ {value,{exports,Exp}} = lists:keysearch(exports, 1, ModInfo),
+ {value,{attributes,Attr}} = lists:keysearch(attributes, 1, ModInfo),
+ Exp = ?IM:module_info(exports),
+ Attr = ?IM:module_info(attributes),
+ {value,{stupid_attribute,[{a,b}]}} =
lists:keysearch(stupid_attribute, 1, Attr),
%% Check exports using a list comprehension in the module itself.
- ?line ok = ?IM:check_exports(Exp),
+ ok = ?IM:check_exports(Exp),
%% Call module_info/0,1 from the module itself.
- ?line ok = ?IM:check_module_info(ModInfo, Exp),
+ ok = ?IM:check_module_info(ModInfo, Exp),
ok.
-apply_interpreted_fun(doc) ->
- "Apply a fun defined in interpreted code.";
-apply_interpreted_fun(suite) -> [];
+%% Apply a fun defined in interpreted code.
apply_interpreted_fun(Config) when is_list(Config) ->
%% Called from uninterpreted code
- ?line F1 = spawn_eval(fun() -> ?IM:give_me_a_fun_0() end),
- ?line perfectly_alright = spawn_eval(fun() -> F1() end),
- ?line ATerm = {a,term},
- ?line F2 = spawn_eval(fun() -> ?IM:give_me_a_fun_0(ATerm) end),
- ?line {ok,ATerm} = spawn_eval(fun() -> F2() end),
+ F1 = spawn_eval(fun() -> ?IM:give_me_a_fun_0() end),
+ perfectly_alright = spawn_eval(fun() -> F1() end),
+ ATerm = {a,term},
+ F2 = spawn_eval(fun() -> ?IM:give_me_a_fun_0(ATerm) end),
+ {ok,ATerm} = spawn_eval(fun() -> F2() end),
%% Called from uninterpreted code, badarity
- ?line {'EXIT',{{badarity,{F1,[snape]}},[{?MODULE,_,_,_}|_]}} =
+ {'EXIT',{{badarity,{F1,[snape]}},[{?MODULE,_,_,_}|_]}} =
spawn_eval(fun() -> F1(snape) end),
%% Called from uninterpreted code, error in fun
- ?line F3 = spawn_eval(fun() -> ?IM:give_me_a_bad_fun() end),
- ?line {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
+ F3 = spawn_eval(fun() -> ?IM:give_me_a_bad_fun() end),
+ {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
spawn_eval(fun() -> F3(snape) end),
%% Called from within interpreted code
- ?line perfectly_alright = spawn_eval(fun() -> ?IM:do_apply(F1) end),
+ perfectly_alright = spawn_eval(fun() -> ?IM:do_apply(F1) end),
%% Called from within interpreted code, badarity
- ?line {'EXIT',{{badarity,{F1,[snape]}},[{?IM,do_apply,_,_}|_]}} =
+ {'EXIT',{{badarity,{F1,[snape]}},[{?IM,do_apply,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F1, snape) end),
%% Called from within interpreted code, error in fun
- ?line {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
+ {'EXIT',{snape,[{?IM,_FunName,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F3, snape) end),
%% Try some more complex funs.
- ?line F4 = ?IM:give_me_a_fun_1(14, 42),
- ?line {false,yes,yeah,false} =
+ F4 = ?IM:give_me_a_fun_1(14, 42),
+ {false,yes,yeah,false} =
F4({{1,nope},{14,yes},{42,yeah},{100,forget_it}}),
- ?line [this_is_ok,me_too] =
+ [this_is_ok,me_too] =
F4([{-24,no_way},{15,this_is_ok},{1333,forget_me},{37,me_too}]),
%% OTP-5837
%% Try fun with guard containing variable bound in environment
- ?line [yes,no,no,no] = ?IM:otp_5837(1),
+ [yes,no,no,no] = ?IM:otp_5837(1),
ok.
-apply_uninterpreted_fun(doc) ->
- "Apply a fun defined outside interpreted code.";
-apply_uninterpreted_fun(suite) -> [];
+%% Apply a fun defined outside interpreted code.
apply_uninterpreted_fun(Config) when is_list(Config) ->
- ?line F1 = fun(snape) ->
- erlang:error(snape);
- (_Arg) ->
- perfectly_alright
- end,
+ F1 = fun(snape) ->
+ erlang:error(snape);
+ (_Arg) ->
+ perfectly_alright
+ end,
%% Ok
- ?line perfectly_alright =
+ perfectly_alright =
spawn_eval(fun() -> ?IM:do_apply(F1, any_arg) end),
%% Badarity (evaluated in dbg_debugged, which calls erlang:apply/2)
- ?line {'EXIT',{{badarity,{F1,[]}},[{erlang,apply,_,_}|_]}} =
+ {'EXIT',{{badarity,{F1,[]}},[{erlang,apply,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F1) end),
%% Error in fun
- ?line {'EXIT',{snape,[{?MODULE,_FunName,_,_}|_]}} =
+ {'EXIT',{snape,[{?MODULE,_FunName,_,_}|_]}} =
spawn_eval(fun() -> ?IM:do_apply(F1, snape) end),
ok.
@@ -254,23 +232,22 @@ apply_uninterpreted_fun(Config) when is_list(Config) ->
%%
interpreted_exit(Config) when is_list(Config) ->
- ?line process_flag(trap_exit, true),
- ?line Reason = make_ref(),
- ?line Pid = spawn_link(fun() -> ?IM:please_call_exit(Reason) end),
- ?line receive
- {'EXIT',Pid,Reason} ->
- ok;
- {'EXIT',Pid,BadReason} ->
- ?line ?t:fail({bad_message,BadReason})
- after 10000 ->
- ?line ?t:fail(timeout)
- end,
+ process_flag(trap_exit, true),
+ Reason = make_ref(),
+ Pid = spawn_link(fun() -> ?IM:please_call_exit(Reason) end),
+ receive
+ {'EXIT',Pid,Reason} ->
+ ok;
+ {'EXIT',Pid,BadReason} ->
+ ct:fail({bad_message,BadReason})
+ after 10000 ->
+ ct:fail(timeout)
+ end,
ok.
-otp_8310(doc) ->
- "OTP-8310. Bugfixes lc/bc and andalso/orelse.";
+%% OTP-8310. Bugfixes lc/bc and andalso/orelse.
otp_8310(Config) when is_list(Config) ->
- ?line ok = ?IM:otp_8310(),
+ ok = ?IM:otp_8310(),
ok.
applier(M, F, A) ->
@@ -279,17 +256,17 @@ applier(M, F, A) ->
Res.
stacktrace(Config) when is_list(Config) ->
- ?line {done,Stk} = do_eval(Config, stacktrace),
- ?line 13 = length(Stk),
- ?line OldStackTraceFlag = int:stack_trace(),
- ?line int:stack_trace(no_tail),
+ {done,Stk} = do_eval(Config, stacktrace),
+ 13 = length(Stk),
+ OldStackTraceFlag = int:stack_trace(),
+ int:stack_trace(no_tail),
try
- ?line Res = spawn_eval(fun() -> stacktrace:stacktrace() end),
- ?line io:format("\nInterpreted (no_tail):\n~p", [Res]),
- ?line {done,Stk} = Res
- after
- ?line int:stack_trace(OldStackTraceFlag)
- end,
+ Res = spawn_eval(fun() -> stacktrace:stacktrace() end),
+ io:format("\nInterpreted (no_tail):\n~p", [Res]),
+ {done,Stk} = Res
+ after
+ int:stack_trace(OldStackTraceFlag)
+ end,
ok.
maps(Config) when is_list(Config) ->
@@ -300,20 +277,20 @@ maps(Config) when is_list(Config) ->
do_eval(Config, Mod) ->
- ?line DataDir = ?config(data_dir, Config),
- ?line ok = file:set_cwd(DataDir),
+ DataDir = proplists:get_value(data_dir, Config),
+ ok = file:set_cwd(DataDir),
- ?line {ok,Mod} = compile:file(Mod, [report,debug_info]),
- ?line {module,Mod} = code:load_file(Mod),
- ?line CompiledRes = Mod:Mod(),
- ?line ok = io:format("Compiled:\n~p", [CompiledRes]),
+ {ok,Mod} = compile:file(Mod, [report,debug_info]),
+ {module,Mod} = code:load_file(Mod),
+ CompiledRes = Mod:Mod(),
+ ok = io:format("Compiled:\n~p", [CompiledRes]),
io:nl(),
- ?line {module,Mod} = int:i(Mod),
- ?line IntRes = Mod:Mod(),
- ?line ok = io:format("Interpreted:\n~p", [IntRes]),
+ {module,Mod} = int:i(Mod),
+ IntRes = Mod:Mod(),
+ ok = io:format("Interpreted:\n~p", [IntRes]),
- ?line CompiledRes = IntRes.
+ CompiledRes = IntRes.
%%
%% Evaluate in another process, to prevent the test_case process to become
diff --git a/lib/debugger/test/int_eval_SUITE_data/Makefile.src b/lib/debugger/test/int_eval_SUITE_data/Makefile.src
index bc2eb9a37d..01cdb8d7b7 100644
--- a/lib/debugger/test/int_eval_SUITE_data/Makefile.src
+++ b/lib/debugger/test/int_eval_SUITE_data/Makefile.src
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2000-2010. All Rights Reserved.
+# Copyright Ericsson AB 2000-2016. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
index b0ff4ce752..ca7929c10b 100644
--- a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
+++ b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/lc_SUITE.erl b/lib/debugger/test/lc_SUITE.erl
index aca4c4de7c..28415b412b 100644
--- a/lib/debugger/test/lc_SUITE.erl
+++ b/lib/debugger/test/lc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,9 +28,11 @@
basic/1,deeply_nested/1,no_generator/1,
empty_generator/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
[basic, deeply_nested, no_generator, empty_generator].
@@ -46,53 +48,50 @@ end_per_group(_GroupName, Config) ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
basic(Config) when is_list(Config) ->
- ?line L0 = lists:seq(1, 10),
- ?line L1 = my_map(fun(X) -> {x,X} end, L0),
- ?line L1 = [{x,X} || X <- L0],
- ?line L0 = my_map(fun({x,X}) -> X end, L1),
- ?line [1,2,3,4,5] = [X || X <- L0, X < 6],
- ?line [4,5,6] = [X || X <- L0, X > 3, X < 7],
- ?line [] = [X || X <- L0, X > 32, X < 7],
- ?line [1,3,5,7,9] = [X || X <- L0, odd(X)],
- ?line [2,4,6,8,10] = [X || X <- L0, not odd(X)],
- ?line [1,3,5,9] = [X || X <- L0, odd(X), X =/= 7],
- ?line [2,4,8,10] = [X || X <- L0, not odd(X), X =/= 6],
+ L0 = lists:seq(1, 10),
+ L1 = my_map(fun(X) -> {x,X} end, L0),
+ L1 = [{x,X} || X <- L0],
+ L0 = my_map(fun({x,X}) -> X end, L1),
+ [1,2,3,4,5] = [X || X <- L0, X < 6],
+ [4,5,6] = [X || X <- L0, X > 3, X < 7],
+ [] = [X || X <- L0, X > 32, X < 7],
+ [1,3,5,7,9] = [X || X <- L0, odd(X)],
+ [2,4,6,8,10] = [X || X <- L0, not odd(X)],
+ [1,3,5,9] = [X || X <- L0, odd(X), X =/= 7],
+ [2,4,8,10] = [X || X <- L0, not odd(X), X =/= 6],
%% Append is specially handled.
- ?line [1,3,5,9,2,4,8,10] = [X || X <- L0, odd(X), X =/= 7] ++
+ [1,3,5,9,2,4,8,10] = [X || X <- L0, odd(X), X =/= 7] ++
[X || X <- L0, not odd(X), X =/= 6],
%% Guards BIFs are evaluated in guard context. Weird, but true.
- ?line [{a,b,true},{x,y,true,true}] = [X || X <- tuple_list(), element(3, X)],
+ [{a,b,true},{x,y,true,true}] = [X || X <- tuple_list(), element(3, X)],
%% Filter expressions with andalso/orelse.
- ?line "abc123" = alphanum("?abc123.;"),
+ "abc123" = alphanum("?abc123.;"),
%% Error cases.
- ?line [] = [{xx,X} || X <- L0, element(2, X) == no_no_no],
- ?line {'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]),
- ?line [] = [X || X <- L1, X+1 < 2],
- ?line {'EXIT',_} = (catch [X || X <- L1, odd(X)]),
+ [] = [{xx,X} || X <- L0, element(2, X) == no_no_no],
+ {'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]),
+ [] = [X || X <- L1, X+1 < 2],
+ {'EXIT',_} = (catch [X || X <- L1, odd(X)]),
%% A bad generator has a different exception compared to BEAM.
- ?line {'EXIT',{{bad_generator,x},_}} = (catch [E || E <- id(x)]),
+ {'EXIT',{{bad_generator,x},_}} = (catch [E || E <- id(x)]),
ok.
tuple_list() ->
@@ -122,12 +121,12 @@ deeply_nested_1() ->
X16 <- [4],X17 <- [3],X18 <- [fun() -> X16+X17 end],X19 <- [2],X20 <- [1]].
no_generator(Config) when is_list(Config) ->
- ?line Seq = lists:seq(-10, 17),
- ?line [no_gen_verify(no_gen(A, B), A, B) || A <- Seq, B <- Seq],
+ Seq = lists:seq(-10, 17),
+ [no_gen_verify(no_gen(A, B), A, B) || A <- Seq, B <- Seq],
%% Literal expression, for coverage.
- ?line [a] = [a || true],
- ?line [a,b,c] = [a || true] ++ [b,c],
+ [a] = [a || true],
+ [a,b,c] = [a || true] ++ [b,c],
ok.
no_gen(A, B) ->
@@ -168,7 +167,7 @@ no_gen_verify(Res, A, B) ->
ShouldBe -> ok;
_ ->
io:format("A = ~p; B = ~p; Expected = ~p, actual = ~p", [A,B,ShouldBe,Res]),
- ?t:fail()
+ ct:fail(failed)
end.
no_gen_eval(Fun, Res) ->
@@ -180,7 +179,7 @@ no_gen_eval(Fun, Res) ->
no_gen_one_more(A, B) -> A + 1 =:= B.
empty_generator(Config) when is_list(Config) ->
- ?line [] = [X || {X} <- [], (false or (X/0 > 3))],
+ [] = [X || {X} <- [], (false or (X/0 > 3))],
ok.
id(I) -> I.
diff --git a/lib/debugger/test/line_number_SUITE.erl b/lib/debugger/test/line_number_SUITE.erl
index 6ec5ef5d5a..276473b95f 100644
--- a/lib/debugger/test/line_number_SUITE.erl
+++ b/lib/debugger/test/line_number_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -26,9 +26,11 @@
line_numbers/1]).
-export([crash/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -47,17 +49,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -66,6 +65,7 @@ end_per_suite(Config) when is_list(Config) ->
+
%%
%% === Make sure that this is always line 70 ===
%%
diff --git a/lib/debugger/test/map_SUITE.erl b/lib/debugger/test/map_SUITE.erl
index 0ef634f7aa..42484ff723 100644
--- a/lib/debugger/test/map_SUITE.erl
+++ b/lib/debugger/test/map_SUITE.erl
@@ -191,8 +191,8 @@ t_build_and_match_literals(Config) when is_list(Config) ->
id(#{ map_1=>#{ map_2=>#{value_3 => third}, value_2=> second}, value_1=>first}),
%% error case
- %V = 32,
- %{'EXIT',{{badmatch,_},_}} = (catch (#{<<"hi all">> => 1} = id(#{<<"hi",V,"all">> => 1}))),
+ %% V = 32,
+ %%{'EXIT',{{badmatch,_},_}} = (catch (#{<<"hi all">> => 1} = id(#{<<"hi",V,"all">> => 1}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3,x:=2} = id(#{x=>3}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=2} = id(#{x=>3}))),
{'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id({a,b,c}))),
@@ -201,7 +201,7 @@ t_build_and_match_literals(Config) when is_list(Config) ->
ok.
t_build_and_match_literals_large(Config) when is_list(Config) ->
- % normal non-repeating
+ %% normal non-repeating
M0 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
@@ -229,7 +229,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
60 = map_size(M0),
60 = maps:size(M0),
- % with repeating
+ %% with repeating
M1 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
@@ -265,7 +265,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
60 = map_size(M1),
60 = maps:size(M1),
- % with floats
+ %% with floats
M2 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
@@ -318,7 +318,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
90 = map_size(M2),
90 = maps:size(M2),
- % with bignums
+ %% with bignums
M3 = id(#{ 10=>a0,20=>b0,30=>"c0","40"=>"d0",<<"50">>=>"e0",{["00"]}=>"10",
11=>a1,21=>b1,31=>"c1","41"=>"d1",<<"51">>=>"e1",{["01"]}=>"11",
12=>a2,22=>b2,32=>"c2","42"=>"d2",<<"52">>=>"e2",{["02"]}=>"12",
@@ -501,7 +501,7 @@ t_build_and_match_literals_large(Config) when is_list(Config) ->
95 = map_size(M4),
95 = maps:size(M4),
- % call for value
+ %% call for value
M5 = id(#{ 10=>id(a0),20=>b0,30=>id("c0"),"40"=>"d0",<<"50">>=>id("e0"),{["00"]}=>"10",
11=>id(a1),21=>b1,31=>id("c1"),"41"=>"d1",<<"51">>=>id("e1"),{["01"]}=>"11",
@@ -681,7 +681,7 @@ t_map_size(Config) when is_list(Config) ->
map_is_size(M,N) when map_size(M) =:= N -> true;
map_is_size(_,_) -> false.
-% test map updates without matching
+%% test map updates without matching
t_update_literals(Config) when is_list(Config) ->
Map = #{x=>1,y=>2,z=>3,q=>4},
#{x:="d",q:="4"} = loop_update_literals_x_q(Map, [
@@ -751,7 +751,7 @@ loop_update_literals_x_q(Map, []) -> Map;
loop_update_literals_x_q(Map, [{X,Q}|Vs]) ->
loop_update_literals_x_q(Map#{q=>Q,x=>X},Vs).
-% test map updates with matching
+%% test map updates with matching
t_match_and_update_literals(Config) when is_list(Config) ->
Map = #{ x=>0,y=>"untouched",z=>"also untouched",q=>1,
#{ "one" => small, map => key } => "small map key 1" },
@@ -1413,7 +1413,7 @@ t_guard_fun(Config) when is_list(Config) ->
t_map_sort_literals(Config) when is_list(Config) ->
- % test relation
+ %% test relation
%% size order
true = #{ a => 1, b => 2} < id(#{ a => 1, b => 1, c => 1}),
@@ -1983,10 +1983,10 @@ t_ets(_Config) ->
[] = ets:select(Tid,[{{'$1','_'},[{'==','$1',#{ b => c }}],['$_']}]),
%% Test match with map of different size
- %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
+ %%[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => c },'_'},[],['$_']}]),
%%% Test match with don't care value
- %[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
+ %%[{#{ a := b },_}] = ets:select(Tid,[{{#{ b => '_' },'_'},[],['$_']}]),
%% Test is_map bif
101 = length(ets:select(Tid,[{'$1',[{is_map,{element,1,'$1'}}],['$1']}])),
@@ -2138,13 +2138,13 @@ t_update_exact_variables(Config) when is_list(Config) ->
t_nested_pattern_expressions(Config) when is_list(Config) ->
K1 = id("hello"),
- %K2 = id({ok}),
+ %% K2 = id({ok}),
[_,_,#{ <<"hi">> := wat, K1 := 42 }|_] = id([k,k,#{<<"hi">> => wat, K1 => 42}]),
[_,_,#{ -1 := wat, K1 := 42 }|_] = id([k,k,#{-1 => wat, K1 => 42}]),
[_,_,{#{ -1 := #{ {-3,<<0:300>>} := V1 }, K1 := 42 },3}|_] = id([k,k,{#{-1 => #{{-3,<<0:300>>}=>"hi"}, K1 => 42},3}]),
"hi" = V1,
- %[k,#{ {-1,K1,[]} := {wat,K1}, K2 := 42 }|_] = id([k,#{{-1,K1,[]} => {wat,K1}, K2 => 42}]),
- %[k,#{ [-1,K2,[]] := {wat,K1}, K1 := 42 }|_] = id([k,#{[-1,K2,[]] => {wat,K1}, K1 => 42}]),
+ %%[k,#{ {-1,K1,[]} := {wat,K1}, K2 := 42 }|_] = id([k,#{{-1,K1,[]} => {wat,K1}, K2 => 42}]),
+ %%[k,#{ [-1,K2,[]] := {wat,K1}, K1 := 42 }|_] = id([k,#{[-1,K2,[]] => {wat,K1}, K1 => 42}]),
ok.
t_guard_update_variables(Config) when is_list(Config) ->
@@ -2219,7 +2219,7 @@ map_guard_sequence_mixed(K1,K2,M) ->
t_frequency_table(Config) when is_list(Config) ->
- random:seed({13,1337,54}), % pseudo random
+ rand:seed(exsplus, {13,1337,54}), % pseudo random
N = 1000,
Ts = rand_terms(N),
#{ n:=N, tf := Tf } = frequency_table(Ts,#{ n=>0, tf => #{}}),
@@ -2262,7 +2262,7 @@ rand_terms(0) -> [];
rand_terms(N) -> [rand_term()|rand_terms(N-1)].
rand_term() ->
- case random:uniform(6) of
+ case rand:uniform(6) of
1 -> rand_binary();
2 -> rand_number();
3 -> rand_atom();
@@ -2272,21 +2272,21 @@ rand_term() ->
end.
rand_binary() ->
- case random:uniform(3) of
+ case rand:uniform(3) of
1 -> <<>>;
2 -> <<"hi">>;
3 -> <<"message text larger than 64 bytes. yep, message text larger than 64 bytes.">>
end.
rand_number() ->
- case random:uniform(3) of
- 1 -> random:uniform(5);
- 2 -> float(random:uniform(5));
- 3 -> 1 bsl (63 + random:uniform(3))
+ case rand:uniform(3) of
+ 1 -> rand:uniform(5);
+ 2 -> float(rand:uniform(5));
+ 3 -> 1 bsl (63 + rand:uniform(3))
end.
rand_atom() ->
- case random:uniform(3) of
+ case rand:uniform(3) of
1 -> hi;
2 -> some_atom;
3 -> some_other_atom
@@ -2294,21 +2294,21 @@ rand_atom() ->
rand_tuple() ->
- case random:uniform(3) of
+ case rand:uniform(3) of
1 -> {ok, rand_term()}; % careful
2 -> {1, 2, 3};
3 -> {<<"yep">>, 1337}
end.
rand_list() ->
- case random:uniform(3) of
+ case rand:uniform(3) of
1 -> "hi";
2 -> [1,rand_term()]; % careful
3 -> [improper|list]
end.
rand_map() ->
- case random:uniform(3) of
+ case rand:uniform(3) of
1 -> #{ hi => 3 };
2 -> #{ wat => rand_term(), other => 3 }; % careful
3 -> #{ hi => 42, other => 42, yet_anoter => 1337 }
@@ -2335,7 +2335,7 @@ t_build_and_match_empty_val(Config) when is_list(Config) ->
{'EXIT',{function_clause,_}} -> ok;
{'EXIT', {{case_clause,_},_}} -> {comment,inlined};
Other ->
- test_server:fail({no_match, Other})
+ ct:fail({no_match, Other})
end.
t_build_and_match_val(Config) when is_list(Config) ->
@@ -2353,7 +2353,7 @@ t_build_and_match_val(Config) when is_list(Config) ->
{'EXIT',{function_clause,_}} -> ok;
{'EXIT', {{case_clause,_},_}} -> {comment,inlined};
Other ->
- test_server:fail({no_match, Other})
+ ct:fail({no_match, Other})
end.
t_build_and_match_nil(Config) when is_list(Config) ->
diff --git a/lib/debugger/test/record_SUITE.erl b/lib/debugger/test/record_SUITE.erl
index 2f663e2dfc..0edb3786be 100644
--- a/lib/debugger/test/record_SUITE.erl
+++ b/lib/debugger/test/record_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -23,14 +23,16 @@
-module(record_SUITE).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-export([all/0, suite/0,groups/0,init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
init_per_suite/1,end_per_suite/1,
errors/1,record_test/1,eval_once/1]).
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -50,17 +52,14 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
@@ -72,19 +71,19 @@ end_per_suite(Config) when is_list(Config) ->
errors(Config) when is_list(Config) ->
Foo = #foo{a=1,b=2,c=3,d=4},
- ?line #foo{a=19,b=42,c=3,d=4} = update_foo(Foo, 19, 42),
+ #foo{a=19,b=42,c=3,d=4} = update_foo(Foo, 19, 42),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19)),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35)),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17)),
- ?line {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17, 42)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17)),
+ {'EXIT',{{badrecord,bar},_}} = (catch update_foo_bar(Foo, 19, 35, 17, 42)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17, 42)),
- ?line {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19,
- 35, 17, 42, -2)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19, 35, 17, 42)),
+ {'EXIT',{{badrecord,barf},_}} = (catch update_foo_barf(Foo, 19,
+ 35, 17, 42, -2)),
ok.
@@ -119,134 +118,134 @@ update_foo_barf(#foo{}=R, A, _B, C, D, E) ->
R#barf{a=A,b=A,c=C,d=D,e=E}.
--define(TrueGuard(Expr), if Expr -> ok; true -> ?t:fail() end).
--define(FalseGuard(Expr), if Expr -> ?t:fail(); true -> ok end).
+-define(TrueGuard(Expr), if Expr -> ok; true -> ct:fail(failed) end).
+-define(FalseGuard(Expr), if Expr -> ct:fail(failed); true -> ok end).
record_test(Config) when is_list(Config) ->
- ?line true = is_record(#foo{}, foo),
- ?line false = is_record(#foo{}, barf),
- ?line false = is_record({foo}, foo),
+ true = is_record(#foo{}, foo),
+ false = is_record(#foo{}, barf),
+ false = is_record({foo}, foo),
- ?line true = erlang:is_record(#foo{}, foo),
- ?line false = erlang:is_record(#foo{}, barf),
- ?line false = erlang:is_record({foo}, foo),
+ true = erlang:is_record(#foo{}, foo),
+ false = erlang:is_record(#foo{}, barf),
+ false = erlang:is_record({foo}, foo),
- ?line false = is_record([], foo),
- ?line false = is_record(Config, foo),
+ false = is_record([], foo),
+ false = is_record(Config, foo),
- ?line ?TrueGuard(is_record(#foo{}, foo)),
- ?line ?FalseGuard(is_record(#foo{}, barf)),
- ?line ?FalseGuard(is_record({foo}, foo)),
+ ?TrueGuard(is_record(#foo{}, foo)),
+ ?FalseGuard(is_record(#foo{}, barf)),
+ ?FalseGuard(is_record({foo}, foo)),
- ?line ?TrueGuard(erlang:is_record(#foo{}, foo)),
- ?line ?FalseGuard(erlang:is_record(#foo{}, barf)),
- ?line ?FalseGuard(erlang:is_record({foo}, foo)),
+ ?TrueGuard(erlang:is_record(#foo{}, foo)),
+ ?FalseGuard(erlang:is_record(#foo{}, barf)),
+ ?FalseGuard(erlang:is_record({foo}, foo)),
- ?line ?FalseGuard(is_record([], foo)),
- ?line ?FalseGuard(is_record(Config, foo)),
+ ?FalseGuard(is_record([], foo)),
+ ?FalseGuard(is_record(Config, foo)),
%% 'not is_record/2' to test guard optimization.
- ?line ?FalseGuard(not is_record(#foo{}, foo)),
- ?line ?TrueGuard(not is_record(#foo{}, barf)),
- ?line ?TrueGuard(not is_record({foo}, foo)),
+ ?FalseGuard(not is_record(#foo{}, foo)),
+ ?TrueGuard(not is_record(#foo{}, barf)),
+ ?TrueGuard(not is_record({foo}, foo)),
- ?line ?FalseGuard(not erlang:is_record(#foo{}, foo)),
- ?line ?TrueGuard(not erlang:is_record(#foo{}, barf)),
- ?line ?TrueGuard(not erlang:is_record({foo}, foo)),
+ ?FalseGuard(not erlang:is_record(#foo{}, foo)),
+ ?TrueGuard(not erlang:is_record(#foo{}, barf)),
+ ?TrueGuard(not erlang:is_record({foo}, foo)),
Foo = id(#foo{}),
- ?line ?FalseGuard(not erlang:is_record(Foo, foo)),
- ?line ?TrueGuard(not erlang:is_record(Foo, barf)),
+ ?FalseGuard(not erlang:is_record(Foo, foo)),
+ ?TrueGuard(not erlang:is_record(Foo, barf)),
- ?line ?TrueGuard(not is_record(Config, foo)),
+ ?TrueGuard(not is_record(Config, foo)),
- ?line ?TrueGuard(not is_record(a, foo)),
- ?line ?TrueGuard(not is_record([], foo)),
+ ?TrueGuard(not is_record(a, foo)),
+ ?TrueGuard(not is_record([], foo)),
%% Pass non-literal first argument.
- ?line true = is_record(id(#foo{}), foo),
- ?line false = is_record(id(#foo{}), barf),
- ?line false = is_record(id({foo}), foo),
+ true = is_record(id(#foo{}), foo),
+ false = is_record(id(#foo{}), barf),
+ false = is_record(id({foo}), foo),
- ?line true = erlang:is_record(id(#foo{}), foo),
- ?line false = erlang:is_record(id(#foo{}), barf),
- ?line false = erlang:is_record(id({foo}), foo),
+ true = erlang:is_record(id(#foo{}), foo),
+ false = erlang:is_record(id(#foo{}), barf),
+ false = erlang:is_record(id({foo}), foo),
NoRec1 = id(blurf),
NoRec2 = id([]),
- ?line ?TrueGuard(not is_record(NoRec1, foo)),
- ?line ?TrueGuard(not is_record(NoRec2, foo)),
+ ?TrueGuard(not is_record(NoRec1, foo)),
+ ?TrueGuard(not is_record(NoRec2, foo)),
%% Force the use of guard bifs by using the 'xor' operation.
False = id(false),
- ?line ?TrueGuard(is_record(#foo{}, foo) xor False),
- ?line ?FalseGuard(is_record(#foo{}, barf) xor False),
- ?line ?FalseGuard(is_record({foo}, foo) xor False ),
+ ?TrueGuard(is_record(#foo{}, foo) xor False),
+ ?FalseGuard(is_record(#foo{}, barf) xor False),
+ ?FalseGuard(is_record({foo}, foo) xor False ),
- ?line ?TrueGuard(is_record(Foo, foo) xor False),
- ?line ?FalseGuard(is_record(Foo, barf) xor False),
+ ?TrueGuard(is_record(Foo, foo) xor False),
+ ?FalseGuard(is_record(Foo, barf) xor False),
%% Implicit guards by using a list comprehension.
List = id([1,#foo{a=2},3,#bar{d=4},5,#foo{a=6},7]),
- ?line [#foo{a=2},#foo{a=6}] = [X || X <- List, is_record(X, foo)],
- ?line [#bar{d=4}] = [X || X <- List, is_record(X, bar)],
- ?line [1,#foo{a=2},3,5,#foo{a=6},7] =
+ [#foo{a=2},#foo{a=6}] = [X || X <- List, is_record(X, foo)],
+ [#bar{d=4}] = [X || X <- List, is_record(X, bar)],
+ [1,#foo{a=2},3,5,#foo{a=6},7] =
[X || X <- List, not is_record(X, bar)],
- ?line [1,3,5,7] =
+ [1,3,5,7] =
[X || X <- List, ((not is_record(X, bar)) and (not is_record(X, foo)))],
- ?line [#foo{a=2},#bar{d=4},#foo{a=6}] =
+ [#foo{a=2},#bar{d=4},#foo{a=6}] =
[X || X <- List, ((is_record(X, bar)) or (is_record(X, foo)))],
- ?line [1,3,#bar{d=4}] =
+ [1,3,#bar{d=4}] =
[X || X <- List, ((is_record(X, bar)) or (X < 5))],
- ?line MyList = [#foo{a=3},x,[],{a,b}],
- ?line [#foo{a=3}] = [X || X <- MyList, is_record(X, foo)],
- ?line [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo)],
- ?line [#foo{a=3}] = [X || X <- MyList, begin is_record(X, foo) end],
- ?line [x,[],{a,b}] = [X || X <- MyList, begin not is_record(X, foo) end],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, is_record(X, foo) or
- not is_binary(X)],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
- not is_binary(X)],
- ?line [#foo{a=3}] = [X || X <- MyList, is_record(X, foo) or is_reference(X)],
- ?line [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
- is_reference(X)],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
- begin is_record(X, foo) or
- not is_binary(X) end],
- ?line [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
- begin not is_record(X, foo) or
- not is_binary(X) end],
- ?line [#foo{a=3}] = [X || X <- MyList,
- begin is_record(X, foo) or is_reference(X) end],
- ?line [x,[],{a,b}] = [X || X <- MyList,
- begin not is_record(X, foo) or
- is_reference(X) end],
+ MyList = [#foo{a=3},x,[],{a,b}],
+ [#foo{a=3}] = [X || X <- MyList, is_record(X, foo)],
+ [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo)],
+ [#foo{a=3}] = [X || X <- MyList, begin is_record(X, foo) end],
+ [x,[],{a,b}] = [X || X <- MyList, begin not is_record(X, foo) end],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, is_record(X, foo) or
+ not is_binary(X)],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
+ not is_binary(X)],
+ [#foo{a=3}] = [X || X <- MyList, is_record(X, foo) or is_reference(X)],
+ [x,[],{a,b}] = [X || X <- MyList, not is_record(X, foo) or
+ is_reference(X)],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
+ begin is_record(X, foo) or
+ not is_binary(X) end],
+ [#foo{a=3},x,[],{a,b}] = [X || X <- MyList,
+ begin not is_record(X, foo) or
+ not is_binary(X) end],
+ [#foo{a=3}] = [X || X <- MyList,
+ begin is_record(X, foo) or is_reference(X) end],
+ [x,[],{a,b}] = [X || X <- MyList,
+ begin not is_record(X, foo) or
+ is_reference(X) end],
ok.
eval_once(Config) when is_list(Config) ->
- ?line once(fun(GetRec) ->
- true = erlang:is_record(GetRec(), foo)
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1}
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1,b=2}
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1,b=2,c=3}
- end, #foo{}),
- ?line once(fun(GetRec) ->
- (GetRec())#foo{a=1,b=2,c=3,d=4}
- end, #foo{}),
+ once(fun(GetRec) ->
+ true = erlang:is_record(GetRec(), foo)
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1}
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1,b=2}
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1,b=2,c=3}
+ end, #foo{}),
+ once(fun(GetRec) ->
+ (GetRec())#foo{a=1,b=2,c=3,d=4}
+ end, #foo{}),
ok.
once(Test, Record) ->
@@ -260,7 +259,7 @@ once(Test, Record) ->
1 -> ok;
N ->
io:format("Evaluated ~w times\n", [N]),
- ?t:fail()
+ ct:fail(failed)
end,
Result.
diff --git a/lib/debugger/test/test_lib.erl b/lib/debugger/test/test_lib.erl
index 2d3e772fc8..b9ac486694 100644
--- a/lib/debugger/test/test_lib.erl
+++ b/lib/debugger/test/test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
diff --git a/lib/debugger/test/trycatch_SUITE.erl b/lib/debugger/test/trycatch_SUITE.erl
index 7fdd98fc71..2857cac9a3 100644
--- a/lib/debugger/test/trycatch_SUITE.erl
+++ b/lib/debugger/test/trycatch_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,9 +28,11 @@
catch_oops/1,after_oops/1,eclectic/1,rethrow/1,
nested_of/1,nested_catch/1,nested_after/1]).
--include_lib("test_server/include/test_server.hrl").
+-include_lib("common_test/include/ct.hrl").
-suite() -> [{ct_hooks,[ts_install_cth]}].
+suite() ->
+ [{ct_hooks,[ts_install_cth]},
+ {timetrap,{minutes,1}}].
all() ->
cases().
@@ -52,49 +54,46 @@ cases() ->
init_per_testcase(_Case, Config) ->
test_lib:interpret(?MODULE),
- Dog = test_server:timetrap(?t:minutes(1)),
- [{watchdog,Dog}|Config].
+ Config.
-end_per_testcase(_Case, Config) ->
- Dog = ?config(watchdog, Config),
- ?t:timetrap_cancel(Dog),
+end_per_testcase(_Case, _Config) ->
ok.
init_per_suite(Config) when is_list(Config) ->
- ?line test_lib:interpret(?MODULE),
- ?line true = lists:member(?MODULE, int:interpreted()),
+ test_lib:interpret(?MODULE),
+ true = lists:member(?MODULE, int:interpreted()),
Config.
end_per_suite(Config) when is_list(Config) ->
ok.
basic(Conf) when is_list(Conf) ->
- ?line 2 =
+ 2 =
try my_div(4, 2)
catch
Class:Reason -> {Class,Reason}
end,
- ?line error =
+ error =
try my_div(1, 0)
catch
error:badarith -> error
end,
- ?line error =
+ error =
try 1/0
catch
error:badarith -> error
end,
- ?line ok =
+ ok =
try my_add(53, atom)
catch
error:badarith -> ok
end,
- ?line exit_nisse =
+ exit_nisse =
try exit(nisse)
catch
exit:nisse -> exit_nisse
end,
- ?line ok =
+ ok =
try throw(kalle)
catch
kalle -> ok
@@ -103,26 +102,26 @@ basic(Conf) when is_list(Conf) ->
%% Try some stuff where the compiler will optimize away the try.
V = id({a,variable}),
- ?line V = try V catch nisse -> error end,
- ?line 42 = try 42 catch nisse -> error end,
- ?line [V] = try [V] catch nisse -> error end,
- ?line {ok,V} = try {ok,V} catch nisse -> error end,
+ V = try V catch nisse -> error end,
+ 42 = try 42 catch nisse -> error end,
+ [V] = try [V] catch nisse -> error end,
+ {ok,V} = try {ok,V} catch nisse -> error end,
%% Same idea, but use an after too.
- ?line V = try V catch nisse -> error after after_call() end,
- ?line after_clean(),
- ?line 42 = try 42 after after_call() end,
- ?line after_clean(),
- ?line [V] = try [V] catch nisse -> error after after_call() end,
- ?line after_clean(),
- ?line {ok,V} = try {ok,V} after after_call() end,
+ V = try V catch nisse -> error after after_call() end,
+ after_clean(),
+ 42 = try 42 after after_call() end,
+ after_clean(),
+ [V] = try [V] catch nisse -> error after after_call() end,
+ after_clean(),
+ {ok,V} = try {ok,V} after after_call() end,
%% Try/of
- ?line ok = try V of
- {a,variable} -> ok
- catch nisse -> erro
- end,
+ ok = try V of
+ {a,variable} -> ok
+ catch nisse -> erro
+ end,
ok.
@@ -133,24 +132,24 @@ after_clean() ->
after_was_called = erase(basic).
lean_throw(Conf) when is_list(Conf) ->
- ?line {throw,kalle} =
+ {throw,kalle} =
try throw(kalle)
catch
Kalle -> {throw,Kalle}
end,
- ?line {exit,kalle} =
+ {exit,kalle} =
try exit(kalle)
catch
Throw1 -> {throw,Throw1};
exit:Reason1 -> {exit,Reason1}
end,
- ?line {exit,kalle} =
+ {exit,kalle} =
try exit(kalle)
catch
exit:Reason2 -> {exit,Reason2};
Throw2 -> {throw,Throw2}
end,
- ?line {exit,kalle} =
+ {exit,kalle} =
try try exit(kalle)
catch
Throw3 -> {throw,Throw3}
@@ -161,25 +160,25 @@ lean_throw(Conf) when is_list(Conf) ->
ok.
try_of(Conf) when is_list(Conf) ->
- ?line {ok,{some,content}} =
+ {ok,{some,content}} =
try_of_1({value,{good,{some,content}}}),
- ?line {error,[other,content]} =
+ {error,[other,content]} =
try_of_1({value,{bad,[other,content]}}),
- ?line {caught,{exit,{ex,it,[reason]}}} =
+ {caught,{exit,{ex,it,[reason]}}} =
try_of_1({exit,{ex,it,[reason]}}),
- ?line {caught,{throw,[term,{in,a,{tuple}}]}} =
+ {caught,{throw,[term,{in,a,{tuple}}]}} =
try_of_1({throw,[term,{in,a,{tuple}}]}),
- ?line {caught,{error,[bad,arg]}} =
+ {caught,{error,[bad,arg]}} =
try_of_1({error,[bad,arg]}),
- ?line {caught,{error,badarith}} =
+ {caught,{error,badarith}} =
try_of_1({'div',{1,0}}),
- ?line {caught,{error,badarith}} =
+ {caught,{error,badarith}} =
try_of_1({'add',{a,0}}),
- ?line {caught,{error,badarg}} =
+ {caught,{error,badarg}} =
try_of_1({'abs',x}),
- ?line {caught,{error,function_clause}} =
+ {caught,{error,function_clause}} =
try_of_1(illegal),
- ?line {error,{try_clause,{some,other_garbage}}} =
+ {error,{try_clause,{some,other_garbage}}} =
try try_of_1({value,{some,other_garbage}})
catch error:Reason -> {error,Reason}
end,
@@ -191,33 +190,33 @@ try_of_1(X) ->
{bad,Y} -> {error,Y}
catch
Class:Reason ->
- {caught,{Class,Reason}}
+ {caught,{Class,Reason}}
end.
try_after(Conf) when is_list(Conf) ->
- ?line {{ok,[some,value],undefined},finalized} =
+ {{ok,[some,value],undefined},finalized} =
try_after_1({value,{ok,[some,value]}},finalized),
- ?line {{error,badarith,undefined},finalized} =
+ {{error,badarith,undefined},finalized} =
try_after_1({'div',{1,0}},finalized),
- ?line {{error,badarith,undefined},finalized} =
+ {{error,badarith,undefined},finalized} =
try_after_1({'add',{1,a}},finalized),
- ?line {{error,badarg,undefined},finalized} =
+ {{error,badarg,undefined},finalized} =
try_after_1({'abs',a},finalized),
- ?line {{error,[the,{reason}],undefined},finalized} =
+ {{error,[the,{reason}],undefined},finalized} =
try_after_1({error,[the,{reason}]},finalized),
- ?line {{throw,{thrown,[reason]},undefined},finalized} =
+ {{throw,{thrown,[reason]},undefined},finalized} =
try_after_1({throw,{thrown,[reason]}},finalized),
- ?line {{exit,{exited,{reason}},undefined},finalized} =
+ {{exit,{exited,{reason}},undefined},finalized} =
try_after_1({exit,{exited,{reason}}},finalized),
- ?line {{error,function_clause,undefined},finalized} =
+ {{error,function_clause,undefined},finalized} =
try_after_1(function_clause,finalized),
- ?line ok =
+ ok =
try try_after_1({'add',{1,1}}, finalized)
catch
error:{try_clause,2} -> ok
end,
- ?line finalized = erase(try_after),
- ?line ok =
+ finalized = erase(try_after),
+ ok =
try try foo({exit,[reaso,{n}]})
after put(try_after, finalized)
end
@@ -244,7 +243,7 @@ try_after_1(X, Y) ->
after_bind(Conf) when is_list(Conf) ->
V = [make_ref(),self()|value],
- ?line {value,{value,V}} =
+ {value,{value,V}} =
after_bind_1({value,V}, V, {value,V}),
ok.
@@ -268,35 +267,35 @@ after_bind_1(X, V, Y) ->
-endif.
catch_oops(Conf) when is_list(Conf) ->
- V = {v,[a,l|u],{e},self()},
- ?line {value,V} = catch_oops_1({value,V}),
- ?line {value,1} = catch_oops_1({'div',{1,1}}),
- ?line {error,badarith} = catch_oops_1({'div',{1,0}}),
- ?line {error,function_clause} = catch_oops_1(function_clause),
- ?line {throw,V} = catch_oops_1({throw,V}),
- ?line {exit,V} = catch_oops_1({exit,V}),
- ok.
+ V = {v,[a,l|u],{e},self()},
+ {value,V} = catch_oops_1({value,V}),
+ {value,1} = catch_oops_1({'div',{1,1}}),
+ {error,badarith} = catch_oops_1({'div',{1,0}}),
+ {error,function_clause} = catch_oops_1(function_clause),
+ {throw,V} = catch_oops_1({throw,V}),
+ {exit,V} = catch_oops_1({exit,V}),
+ ok.
catch_oops_1(X) ->
- Ref = make_ref(),
- try try foo({error,Ref})
- catch
- error:Ref ->
- foo(X)
- end of
- Value -> {value,Value}
- catch
- Class:Data -> {Class,Data}
- end.
+ Ref = make_ref(),
+ try try foo({error,Ref})
+ catch
+ error:Ref ->
+ foo(X)
+ end of
+ Value -> {value,Value}
+ catch
+ Class:Data -> {Class,Data}
+ end.
after_oops(Conf) when is_list(Conf) ->
V = {self(),make_ref()},
- ?line {{value,V},V} = after_oops_1({value,V}, {value,V}),
- ?line {{exit,V},V} = after_oops_1({exit,V}, {value,V}),
- ?line {{error,V},undefined} = after_oops_1({value,V}, {error,V}),
- ?line {{error,function_clause},undefined} =
+ {{value,V},V} = after_oops_1({value,V}, {value,V}),
+ {{exit,V},V} = after_oops_1({exit,V}, {value,V}),
+ {{error,V},undefined} = after_oops_1({value,V}, {error,V}),
+ {{error,function_clause},undefined} =
after_oops_1({exit,V}, function_clause),
ok.
@@ -317,37 +316,37 @@ after_oops_1(X, Y) ->
eclectic(Conf) when is_list(Conf) ->
V = {make_ref(),3.1415926535,[[]|{}]},
- ?line {{value,{value,V},V},V} =
+ {{value,{value,V},V},V} =
eclectic_1({foo,{value,{value,V}}}, undefined, {value,V}),
- ?line {{'EXIT',{V,[{?MODULE,foo,_,_}|_]}},V} =
+ {{'EXIT',{V,[{?MODULE,foo,_,_}|_]}},V} =
eclectic_1({catch_foo,{error,V}}, undefined, {value,V}),
- ?line {{error,{exit,V},{'EXIT',V}},V} =
+ {{error,{exit,V},{'EXIT',V}},V} =
eclectic_1({foo,{error,{exit,V}}}, error, {value,V}),
- ?line {{value,{value,V},V},{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}} =
+ {{value,{value,V},V},{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}} =
eclectic_1({foo,{value,{value,V}}}, undefined, {'add',{0,a}}),
- ?line {{'EXIT',V},V} =
+ {{'EXIT',V},V} =
eclectic_1({catch_foo,{exit,V}}, undefined, {throw,V}),
- ?line {{error,{'div',{1,0}},{'EXIT',{badarith,[{?MODULE,my_div,_,_}|_]}}},
- {'EXIT',V}} =
+ {{error,{'div',{1,0}},{'EXIT',{badarith,[{?MODULE,my_div,_,_}|_]}}},
+ {'EXIT',V}} =
eclectic_1({foo,{error,{'div',{1,0}}}}, error, {exit,V}),
- ?line {{{error,V},{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},{'EXIT',V}} =
+ {{{error,V},{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},{'EXIT',V}} =
eclectic_1({catch_foo,{throw,{error,V}}}, undefined, {exit,V}),
%%
- ?line {{value,{value,{value,V},V}},V} =
+ {{value,{value,{value,V},V}},V} =
eclectic_2({value,{value,V}}, undefined, {value,V}),
- ?line {{value,{throw,{value,V},V}},V} =
+ {{value,{throw,{value,V},V}},V} =
eclectic_2({throw,{value,V}}, throw, {value,V}),
- ?line {{caught,{'EXIT',V}},undefined} =
+ {{caught,{'EXIT',V}},undefined} =
eclectic_2({value,{value,V}}, undefined, {exit,V}),
- ?line {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
+ {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
eclectic_2({error,{value,V}}, throw, {error,V}),
- ?line {{caught,{'EXIT',{badarg,[{erlang,abs,[V],_}|_]}}},V} =
+ {{caught,{'EXIT',{badarg,[{erlang,abs,[V],_}|_]}}},V} =
eclectic_2({value,{'abs',V}}, undefined, {value,V}),
- ?line {{caught,{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}},V} =
+ {{caught,{'EXIT',{badarith,[{?MODULE,my_add,_,_}|_]}}},V} =
eclectic_2({exit,{'add',{0,a}}}, exit, {value,V}),
- ?line {{caught,{'EXIT',V}},undefined} =
+ {{caught,{'EXIT',V}},undefined} =
eclectic_2({value,{error,V}}, undefined, {exit,V}),
- ?line {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
+ {{caught,{'EXIT',{V,[{?MODULE,foo,_,_}|_]}}},undefined} =
eclectic_2({throw,{'div',{1,0}}}, throw, {error,V}),
ok.
@@ -375,42 +374,42 @@ eclectic_2(X, C, Y) ->
Catch =
case
catch
- {Done,
- try foo(X) of
- V -> {value,V,foo(V)}
- catch
- C:D -> {C,D,foo(D)}
- after
- put(eclectic, foo(Y))
- end} of
- {Done,Z} -> {value,Z};
- Z -> {caught,Z}
- end,
+ {Done,
+ try foo(X) of
+ V -> {value,V,foo(V)}
+ catch
+ C:D -> {C,D,foo(D)}
+ after
+ put(eclectic, foo(Y))
+ end} of
+ {Done,Z} -> {value,Z};
+ Z -> {caught,Z}
+ end,
{Catch,erase(eclectic)}.
rethrow(Conf) when is_list(Conf) ->
V = {a,[b,{c,self()},make_ref]},
- ?line {value2,value1} =
+ {value2,value1} =
rethrow_1({value,V}, V),
- ?line {caught2,{error,V}} =
+ {caught2,{error,V}} =
rethrow_2({error,V}, undefined),
- ?line {caught2,{exit,V}} =
+ {caught2,{exit,V}} =
rethrow_1({exit,V}, error),
- ?line {caught2,{throw,V}} =
+ {caught2,{throw,V}} =
rethrow_1({throw,V}, undefined),
- ?line {caught2,{throw,V}} =
+ {caught2,{throw,V}} =
rethrow_2({throw,V}, undefined),
- ?line {caught2,{error,badarith}} =
+ {caught2,{error,badarith}} =
rethrow_1({'add',{0,a}}, throw),
- ?line {caught2,{error,function_clause}} =
+ {caught2,{error,function_clause}} =
rethrow_2(function_clause, undefined),
- ?line {caught2,{error,{try_clause,V}}} =
+ {caught2,{error,{try_clause,V}}} =
rethrow_1({value,V}, exit),
- ?line {value2,{caught1,V}} =
+ {value2,{caught1,V}} =
rethrow_1({error,V}, error),
- ?line {value2,{caught1,V}} =
+ {value2,{caught1,V}} =
rethrow_1({exit,V}, exit),
- ?line {value2,caught1} =
+ {value2,caught1} =
rethrow_2({throw,V}, V),
ok.
@@ -440,91 +439,91 @@ rethrow_2(X, C1) ->
nested_of(Conf) when is_list(Conf) ->
V = {[self()|make_ref()],1.4142136},
- ?line {{value,{value1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{value1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{throw,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{throw,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{throw,{V,x2}}, {'div',{1,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{value,{V,x1}},void,{V,x1}},
{throw,{V,x2}}, {'div',{1,0}}, {'add',{0,b}}),
%%
- ?line {{caught,{error,{try_clause,{V,x1}}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,{try_clause,{V,x1}}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,try_clause},
void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{exit,{V,x3}}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{exit,{V,x3}}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{value,{V,x1}},void,try_clause},
void, {exit,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x4}}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{throw,{V,x4}}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{value,{V,x1}},void,try_clause},
void, {exit,{V,x3}}, {throw,{V,x4}}),
%%
- ?line {{value,{caught1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{caught1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{'add',{1,c}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{'add',{1,c}}, {'div',{17,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarg}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{error,{V,x1}},error,{V,x1}},
{'add',{1,c}}, {'div',{17,0}}, {'abs',V}),
%%
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_of_1({{'add',{2,c}},rethrow,void},
void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- {V,x4},
- finalized} =
+ {{caught,{error,badarg}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_of_1({{'add',{2,c}},rethrow,void},
void, {'abs',V}, {value,{V,x4}}),
- ?line {{caught,{error,function_clause}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,function_clause}},
+ undefined,
+ undefined,
+ finalized} =
nested_of_1({{'add',{2,c}},rethrow,void},
void, {'abs',V}, function_clause),
ok.
@@ -565,97 +564,97 @@ nested_of_1({X1,C1,V1},
nested_catch(Conf) when is_list(Conf) ->
V = {[make_ref(),1.4142136,self()]},
- ?line {{value,{value1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{value1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{throw,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {throw,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {throw,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {throw,{V,x2}}, {'div',{1,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {throw,{V,x2}}, {'div',{1,0}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{value,{V,x1}},void,{V,x1}},
- {throw,{V,x2}}, {'div',{1,0}}, {'add',{0,b}}),
+ {throw,{V,x2}}, {'div',{1,0}}, {'add',{0,b}}),
%%
- ?line {{caught,{error,{try_clause,{V,x1}}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,{try_clause,{V,x1}}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,try_clause},
- void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{exit,{V,x3}}},
- undefined,
- {V,x4},
- finalized} =
+ void, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{exit,{V,x3}}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{value,{V,x1}},void,try_clause},
- void, {exit,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{throw,{V,x4}}},
- undefined,
- undefined,
- finalized} =
+ void, {exit,{V,x3}}, {value,{V,x4}}),
+ {{caught,{throw,{V,x4}}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{value,{V,x1}},void,try_clause},
- void, {exit,{V,x3}}, {throw,{V,x4}}),
+ void, {exit,{V,x3}}, {throw,{V,x4}}),
%%
- ?line {{value,{caught1,{V,x2}}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{value,{caught1,{V,x2}}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {value,{V,x2}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {'add',{1,c}}, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarith}},
- undefined,
- {V,x4},
- finalized} =
+ {'add',{1,c}}, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarith}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {'add',{1,c}}, {'div',{17,0}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- undefined,
- finalized} =
+ {'add',{1,c}}, {'div',{17,0}}, {value,{V,x4}}),
+ {{caught,{error,badarg}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{error,{V,x1}},error,{V,x1}},
- {'add',{1,c}}, {'div',{17,0}}, {'abs',V}),
+ {'add',{1,c}}, {'div',{17,0}}, {'abs',V}),
%%
- ?line {{caught,{error,badarith}},
- {V,x3},
- {V,x4},
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ {V,x4},
+ finalized} =
nested_catch_1({{'add',{2,c}},rethrow,void},
- void, {value,{V,x3}}, {value,{V,x4}}),
- ?line {{caught,{error,badarg}},
- undefined,
- {V,x4},
- finalized} =
+ void, {value,{V,x3}}, {value,{V,x4}}),
+ {{caught,{error,badarg}},
+ undefined,
+ {V,x4},
+ finalized} =
nested_catch_1({{'add',{2,c}},rethrow,void},
- void, {'abs',V}, {value,{V,x4}}),
- ?line {{caught,{error,function_clause}},
- undefined,
- undefined,
- finalized} =
+ void, {'abs',V}, {value,{V,x4}}),
+ {{caught,{error,function_clause}},
+ undefined,
+ undefined,
+ finalized} =
nested_catch_1({{'add',{2,c}},rethrow,void},
- void, {'abs',V}, function_clause),
+ void, {'abs',V}, function_clause),
ok.
nested_catch_1({X1,C1,V1},
- X2, X3, X4) ->
+ X2, X3, X4) ->
erase(nested3),
erase(nested4),
erase(nested),
@@ -688,73 +687,73 @@ nested_catch_1({X1,C1,V1},
nested_after(Conf) when is_list(Conf) ->
V = [{make_ref(),1.4142136,self()}],
- ?line {value,
- {V,x3},
- {value1,{V,x2}},
- finalized} =
+ {value,
+ {V,x3},
+ {value1,{V,x2}},
+ finalized} =
nested_after_1({{value,{V,x1}},void,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}),
- ?line {{caught,{error,{V,x2}}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{error,{V,x2}}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,{V,x1}},
{error,{V,x2}}, {value,{V,x3}}),
- ?line {{caught,{exit,{V,x3}}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{exit,{V,x3}}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,{V,x1}},
{error,{V,x2}}, {exit,{V,x3}}),
%%
- ?line {{caught,{error,{try_clause,{V,x1}}}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{error,{try_clause,{V,x1}}}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,try_clause},
void, {value,{V,x3}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{value,{V,x1}},void,try_clause},
void, {'div',{17,0}}),
%%
- ?line {value,
- {V,x3},
- {caught1,{V,x2}},
- finalized} =
+ {value,
+ {V,x3},
+ {caught1,{V,x2}},
+ finalized} =
nested_after_1({{throw,{V,x1}},throw,{V,x1}},
{value,{V,x2}}, {value,{V,x3}}),
- ?line {{caught,{error,badarith}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},throw,{V,x1}},
{'add',{a,b}}, {value,{V,x3}}),
- ?line {{caught,{error,badarg}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarg}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},throw,{V,x1}},
{'add',{a,b}}, {'abs',V}),
%%
- ?line {{caught,{throw,{V,x1}}},
- {V,x3},
- undefined,
- finalized} =
+ {{caught,{throw,{V,x1}}},
+ {V,x3},
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},rethrow,void},
void, {value,{V,x3}}),
- ?line {{caught,{error,badarith}},
- undefined,
- undefined,
- finalized} =
+ {{caught,{error,badarith}},
+ undefined,
+ undefined,
+ finalized} =
nested_after_1({{throw,{V,x1}},rethrow,void},
void, {'div',{1,0}}),
ok.
nested_after_1({X1,C1,V1},
- X2, X3) ->
+ X2, X3) ->
erase(nested3),
erase(nested4),
erase(nested),
diff --git a/lib/debugger/vsn.mk b/lib/debugger/vsn.mk
index b6fd4e8e44..f5440865ef 100644
--- a/lib/debugger/vsn.mk
+++ b/lib/debugger/vsn.mk
@@ -1 +1 @@
-DEBUGGER_VSN = 4.1
+DEBUGGER_VSN = 4.2.1