-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bin] improve busted runner #418
Conversation
6275bad
to
fc647c1
Compare
@@ -1,3 +1,18 @@ | |||
#!/usr/bin/env sh | |||
#!/usr/bin/env perl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is always good to:
use warnings;
use strict;
It protects you of a lot of stuff (https://perlmaven.com/always-use-warnings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx! Push'd.
* it is in Perl instead of Shell * it is aware of current working directory * can run tests in different folders * can load code in different folders example: ```shell bin/busted -C examples/cors ``` or from within different directory: ```shell ../../bin/busted ```
fc647c1
to
874b168
Compare
|
||
my $apicast = getcwd(); | ||
|
||
exec '/usr/bin/env', 'resty', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are sure you want just exec Right?
The big difference is that system() creates a fork process and waits to see if the command succeeds or fails - returning a value. exec() does not return anything, it simply executes the command.
Because maybe you want to eval the command execution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well exec replaces the current process and that is exactly what I want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a wrapper to prepare some flags and execute different command. So to not have to handle error codes, input, output etc it is just nice to exec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect :)
example:
or from within different directory: