Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ligne/sheba
base: 6d68ea41a1
...
head fork: ligne/sheba
compare: bfd3886d07
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 51 additions and 2 deletions.
  1. +51 −2 t/sheba.pl.t
View
53 t/sheba.pl.t
@@ -23,6 +23,37 @@ require 'bin/sheba.pl';
### parrot_configs
+{
+ my $config;
+
+ $config->{parrot_configs} = [
+ [qw( --optimize --without-gmp )],
+ ];
+ $config->{parrot_all_config_opts} = [qw(
+ --optimize
+ --without-threads
+ --without-core-nci-thunks
+ )];
+
+ {
+ my @configs = parrot_configs($config);
+ is_deeply($configs[0], [ qw( --optimize --without-gmp )], 'static config only');
+
+ $config->{parrot_configs} = [
+ [qw( --optimize --without-gmp )],
+ ('random') x 2,
+ ];
+ }
+ {
+ my @configs = parrot_configs($config);
+ is(scalar @configs, 3, 'got 3 configs') or next;
+ is_deeply($configs[0], [ qw( --optimize --without-gmp )], 'static config is first');
+
+ is("@{$configs[1]}", "@{$configs[1]}", 'the random configuration is equal to itself (sanity check)');
+ isnt("@{$configs[1]}", "@{$configs[2]}", 'the random configurations are different');
+ }
+}
+
### random_config_generator
@@ -33,8 +64,8 @@ require 'bin/sheba.pl';
### _flatten
-eq_or_diff([ _flatten(1, 2, 3) ], [ 1, 2, 3]);
-eq_or_diff([ _flatten(1, [ 2, 3]) ], [ 1, 2, 3]);
+eq_or_diff([ _flatten(1, 2, 3) ], [ 1, 2, 3], 'flat list');
+eq_or_diff([ _flatten(1, [ 2, 3]) ], [ 1, 2, 3], 'nested list');
### set_limits
@@ -70,6 +101,24 @@ sub report_limits
eq_or_diff($limits{RLIMIT_CPU}, 600, 'limited the CPU time') or diag($output);
}
+{
+ run sub {
+ set_limits(undef, { as => 10 });
+ report_limits();
+ my $str = 'x' x 1e6; # 1MB should be enough to trigger this
+ exit 0;
+ }, '&>', \(my $output);
+
+ ok($?, 'subprocess was killed due to too much memory usage');
+}
+{
+ run sub {
+ set_limits(undef, { blahblah => 600 });
+ report_limits()
+ }, '&>', \(my $output);
+
+ like($output, qr('blahblah' is not supported), 'error when setting an unknown limit');
+}
### _run_command

No commit comments for this range

Something went wrong with that request. Please try again.