aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server
AgeCommit message (Collapse)Author
2012-10-26Simplify managment of test_server_locBjörn Gustavsson
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.
2012-10-26Keep the information about the current test case consistentBjörn Gustavsson
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.
2012-10-26test_server: Eliminate the Loc argument for do_end_tc_call()Björn Gustavsson
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.
2012-10-26Refactor the handling of the make_priv_dir messageBjörn Gustavsson
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.
2012-10-26test_server: Refactor run_test_case_msgloop()Björn Gustavsson
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.
2012-10-26Merge branch 'bjorn/test_server/test-cases'Björn Gustavsson
* bjorn/test_server/test-cases: test_server tests: Be kind to Windows by using shorter pathnames
2012-10-26Merge branch 'bjorn/ct/separate-io-server/OTP-10101'Björn Gustavsson
* bjorn/ct/separate-io-server/OTP-10101: Test ct:capture/start/stop/get Introduce ct_group_leader_SUITE that does nasty things with group leaders Eliminate unexpected I/O to the minor log file Introduce test_server_io and test_server_gl Clean up initialization of parallel test cases Introduce is_io_buffered/0 to somewhat improve readability test_server_ctrl: Consistently use set_io_buffering/1
2012-10-25[test_server] Set data_dir correctly when suite is cover compiledSiri Hansen
If the test suite itself was included in code coverage analysis, then test_server_ctrl would not manage to set data_dir correctly for the test, since it relied on the result of code:which(Suite). This has been corrected.
2012-10-25test_server tests: Be kind to Windows by using shorter pathnamesBjörn Gustavsson
The pathnames gets too long for Windows if we use priv_dir as working directory for the test_server tests in the slave node. Use data_dir instead. Revert this commit when the run-time system can handle long pathnames on Windows.
2012-10-23Eliminate unexpected I/O to the minor log fileBjörn Gustavsson
2012-10-23Introduce test_server_io and test_server_glBjörn Gustavsson
2012-10-23Clean up initialization of parallel test casesBjörn Gustavsson
2012-10-23Introduce is_io_buffered/0 to somewhat improve readabilityBjörn Gustavsson
Note that there are some more direct use of: get(test_server_common_io_handler) that cannot be replaced with a call to is_io_buffered/0.
2012-10-23test_server_ctrl: Consistently use set_io_buffering/1Björn Gustavsson
Since we will want to change the implementation of I/O buffering in a future commit, make sure that all updates of the buffering state is done by calling set_io_buffering/1.
2012-10-12Merge branch 'egil/add-scalefactor-to-start_node'Björn-Egil Dahlberg
* egil/add-scalefactor-to-start_node: test_server: Let start_node/3 utilize scalefactor test_server: Refactor timetrap_scale_factor/0
2012-10-08test_server: Let start_node/3 utilize scalefactorBjörn-Egil Dahlberg
* test_server_node:start_node/3 now uses timetrap_scale_factor for timeouts (peer nodes)
2012-10-08test_server: Refactor timetrap_scale_factor/0Björn-Egil Dahlberg
2012-10-05ts_run: Always turn on timetrap scaling when starting common_testBjörn Gustavsson
Scaling timetraps depending on cover, debug-compiled emulator and so on is built-in to the test_server. Therefore, {multiply_timetraps,Scale} should not be set (it would multiply the timeout value twice). Only {scale_timetraps,true} needs to be set, and it must be set unconditionally as the feature tests in test_server:timetrap_scale_factor() may not return the correct scale factor until the test_server node and test cases have been started (for example, there is no cover server running).
2012-10-03Merge branch 'bjorn/test_server/fix-test-cases'Björn Gustavsson
* bjorn/test_server/fix-test-cases: Provided better information when the test cases fail Remove the useless test_server_line_SUITE test suite test_server_SUITE: Remove the undefined_functions/1 test case
2012-10-01Provided better information when the test cases failBjörn Gustavsson
While at it, also make the path to the directory with the log files a clickable link.
2012-10-01Merge branch 'bjorn/test_server/dialyzer-fixes'Björn Gustavsson
* bjorn/test_server/dialyzer-fixes: test_server_ctrl: Don't use undocumented features of io:format() Fix obsolete assumption for the return type of os:type/0
2012-09-27Merge branch 'dgud/ct/fix-trashed-logs/OTP-10369'Dan Gudmundsson
* dgud/ct/fix-trashed-logs/OTP-10369: [ct] Shorten testcase names Shorten testcase names [ct] Block output into single io call
2012-09-26test_server_ctrl: Don't use undocumented features of io:format()Björn Gustavsson
The Format string argument for io:format/3 is not documented to accept an iolist, so we should not depend on it. Fix the problem by using io:put_chars/2 instead.
2012-09-26Remove the useless test_server_line_SUITE test suiteBjörn Gustavsson
The test_server_line parse transform module was removed in R15 (in f43c0a51cd15b2b0f8adba4bb9ec5531dd9d8820), but not the corresponding test cases. (Strangely enough, the test cases did not fail; it was because init_per_testcase/2 failed and the corresponding test case was skipped.)
2012-09-26test_server_SUITE: Remove the undefined_functions/1 test caseBjörn Gustavsson
The undefined_functions/1 test case will fail if it is run using an uninstalled Erlang/OTP system (i.e. in a source tree/git repository). Since the test_server application is now a part of Erlang/OTP (it was not originally), the system-wide test case that looks for use of undefined functions will catch undefined functions. Therefore the easiest solution is to remove the test case.
2012-09-26Fix obsolete assumption for the return type of os:type/0Björn Gustavsson
os:type/0 could (a long, long time ago) return atoms such as 'vxworks' instead of a two-tuple.
2012-09-20Merge branch 'bjorn/ct-fix-silent-death/OTP-9769'Björn Gustavsson
* bjorn/ct-fix-silent-death/OTP-9769: Teach test_server to report severe errors to common_test test_server_ctrl: Present "cannot create log dir" errors more neatly test_server_ctrl: Don't die in stop_extra_tools/1
2012-09-20ts: Remove the non-working ts:clean/0,1 commandsBjörn Gustavsson
The commands no longer work now that ts is a wrapper for common_test (instead of for test_server), and no one seems to have missed them.
2012-09-20ts: Remove the obsolete ts:index/0 commandBjörn Gustavsson
The ts:index/0 command only works with test_server log directories. The functionality to generate an overview of all tests run is now provided by common_test itself.
2012-09-20ts: Remove the unused module ts_selftestBjörn Gustavsson
2012-09-20ts_run: Make errors from ct:run_test/1 visibleBjörn Gustavsson
The ts wrapper module invokes common_test by calling the ct:run_test/1 function using "erl -eval Cmd". Since ct:run_test/1 is intended to by called from the Erlang shell, it returns error values rather than printing them. Therefore, when an error occurs, users of ts may not see any error indication. Introduce the ts_run:ct_run_test/2 wrapper which invokes ct:run_test/1 and prints out any error that occurs.
2012-09-19[ct] Block output into single io callDan Gudmundsson
Add newlines to the same io function call, so that concurrent io always starts at a new line.
2012-09-19Teach test_server to report severe errors to common_testBjörn Gustavsson
If a severe error occurs in test_server (e.g. failing to write to log files), test_server would terminate without commont_test knowing about it. Since ct_run can now return an exit code, it is important that common_test is aware of severe problem so that it can indicate that an error has occurred.
2012-09-19test_server_ctrl: Present "cannot create log dir" errors more neatlyBjörn Gustavsson
2012-09-19test_server_ctrl: Don't die in stop_extra_tools/1Björn Gustavsson
If it is not possible for test_server_ctrl:start_log_file/0 to create the log file directory or log files, then stop_extra_tools/1 (called from init_tester/10) is also likely to crash and hide the original error reason. That will be confusing to the user. Therefore, catch the call to stop_extra_tools/1.
2012-09-04Merge tag 'OTP_R15B02'Björn-Egil Dahlberg
The R15B02 release
2012-09-03Prepare releaseOTP_R15B02Erlang/OTP
2012-08-31Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: lib/diameter/autoconf/vxworks/sed.general xcomp/README.md
2012-08-31Update copyright yearsBjörn-Egil Dahlberg
2012-08-30Merge remote branch 'upstream/maint'Peter Andersson
2012-08-29Update the documentation for R15B02Peter Andersson
OTP-10050 OTP-10069 OTP-10072 OTP-10087 OTP-9865 OTP-10049 OTP-10089 OTP-10145 OTP-9896 OTP-10135 OTP-10067 OTP-9625 OTP-10127 OTP-10172 OTP-10248 OTP-9625 OTP-10086
2012-08-27Merge branch 'maint'Lukas Larsson
* maint: Bumped version nr ssl & public_key: Workaround that some certificates encode countryname as utf8 and close down gracefully if other ASN-1 errors occur. Add more cross reference links to ct docs Remove config option from common_test args Update user config to use nested tuple keys Allow mixed IPv4 and IPv6 addresses to sctp_bindx Add checks for in6addr_any and in6addr_loopback Fix SCTP multihoming observer: fix app file (Noticed-by: Motiejus Jakstys) Fix lib/src/test/ssh_basic_SUITE.erl to fix IPv6 option typos Prevent index from being corrupted if a nonexistent item is deleted Add tests showing that trying to delete non-existing object may corrupt the table index Fix Table Viewer search crash on new|changed|deleted rows Escape control characters in Table Viewer Fix Table Viewer crash after a 'Found' -> 'Not found' search sequence inet_drv.c: Set sockaddr lengths in inet_set_[f]address Conflicts: erts/preloaded/ebin/prim_inet.beam
2012-08-27Merge branch 'lukas/common_test/deep_get_config/OTP-9626' into maintLukas Larsson
* lukas/common_test/deep_get_config/OTP-9626: Add more cross reference links to ct docs Remove config option from common_test args Update user config to use nested tuple keys
2012-08-24Merge branch 'maint'Siri Hansen
2012-08-24Update vsn.mk filesPeter Andersson
2012-08-23Merge branch 'maint'Peter Andersson
2012-08-23Solve problems with verbosity levels and parallel test casesPeter Andersson
2012-08-23Merge branch 'maint'Peter Andersson
2012-08-23Merge remote branch 'origin/peppe/common_test/break_and_continue' into maintPeter Andersson
* 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
2012-08-23Merge branch 'maint'Peter Andersson