Startup function is not properly documented
I have configured a Run Configuration called "Test" (see screenshot) and try to run a test method "test/0" module "test_file" with it.When I run the program I expect an "ok" to be returned and the program to exit, but nothing happens, and the process keeps on running.
Am I missing something here?
Am I missing something here?
Leave a comment
on 2010-10-25 02:11 *
By Vlad Dumitrescu
Found in version changed from 0.8.8 to 0.9.0
Difficulty changed from Normal(3) to Easiest (1)
Component changed from None to docs
Milestone changed from backlog to sprint #10
Permission type changed from Private to Public
Summary changed from Test Function Does Not Execute to Startup function is not properly documented
Found in version changed from 0.8.8 to 0.9.0
Difficulty changed from Normal(3) to Easiest (1)
Component changed from None to docs
Milestone changed from backlog to sprint #10
Permission type changed from Private to Public
Summary changed from Test Function Does Not Execute to Startup function is not properly documented
Hi and thanks for the report!
This is not a bug, but the documentation doesn't say anything about how it works. I will keep the ticket (with changed title) to remind us to fix the docs.
When launching a configuration, it is like starting an Erlang vm from the shell. The function specified for startup is added to the command line as a "-s" argument. This means that it is run and the runtime keeps executing. The startup function is meant to start any needed applications and processes for your system, then you can use the shell to interact with it.
The result from the startup function doesn't go anywhere (and unfortunately output from io:format gets lost), so it's not obvious how to check that it has run. You can start an application or start a registered process (that doesn't die right away :-) and check from the shell that they are indeed up and running.
Is this explanation ok? Do you think it's enough to add this to the docs?
This is not a bug, but the documentation doesn't say anything about how it works. I will keep the ticket (with changed title) to remind us to fix the docs.
When launching a configuration, it is like starting an Erlang vm from the shell. The function specified for startup is added to the command line as a "-s" argument. This means that it is run and the runtime keeps executing. The startup function is meant to start any needed applications and processes for your system, then you can use the shell to interact with it.
The result from the startup function doesn't go anywhere (and unfortunately output from io:format gets lost), so it's not obvious how to check that it has run. You can start an application or start a registered process (that doesn't die right away :-) and check from the shell that they are indeed up and running.
Is this explanation ok? Do you think it's enough to add this to the docs?
on 2010-10-25 02:50 *
By Vlad Dumitrescu
Assigned to set to vladdu
Status changed from New to Accepted
Assigned to set to vladdu
Status changed from New to Accepted
on 2010-10-30 15:36 *
By Jon_Kristensen
Thank you for your reply. I think it would be appropriate to add something about this to the runtime configuration "Erlang" tab "Start" section or somewhere there.
Is it possible to get the Erlang shell in the console tab? I noticed it got there when debugging but not when running. If so, perhaps you could provide a checkbox for it in the launch configuration?
Is it possible to get the Erlang shell in the console tab? I noticed it got there when debugging but not when running. If so, perhaps you could provide a checkbox for it in the launch configuration?
on 2010-10-30 16:58 *
By Jon_Kristensen
Also, possibly related to documenting these kind of features:
When I set up a new debug launch configuration, am I supposed to just insert an arbitrary node name or do I have to configure something? I can't seem to get breakpoints to work. If I should be able to get it working just inputting something like testnode@localhost then I have another bug to file... :)
When I set up a new debug launch configuration, am I supposed to just insert an arbitrary node name or do I have to configure something? I can't seem to get breakpoints to work. If I should be able to get it working just inputting something like testnode@localhost then I have another bug to file... :)
on 2010-11-09 01:32 *
By Vlad Dumitrescu
Sorry for the late answer, I was on vacation.
The Erlang shell should be displayed even when running (not just when debugging). Sometimes you need to open the console view yourself and look for it there, I'm not sure why.
The whole console support is not good, it's the most requested improvement, but we don't have enough time to fix it right away (it's a lot of work).
The Erlang shell should be displayed even when running (not just when debugging). Sometimes you need to open the console view yourself and look for it there, I'm not sure why.
The whole console support is not good, it's the most requested improvement, but we don't have enough time to fix it right away (it's a lot of work).
on 2010-11-09 01:36 *
By Vlad Dumitrescu
regarding node names, you can put anything there, but without the "@hostname" part (if I remember correctly). If a node with that name is already running, it is used; if not, it is started.
Don't breakpoints work at all, or just in relation with the startup function? The latter may have problems, but the former works.
Don't breakpoints work at all, or just in relation with the startup function? The latter may have problems, but the former works.
on 2010-11-24 07:52 *
By Vlad Dumitrescu
Status changed from Accepted to Test
Status changed from Accepted to Test
I updated the docs at https://github.com/erlide/erlide/wiki/Running-and-debugging-Erlang-code and improved the text on the dialog.