Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
OTP-11046
|
|
To use from any process to print a string in the unexpected_io.log.
|
|
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.
|
|
In test_server_io:gc/1 we collect the group leaders for all processes.
We must handle the case that a process has died after processes/0
was called and process_info(P, group_leader) is called.
|
|
|
|
When writing messages to stdout, all messages are prefixed with
"Testing" followed by the name of the test suite. We don't want
to write that prefix if testing has stopped.
|
|
|