Age | Commit message (Collapse) | Author |
|
* nox/maps-support-cover/OTP-11764:
Support maps in cover
Conflicts:
lib/tools/src/cover.erl
|
|
|
|
The raw_abstract_v1 format that is currently used was introduced
in R9C. Beam files that old cannot be executed by the current
run-time system, so there is no need to continue the old formats.
Removing the support will increase coverage.
|
|
We want to see at least some coverage of cover itself.
|
|
* nox/tools/cover-record-update:
Properly munge record updates in cover
Don't munge record and field names in cover
|
|
|
|
Trees {record,Line,Arg,Name,Fields} were not munged.
|
|
They are bare atoms, atoms or variables in the abstract format, there is no need to
pass them through munge_expr/2.
|
|
This adds optional names to fun expressions. A named fun expression
is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse.
If a fun expression has a name, it must be present and be the same in
every of its clauses. The function name shadows the environment of the
expression shadowing the environment and it is shadowed by the
environment of the clauses' arguments. An unused function name triggers
a warning unless it is prefixed by _, just as every variable.
Variable _ is allowed as a function name.
It is not an error to put a named function in a record field default
value.
When transforming to Core Erlang, the named fun Fun is changed into
the following expression:
letrec 'Fun'/Arity =
fun (Args) ->
let <Fun> = 'Fun'/Arity
in Case
in 'Fun'/Arity
where Args is the list of arguments of 'Fun'/Arity and Case the
Core Erlang expression corresponding to the clauses of Fun.
This transformation allows us to entirely skip any k_var to k_local
transformation in the fun's clauses bodies.
|
|
Similarly to cover compiling from source
(in this case some user specified compiler options are allowed)
when cover compiling from existing beam
take a filtered list of compiler options from the beamfile.
This way e.g. export_all can be preserved. See use case in eb02beb1c3
|
|
|
|
|
|
When cover:stop(Node) was called on a non-existing node, a process
waiting for cover data from the node would hang forever. This has been
corrected.
|
|
Commit 29231033 made cover fall back to compile info if source was not
found in pwd or ../src. This isn't sufficient for source that lies in
subdirectories of ../src when beams and source have been moved since
compilation (eg. install of some OTP applications), so first try finding
source relative to the beam directory.
For example, given a beam path
/installed/path/to/app-1.0/ebin/root.beam
and a source path
/compiled/path/to/app/src/subdir/root.erl
then look for
/installed/path/to/app-1.0/ebin/../src/subdir/root.erl
before the source path.
|
|
Cover was rewriting guard clauses as non-remote calls.
That said, if a guard contains erlang:is_binary(Binary),
Cover was incorrectly removing the erlang prefix which
lead to errors if is_binary is not auto imported.
This commit keeps the abstract format as it is.
|
|
Whenever a module is compiled via compile:forms/2,
the source is set to current directory unless a source
option is passed to compile. This commit ensures that
cover passes the source information to compile:forms/2
to ensure the source won't be modified after the module
is cover compiled.
|
|
Prior to this commit, cover relied on a simple heuristic that
traverses directory from the beam file to find a source file.
The heuristic was maintained with this patch but, if it fails,
it fallbacks to the source value in the module compile info.
In order to illustrate how it works, one of the tests that
could not find its source now passes successfully (showing the
source lookup is more robust).
|
|
|
|
|
|
* siri/cover/new-bugs-r16/OTP-10638:
[cover] Cleanup by stopping cover between tests
[common_test] Stop cover on slave node after node is terminated
[test_server] Stop cover on node after node is terminated
[cover] Fix timing dependent bug in cover_SUITE:reconnect
[cover] Remove stopped node also from lost_nodes list
[cover] Don't mark stopped node as lost
|
|
Code written by Siri Hansen.
|
|
A nodes that was stopped with cover:stop/1 while marked as lost would
not be removed from the list of lost nodes. Therefore, if a nodeup was
later received for a node with the same name, it would be
reconnected. This has been corrected.
|
|
Nodes that were stopped with cover:stop/1 were marked as lost and
would be reconnected if a nodeup was later received for a node with
the same name. This has been corrected.
|
|
OTP-10523
Earlier, if the connection to a remote cover node was lost, all cover
data was lost and the cover_server on the remote node would die. This
would cause problems if there were cover compiled modules that would
still be executed since they would attempt to write to the no longer
existing ets tables belonging to the cover_server.
This commit changes this behavior so that the cover_server on the
remote node will survive connection loss and continue collecting cover
data. If the connection is re-established then the main node will sync
with the remote node again and cover data will not be lost (unless the
node was down).
|
|
OTP-10523
Since the will probably be cover compiled modules left in the remote
node, we want to keep the cover_server and it's ets tables even if
connection to remote node is lost. This way it will not crash (due to
ets:insert in non existing table) if functions in cover compiled
modules are executed.
|
|
OTP-10523
* Added cover:flush(Nodes), which will fetch data from remote nodes
without stopping cover on those nodes.
* Added cover:get_main_node(), which returns the node name of the main
node. This is used by test_server to avoid {error,not_main_node}
when a slave starts another slave (e.g. in test_server's own tests).
|
|
After stopping cover with cover:stop() there could still be a {'DOWN',...}
leftover message in the calling process's message queue.
This unexpected leftover could be eliminated if erlang:demonitor/2
with option flush would be used in certain points
|
|
|
|
File descriptors to import cover data are left opened.
When we export and import cover data many times,
leaked descriptors cause an error.
|
|
* ts/cover-with-export_all:
add user specified compiler options on form reloading
OTP-9204
|
|
|
|
Add write concurrancy to cover masters ?COVER_TABLE
|
|
|
|
|
|
with the bump info. This will make it faster to search the tables when analyzing and exporting data.
Also made cover export more parallel in how data is collected from the different nodes and also how data is read from ets. This should make the performance of cover much better on machines with multiple CPUs.
|
|
|
|
|
|
|
|
time. For each call a seperate process will be spawned to handle the request.
|
|
|
|
prevent memory usage explosion
|
|
In order to be able to test non-exported functions from another (test) module
it is necessary to compile the specific module (at least during the test phase)
with the export_all compiler option. This allows complete separation of testing
and productive code. At the moment it is not possible to combine this with a
test code coverage using the cover module. The problem is that when cover
compiling a module using cover:compile_* the code is reloaded into the emulator
omitting/filtering the passed user options. In my example above the export_all
option would be removed and the non-exported functions cannot be called any
more.
|
|
When cover generates HTML files and embeds source code within them, it
does not escape ampersands in the source code. These bare ampersands
get misinterpreted by web browsers as HTML character-entity
references; as a result, source code containing ampersands renders
improperly. This small patch fixes the problem by causing bare
ampersands to be escaped into as "&" character-entity references.
|
|
A race condition affecting Cover has been removed.
|
|
bug was introduced in R13B03. (Thanks to Matthew Sackman.)
|
|
|