Age | Commit message (Collapse) | Author |
|
The unicode update of test_server for R16A introduced a few potential
errors when logging to files. Sometimes ~tp or ~ts was used for
formatting also when writing to files that were not opened with the
{encoding,utf8} option. If then the argument contained unicode
characters above 255, the file descriptor would crash. This has been
corrected by the following modifications:
* Since the 'unexpected_io' log file is used only when the test case
HTML file is not available (e.g. between test cases), this file is
now also a HTML file and as other test_server HTML logs it is always
UTF-8 encoded
* Since it is possible to change which information is going to which
log file (with test_server_ctrl:set_levels/3), we do not have full
control over which information is written to which file. This means
that any printout could be written to the 'major' log file
(suite.log), which was earlier encoded as latin1. To avoid crashing
this file descriptor due to unicode strings, the 'major' log file is
now also encoded in UTF-8 (possible incopatibility).
* The cross_cover.info file is no longer a text file which can be read
with file:consult/1, instead it is written as a pure binary file
using term_to_binary when writing and binary_to_term when reading.
* The encoding of the file named 'last_name', which only content is
the path to the last run.<timestamp> directory, is now dependent on
the file name mode of the VM. If file names are expected to be
unicode, then the 'last_name' file is UTF-8 encoded, else it is
latin1 encoded.
Also, ~tp is changed back to ~p unless it is somehow likely that the
argument includes strings. It is not obvious that this is the correct
thing to do, but some decission had to be taken...
|
|
* Use UTF-8 encoding for all HTML files, except the HTML version of
the test suite generated with erl2html2:convert, which will have the
same encoding as the original test suite (.erl) file.
* Encode link targets in HTML files, allowing both special characters
like "/", "&", "?" etc, and latin1 or unicode characters.
* Use unicode modifier 't' with ~s and ~p when appropriate.
* Use unicode:characters_to_list and unicode:characters_to_binary for
conversion between binaries and strings instead of binary_to_list
and list_to_binary.
|
|
* siri/cross-cover/OTP-9870:
[test_server] Don't use print/3 in cross_cover_analyse
[common_test] Add documentation for cross cover analysis
[common_test] Add test case for cross cover mechanism
[test_server] Update documentation about cross cover
[test_server] Add test of code cover mechanism
[test_server,common_test] Fix cross cover mechansim
|
|
|
|
Before terminating slave nodes, test_server calls cover:flush/1 to
fetch data from the node without actually stopping cover on this
node. If cover is not stopped for the node and a new node with the
same name is started, then cover will be started on the new node. To
avoid this test_server now calls cover:stop/1 after the slave node is
terminated.
|
|
Update the interface for cross cover analysis (collection of cover
data over multiple tests) so it can be used via common_test and
directly with test server.
The concept of 'application' in the cross cover interface is removed
and replaced with an arbitrary Tag=atom() which identifies a test run.
|
|
Any call to test_server:break/1 should cancel all active
timetramps. In some cases, Suite:end_per_testcase/2 is executed on a
different process than the test case itself, and if
test_server:break/1 would be called from there, the timetraps would
not be cancelled. This has been corrected.
|
|
* bjorn/ct/minor-corrections:
test_server_io: Correct a few comments
Handle ct:abort_current_testcase/1 when executing parallel groups
Make sure that "Cover analysing..." is written to stdout
Make sure that "Testing..." is not written if testing has finished
|
|
The support for remote target nodes has not worked in a long time.
We are unlikely to ever need remot target node support and if
we'll need it will be easier to start over from scratch.
|
|
If it is written with io:fwrite/2 it will be written to
the unexpected_io log, where it will not be of any use.
|
|
Earlier, #st.config was set to undefined when entering this loop. Then
it was updated when the test case itself started. This means that if
the test case process crashed during test case initiation, the parent
process would not know the Config.
This commit saves the initial Config value in the parent process
(run_test_case_msgloop/1) from the start.
|
|
* siri/cover-tests: (21 commits)
[common_test] Extend timer for flushing error logger
[cover] Allow reconnection if node has been disconnected or down
[cover] Don't kill remote nodes when connection to main node is lost
[test_server] Add option {start_cover,false} to test_server:start_node
Use code:lib_dir instead of code:which to get application directory
[common_test] Add test for OTP-9956
Include all kernel modules in code coverage analysis
[common_test] Add test suite for code coverage support
[common_test, test_server] Don't flush cover if cover is not running
[common_test] Add option cover_stop
[test_server] Allow cross cover analysis when testing through common_test
[test_server] Start cover in test_server:wait_for_node
[test_server] Multiply timers with timetrap_scale_factor when starting nodes
Include all stdlib modules in code coverage analysis
[test_server] Include all test_server modules in code coverage analysis
Skip epp_SUITE:otp_8911 if cover is running
[common_test] Start cover on slave nodes if running cover tests
[common_test] Don't stop cover before stopping slave node
[test_server] Don't stop cover after test is finished
[cover] Add support for test_server
...
OTP-10427
|
|
By default the test server will start cover on all nodes when the test
is run with code coverage analysis. To make sure cover is not started
on a new node, this option can be set.
This can be useful if the test itself starts cover or if the new node
for some reason can not run cover compiled code.
|
|
By default, test_server will always stop cover (and thus load back the
non cover compiled original beam files) after a test with code
coverage analysis is completed. The new option allows the common_test
user to specify that cover shall not be stopped. This can be useful if
there are processes still running old code, i.e. processes that have
not done any fully qualified function call after the cover
compilation, since loading the original code then will kill those
processes. This is only recommended if the erlang node is to be
stopped after the test run, or if cover can be manually stopped.
|
|
Without this change, there is no support in test_server for starting
cover on a node started with option {wait,false}.
|
|
This commit removes all calls to cover:stop from test_server. This is
to avoid crash in some processes due to old code.
The correction shall be further refined for general use. There will,
for instance, be an option to turn off cover:stop/0 after completed
test run, so the default behaviour is backwards compatible.
|
|
Before line numbers were included in exceptions (in R15), there were
parse transforms and macros that would keep the test_server_loc
process dictionary variable updated; therefore there is a mod_loc/1
function that will normalize the representation of locations.
Simplify the code as following:
* 'test_server_loc' should always contain a list with one or more
tuples. ({M,F} or {M,F,Line})
* At the beginning of each test case, set 'test_server_loc' to
[{Module,Func}] of the the currently executing test case.
* Stop updating 'test_server_loc', except when an exception occurs.
(It used to be updated when running 'init_per_testcase' and so on.)
* Remove the mod_loc/1 function.
|
|
Three pieces of information could be out of sync in testcase
supervisor process at the time when a timetrap occurred:
* test_server_loc (process dictionary) - may indicate that a
framework function is executing
* test_server_init_or_end_conf (process dictionary) - indicates whether
init_per_testcase or end_per_testcase is executing
* The current configuration (#st.config) - set using a synchronous
call
There could be in a crash in spawn_fw_call/7 because the current
configuration was not defined when it was expected to.
To avoid the problem, introduce set_tc_state/2 (and a corresponding
message) to allow setting both an indication what the testcase is
executing (e.g. init_per_testcase, framework call, and so on), and
the current configuration. Use only that information to handle
a timetrap timeout (and aborted testcase and the other reasons
for the testcase process to terminate). Completely remove
test_server_init_or_end_conf.
|
|
The Loc argument was use to determine the name of the currently
executing test case, in case that the M and F arguments did not
specify a test case.
Since a previous commit makes sure that the M and F arguments *are*
valied, we can eliminate the Loc argument.
|
|
The code is not actually shorter, but it avoids duplicating the code
for producing an error tuple when theres is no priv_dir tuple in
the config data.
|
|
Keeping all state as separate function arguments does not make it
easy to add more pieces of data to the state. Case in point is the
CurrConf argument where up to three separate items have been
shoehorned in.
Instead of the arguments, introduce a state record to hold all of the
different pieces of state (taking care to separate the former CurrConf
variable into separate fields in the record).
While at it, fix a bug. The name of the currently executing test
case (module and function) used to be stored in a tuple in the CurrConf
variable, and it would only be available after 'set_curr_conf' message
has been received. Depending on timing, it was possible in rare
circumstances for an EXIT signal to arrive before the 'set_curr_conf'
message. Avoid this problem by putting the current test case
name into the record from the beginning. That also means that we
can eliminate the workaround of getting the currently executing test case
from the stack trace using the get_mf/1.
|
|
|
|
|
|
|
|
|
|
|
|
* origin/peppe/common_test/break_and_continue:
Fix error in documentation
Implement support for test case execution break/continue
Conflicts:
lib/common_test/src/ct.erl
lib/common_test/src/ct_run.erl
OTP-10127
OTP-10172
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OTP-9988
|
|
* origin/peppe/common_test/otp-9666:
Set correct group leader for end_per_testcase process after tc timeout
OTP-9666
|
|
Also make sure that warnings about failure or timeout of end_per_testcase
(after a test case timeout) get printed in the test case log file.
OTP-9666
|
|
Introduce the optional feature to have Test Server generate
priv_dir directory names that are unique for each test case
or config function. The name of the option/flag is
'unique_priv_dir' and it can be set to value 'auto' or
'manual'. If auto, Test Server creates each priv_dir
automatically (can be expensive in case of many and/or repeated
cases). If manual, the user needs to create the priv_dir
explicitly by calling ct:make_priv_dir/0.
|
|
* origin/peppe/common_test/otp-9904_9900:
Introduce error notification printout in the tc log
OTP-9904
OTP-9900
|
|
Also fix problem with parallel test cases printing "into each other"
(when using ct:print or ct:pal).
OTP-9904
OTP-9900
|
|
OTP-9958
|
|
* origin/peppe/common_test/otp-9855:
Ensure that comments always get printed in the overview log file
OTP-9855
|
|
OTP-9855
|
|
OTP-9930
|
|
|
|
OTP-9235
|
|
|
|
|
|
The log files should be independent of the Common Test installation.
|
|
Also make general improvements of presentation of results.
OTP-9706
|
|
* dev: (38 commits)
Update documentation
Rid ct_telnet of doc build warnings
Create temporary fix for problem with parallel test cases
Update primary bootstrap
Correct "Missing Suites" link
Add documentation on timetraps and start flags
Add missing tests for timetrap handling and fix remaining errors
Solve problem with ct_init/end_per_group being counted as test cases
Fix errors in test suites
Fix invalid call to undefined function
Fix problem with test_server_ctrl creating invalid conf test
Improve info in CT framework log
Update vsn.mk for common_test and test_server
Enhance logging performance
Change order of include files
Add link to last executed test suite on index page
Fix problem with location value when init config func calls help func
Fix crash when CTHook init fails
Correct error in test suite
Fix error with incorrect notification after end_per_testcase craches
...
Conflicts:
bootstrap/bin/start.boot
bootstrap/bin/start_clean.boot
bootstrap/lib/compiler/ebin/beam_asm.beam
bootstrap/lib/compiler/ebin/beam_disasm.beam
bootstrap/lib/compiler/ebin/compile.beam
bootstrap/lib/compiler/ebin/sys_pre_expand.beam
bootstrap/lib/kernel/ebin/code.beam
bootstrap/lib/kernel/ebin/code_server.beam
bootstrap/lib/kernel/ebin/hipe_unified_loader.beam
bootstrap/lib/kernel/ebin/inet.beam
bootstrap/lib/kernel/ebin/inet_config.beam
bootstrap/lib/kernel/ebin/inet_dns.beam
bootstrap/lib/stdlib/ebin/beam_lib.beam
bootstrap/lib/stdlib/ebin/dets.beam
bootstrap/lib/stdlib/ebin/erl_compile.beam
bootstrap/lib/stdlib/ebin/erl_internal.beam
bootstrap/lib/stdlib/ebin/erl_scan.beam
bootstrap/lib/stdlib/ebin/erl_tar.beam
bootstrap/lib/stdlib/ebin/io_lib_fread.beam
bootstrap/lib/stdlib/ebin/otp_internal.beam
bootstrap/lib/stdlib/ebin/sofs.beam
bootstrap/lib/stdlib/ebin/supervisor.beam
bootstrap/lib/stdlib/ebin/zip.beam
lib/common_test/src/ct.erl
lib/common_test/src/ct_run.erl
lib/common_test/test/ct_error_SUITE.erl
lib/common_test/test/ct_repeat_1_SUITE.erl
lib/common_test/test/ct_skip_SUITE.erl
lib/test_server/src/test_server.erl
|