aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
AgeCommit message (Collapse)Author
2016-03-09Eliminate use of test_server:messages_get/0Björn Gustavsson
2016-03-09sys_SUITE: Replace test_server:capture*/0 with ct:capture*/0Björn Gustavsson
2016-03-09sys_SUITE: Mend test cases that didn't test what they shouldBjörn Gustavsson
The return values for lists:prefix/2 and lists:member/2 were ignored.
2016-03-09Replace calls to test_server:sleep/1 with ct:sleep/1 or timer:sleep/1Björn Gustavsson
Note that the sleeping time in ct:sleep/1 will be scaled if the test is run with (for example) cover. When it is important that the sleep time is not adjusted, use timer:sleep/1.
2016-03-09Eliminate use of test_server:do_times()Björn Gustavsson
2016-03-09Replace use of test_server:format/2 with io:format/2Björn Gustavsson
There is no practial difference.
2016-03-09Eliminate use of test_server:fail/0,1Björn Gustavsson
2016-03-09Modernize use of timetrapsBjörn Gustavsson
Either rely on the default 30 minutes timetrap, or set the timeout using the supported methods in common_test.
2016-03-09Merge branch 'maint'Siri Hansen
Conflicts: lib/common_test/test/Makefile
2016-03-09Merge branch 'siri/test-ct_release_test/OTP-13390' into maintSiri Hansen
* siri/test-ct_release_test/OTP-13390: Remove upgrade tests from stdlib_SUITE Add test of ct_release_test
2016-03-09Remove upgrade tests from stdlib_SUITESiri Hansen
The test cases minor_upgrade and major_upgrade used ct_release_test. The point of the tests in stdlib was mainly to test ct_release_test. ct_release_test produces a 'from-release' based on an old version of the application under test (in this case stdlib) and new versions of all other applications. But since it is not always a good idea to load an old version of stdlib into a new emulator (e.g. in the OTP-19.0 emulator), these tests are removed. Instead new tests are added for ct_release_test in common_test.
2016-03-09Merge branch 'maint'Björn Gustavsson
* maint: io_SUITE: Don't fail on fast computers with rough timers Fix code_SUITE after test_server change Set default value for crash_dump_dir
2016-03-09Merge branch 'bjorn/cuddle-with-tests' into maintBjörn Gustavsson
* bjorn/cuddle-with-tests: io_SUITE: Don't fail on fast computers with rough timers
2016-03-08Merge branch 'maint'Sverker Eriksson
2016-03-08Merge branch 'sverk/bad_printable_range' into maintSverker Eriksson
* sverk/bad_printable_range: stdlib: Fix io_SUITE:bad_printable_range for windows
2016-03-08Test windows registry in places we are allowed to writeDan Gudmundsson
Since Windows 8 we are not allowed (in non elevated mode) to write to hklm.
2016-03-07stdlib: Fix io_SUITE:bad_printable_range for windowsSverker Eriksson
avoid os:cmd as it treats stderr different on windows.
2016-03-07io_SUITE: Don't fail on fast computers with rough timersBjörn Gustavsson
On a computer which is fast, but with timers with low resolution, the measured time for an empty queue could be zero, which could cause the test case to fail. Add a calibration function to scale up the amount the amount of work so that the measured time will not be lower than 50 ms.
2016-03-02stdlib: Add filename:basedir/2,3Björn-Egil Dahlberg
2016-03-02stdlib: Use parallel groups in filename_SUITEBjörn-Egil Dahlberg
2016-03-02stdlib: Remove ?line macros in filename_SUITEBjörn-Egil Dahlberg
2016-03-02Change code_change/4 to {ok,State,Data}Raimo Niskanen
2016-03-02Fixup sharpened test suiteRaimo Niskanen
2016-02-29Sharpen test suiteRaimo Niskanen
2016-02-29Remove the remove_event action and all alikeRaimo Niskanen
Removing events from the internal queues is not necessary with the choosen semantics of the event queue vs. hibernate. In an early implementation it was possible by combining hibernate with e.g. postpone to get an event in the queue that you would not see before processing the postponed event, and therefore should you decide to cancel a timer it was essential to be able to remove that unseen event from the queue. With the choosen semantics you will have to postpone or generate an event for it to be in the event queue, and if you e.g. postpone a timeout event and then cancel the timer it is your mistake. You have seen the event and should know better than to try to cancel the timer. So, the actions: remove_event, cancel_timer, demonitor and unlink are now removed. There have also been some cleanup of the timer handling code.
2016-02-26Test the order for multiple next_eventRaimo Niskanen
2016-02-26ct:ify test suiteRaimo Niskanen
2016-02-26Allow actions without containing listRaimo Niskanen
Type check atom state as early as possible
2016-02-26Implement 'keep_state_and_data' and 'stop'Raimo Niskanen
2016-02-25Remove {keep_state_and_data}Raimo Niskanen
Correct typo reported by Luïc Hoguin.
2016-02-24Ditch PrevStateRaimo Niskanen
StateName/4 -> StateName/3 handle_event/5 -> handle_event/4
2016-02-24Ditch State so StateName/5 -> StateName/4Raimo Niskanen
2016-02-23Add {stop_and_reply,Reason,Replies [,Data])Raimo Niskanen
Cleanup some error handling
2016-02-22Make callback_option() mandatoryRaimo Niskanen
2016-02-19Update terminology to data(), transition_op(), etcRaimo Niskanen
2016-02-19Add reply([Reply])Raimo Niskanen
2016-02-19Add {keep_state,...} and {keep_state_and_data,...}Raimo Niskanen
2016-02-18Write some convenience helpersRaimo Niskanen
2016-02-18Merge branch 'bjorn/stdlib/function-macro/OTP-13059'Björn Gustavsson
* bjorn/stdlib/function-macro/OTP-13059: Implement ?FUNCTION_NAME and ?FUNCTION_ARITY macros epp: Refactor expand_macros()
2016-02-18Merge branch 'bjorn/remove-test_server/OTP-12705'Björn Gustavsson
* bjorn/remove-test_server/OTP-12705: Remove test_server as a standalone application Erlang mode for Emacs: Include ct.hrl instead test_server.hrl Remove out-commented references to the test_server applications Makefiles: Remove test_server from include path and code path Eliminate use of test_server.hrl and test_server_line.hrl
2016-02-18Rename retry -> postponeRaimo Niskanen
2016-02-18Rename insert_event -> next_eventRaimo Niskanen
2016-02-18Implement option callback_modeRaimo Niskanen
2016-02-17Implement ?FUNCTION_NAME and ?FUNCTION_ARITY macrosBjörn Gustavsson
For a long time, users have asked for one or more macros that would return the name and arity of the current function. We could define a single ?FUNCTION macro that would return a {Name,Arity} tuple. However, to access just the name or just the arity for the function, element/2 must be used. That would limit its usefulness, because element/2 is not allowed in all contexts. Therefore, it seems that we will need two macros. ?FUNCTION_NAME that expands to the name of the current function and ?FUNCTION_ARITY that expands to arity of the current function. Converting the function name to a string can be done like this: f() -> atom_to_list(?FUNCTION_NAME) ++ "/" ++ integer_to_list(?FUNCTION_ARITY). f/0 will return "f/0". The BEAM compiler will evaluate the entire expression at compile-time, so there will not be any run-time penalty for the function calls. The implementation is non-trivial because the preprocessor is run before the parser. One way to implement the macros would be to replace them with some placeholder and then let the parser or possibly a later pass replace the placeholder with correct value. That could potentially slow down the compiler and cause incompatibilities for parse transforms. Another way is to let the preprocessor do the whole job. That means that the preprocessor will have to scan the function head to find out the name and arity. The scanning of the function head can be delayed until the first occurrence of a ?FUNCTION_NAME or ?FUNCTION_ARITY. I have chosen the second way because it seems less likely to cause weird compatibility problems.
2016-02-17stdlib: Let the linter detect old typed recordsHans Bolinder
2016-02-17stdlib: Update module shell to handle typed record fieldsHans Bolinder
2016-02-17stdlib: Update ms_transform to handle typed record fieldsHans Bolinder
2016-02-17stdlib: Modify the preprocessor as to expose typed record fieldsHans Bolinder
Problem: The types of record fields have since R12B been put in a separate form by epp:parse_file(), leaving the record declaration form untyped. The separate form, however, does not follow the syntax of type declarations, and parse transforms inspecting -type() attributes need to know about the special syntax. Since the compiler stores the return value of epp:parse_file() as debug information in the abstract code chunk ("Abst" or 'abstract_code'), tools too need to know about the special syntax, if they inspect -type() attributes in abstract code. Solution: As of this commit no separate form is created by epp:parse_file(), but the type information kept in the record fields. This means that all parse transforms and all tools inspecting -record() declarations need to recognize {typed_record_field, Field, Type}. We recommend that all parse transforms and tools be updated as to recognize typed record fields. Discussion: As of OTP 19.0, the abstract form of type declarations and function specifications is documented. An (unsatisfactory) alternative to the above solution is to document two formats of the abstract form of typed record fields: one if returned by epp:parse_file(); and one if returned by, for example, epp:parse_erl_form(). Yet another (bad) alternative is to not document the format returned by epp:erl_parse(), but instead document the idempotent function epp:restore_typed_record_fields/1, and urge authors of parse transform and tools to always call this function.
2016-02-17Makefiles: Remove test_server from include path and code pathBjörn Gustavsson
Since no test suites includede test_server.hrl, there is no need to have test_server in the include path or code path.
2016-02-17Eliminate use of test_server.hrl and test_server_line.hrlBjörn Gustavsson
As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl.