aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
AgeCommit message (Collapse)Author
2016-05-09Merge branch 'bjorn/stdlib/warning-and-error/OTP-13476'Björn Gustavsson
* bjorn/stdlib/warning-and-error/OTP-13476: Add documentation epp: Add the -error and -warning directives epp: Refactor expansion of header path
2016-05-04Merge branch 'raimo/polish-gen_statem/OTP-13065'Raimo Niskanen
* raimo/polish-gen_statem/OTP-13065: Fix documentation Clean up terminate functions Fix callback mode after code change not used Restructure loop_* to clarify S handling
2016-05-04epp: Add the -error and -warning directivesBjörn Gustavsson
If one of several alternatives configurations are required for an Erlang module to compile, but none are available, it would be useful to give a nice error message. For example: -ifdef(CONFIG_A). %% Some code if A is true. -else. -ifdef(CONFIG_B). %% Some code if B is true. -else. -error("Neither CONFIG_A nor CONFIG_B are available"). -endif. -endif. If neither CONFIG_A nor CONFIG_B are defined, the error message will be: module.erl:10: -error("Neither CONFIG_A nor CONFIG_B are available"). That is basically the same behavior as for the #error directive in GCC. For symmetry with the -error directive, add the -warning directive to generate a compiler warning. For example: -ifdef(HAVE_COOL_FEATURE). %% Code if we have Cool Feature. -else. %% Inefficient fallback code. -warning("Using inefficient fallback"). -endif. If HAVE_COOL_FEATURE is not defined, the warning message will be: module.erl:8: Warning: -warning("Using inefficient fallback"). That is basically the same behavior as for the #warning directive in GCC. Conflicts: lib/stdlib/src/epp.erl lib/stdlib/test/epp_SUITE.erl
2016-05-02stdlib: Strengthen map pattern testsBjörn-Egil Dahlberg
2016-05-02stdlib: Add lint tests for parallel match of mapsBjörn-Egil Dahlberg
2016-05-02stdlib: Refactor erl_lint_SUITEBjörn-Egil Dahlberg
2016-04-29Merge branch 'jlouis/stdlib/implement-lists-join/PR-1012/OTP-13523'Björn Gustavsson
* jlouis/stdlib/implement-lists-join/PR-1012/OTP-13523: Implement lists:join/2
2016-04-28stdlib: Add pretty-printing of exact map typesHans Bolinder
2016-04-28Merge branch 'egil/maps-api-additions/PR-1025/OTP-13522'Björn-Egil Dahlberg
* egil/maps-api-additions/PR-1025/OTP-13522: stdlib: Document maps:update_with/3,4 stdlib: Add tests for maps:update_with/3,4 stdlib: Add maps:update_with/3,4 erts: Add tests for maps:take/2 stdlib: Document maps:take/2 erts: Add BIF maps:take/2
2016-04-27stdlib: Add tests for maps:update_with/3,4Björn-Egil Dahlberg
2016-04-27Fix callback mode after code change not usedRaimo Niskanen
2016-04-25Merge branch 'raimo/new-gen-state-machine/OTP-13065'Raimo Niskanen
* raimo/new-gen-state-machine/OTP-13065: (52 commits) Add section on state filtering Promote gen_statem over gen_fsm Modify code_change/4 to return CallbackMode Use ?NAME macro in examples Introduce Fred Herbert suggested additions Introduce corrections from Fred Hebert and Ingela Use .png pictures instead of .gif Write Design Principles chapter Fix missing short forms for event timeout Do more intricate Fred Hebert doc changes Change Caller -> From as suggested by Fred Hebert Do documentation improvements from Fred Hebert Fix broken documenation reference Rename state_timeout -> event_timeout Fix most of the system docs and emacs mode Change code_change/4 to {ok,State,Data} Fixup sharpened test suite Sharpen test suite Remove the remove_event action and all alike Relax caller() type check and cleanup ... Conflicts: lib/stdlib/src/gen.erl lib/stdlib/src/gen_event.erl lib/stdlib/src/gen_fsm.erl lib/stdlib/src/gen_server.erl lib/stdlib/test/error_logger_forwarder.erl
2016-04-25stdlib: Remove use of crypto:rand_bytes/1Ingela Anderton Andin
The use case is not cryptographical but we want to compare Erlang implementation to c implementation so use crypto:strong_rand_bytes anyway.
2016-04-21Modify code_change/4 to return CallbackModeRaimo Niskanen
Also move check of non-atom states in callback mode state_functions to where the state function is called. This gives homogenous diagnostics for state functions, code_change/4 and system_replace_state StateFun. Irregularities pointed out by James Fish.
2016-04-18stdlib: The type map() is built-inHans Bolinder
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-12Fix missing short forms for event timeoutRaimo Niskanen
2016-04-09Implement lists:join/2Jesper Louis Andersen
Add a call which works much like string:join/2 but for arbitrary lists. Provide the function itself, lifted from Haskells Data.List standard library, provide documentation and provide tests for the function.
2016-04-05Merge branch 'lukas/stdlib/error_logger_SUITE/OTP-13471'Lukas Larsson
* lukas/stdlib/error_logger_SUITE/OTP-13471: stdlib: Fix logfile testcase for hipelibs testrun
2016-03-30stdlib: Fix logfile testcase for hipelibs testrunLukas Larsson
2016-03-30gen_fsm_SUITE: Make abnormal1/1 stop failingBjörn Gustavsson
abnormal1/1 started failing sporadically when 22785cd1e21 changed using the messages_get/0 and using its own implementation: get_messages() -> receive Msg -> [Msg|get_messages()] after 1 -> [] end. In test_server:messages_get/0, there was "after 0" instead of "after 1" as in this version. We could change back to using "after 0", but it seems that the test case just happened to work before the change. Instead, read out the message that is guranteed to be in the message queue, and *then* check that the message queue is empty.
2016-03-30gen_fsm_SUITE: Use timer:sleep/1 instead of ct:sleep/1Björn Gustavsson
In 8d7d5627, test_server:sleep/1 was changed to ct:sleep/1. Change it to timer:sleep/1 to make the timing more exact (ct:sleep/1 will call another process).
2016-03-15stdlib: Cuddle with ets_SUITE:evil_renameSverker Eriksson
to make it kill and then wait for all spawned processes to exit.
2016-03-15update copyright-yearHenrik Nord
2016-03-09Eliminate use of ?config() macroBjörn Gustavsson
2016-03-09Remove ?line macrosBjörn Gustavsson
While we are it, also re-ident the files.
2016-03-09Replace "%" with "%%" at the beginning of a lineBjörn Gustavsson
We want to re-ident the source files after having taken out all ?line macros. When re-indenting using Emacs, it's important that comments that should be at the beginning of a line (or follow the indentation of statements around it) must start with "%%".
2016-03-09Eliminate 'suite' and 'doc' clausesBjörn Gustavsson
2016-03-09gen_server_SUITE: Eliminate use of test_server:timecall/3Björn Gustavsson
2016-03-09Use 'test_server' instead of ?t macroBjörn Gustavsson
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