Skip to content
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

Merged
merged 2 commits into from
Sep 1, 2017
Merged

[bin] improve busted runner #418

merged 2 commits into from
Sep 1, 2017

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Sep 1, 2017

  • 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:

bin/busted -C examples/cors

or from within different directory:

../../bin/busted

@mikz mikz requested a review from maneta September 1, 2017 10:38
@mikz mikz force-pushed the improve-busted-runner branch from 6275bad to fc647c1 Compare September 1, 2017 10:53
@@ -1,3 +1,18 @@
#!/usr/bin/env sh
#!/usr/bin/env perl
Copy link

@maneta maneta Sep 1, 2017

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx! Push'd.

mikz added 2 commits September 1, 2017 12:56
* 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
```
@mikz mikz force-pushed the improve-busted-runner branch from fc647c1 to 874b168 Compare September 1, 2017 10:57

my $apicast = getcwd();

exec '/usr/bin/env', 'resty',
Copy link

@maneta maneta Sep 1, 2017

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect :)

@mikz mikz merged commit d19992a into master Sep 1, 2017
@mikz mikz deleted the improve-busted-runner branch September 1, 2017 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants