Skip to content

Commit 45f1eb6

Browse files
committed
Skip long running examples when running tests
1 parent 6ffeb8a commit 45f1eb6

File tree

1 file changed

+84
-56
lines changed

1 file changed

+84
-56
lines changed

t/categories/euler.t

Lines changed: 84 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use Test;
44

55
plan 58;
66

7+
my $skip = True;
8+
79
subtest {
810
plan 5;
911

@@ -69,15 +71,18 @@ subtest {
6971
check-example-solutions($problem, $expected-output, @authors)
7072
}, "prob006";
7173

72-
subtest {
73-
plan 1;
74+
skip("prob007 takes too long in tests");
75+
unless $skip {
76+
subtest {
77+
plan 1;
7478

75-
my $problem = "prob007";
76-
my @authors = <polettix>;
77-
my $expected-output = 104743;
79+
my $problem = "prob007";
80+
my @authors = <polettix>;
81+
my $expected-output = 104743;
7882

79-
check-example-solutions($problem, $expected-output, @authors)
80-
}, "prob007";
83+
check-example-solutions($problem, $expected-output, @authors)
84+
}, "prob007";
85+
}
8186

8287
subtest {
8388
plan 2;
@@ -218,15 +223,18 @@ subtest {
218223
check-example-solutions($problem, $expected-output, @authors)
219224
}, "prob020";
220225

221-
subtest {
222-
plan 1;
226+
skip("prob021 takes too long to run in tests");
227+
unless $skip {
228+
subtest {
229+
plan 1;
223230

224-
my $problem = "prob021";
225-
my @authors = <gerdr>;
226-
my $expected-output = 852810;
231+
my $problem = "prob021";
232+
my @authors = <gerdr>;
233+
my $expected-output = 852810;
227234

228-
check-example-solutions($problem, $expected-output, @authors)
229-
}, "prob021";
235+
check-example-solutions($problem, $expected-output, @authors)
236+
}, "prob021";
237+
}
230238

231239
subtest {
232240
plan 1;
@@ -238,15 +246,18 @@ subtest {
238246
check-example-solutions($problem, $expected-output, @authors)
239247
}, "prob022";
240248

241-
subtest {
242-
plan 1;
249+
skip("prob023 takes too long in tests");
250+
unless $skip {
251+
subtest {
252+
plan 1;
243253

244-
my $problem = "prob023";
245-
my @authors = <shlomif>;
246-
my $expected-output = 4179871;
254+
my $problem = "prob023";
255+
my @authors = <shlomif>;
256+
my $expected-output = 4179871;
247257

248-
check-example-solutions($problem, $expected-output, @authors)
249-
}, "prob023";
258+
check-example-solutions($problem, $expected-output, @authors)
259+
}, "prob023";
260+
}
250261

251262
subtest {
252263
plan 1;
@@ -387,15 +398,18 @@ subtest {
387398
check-example-solutions($problem, $expected-output, @authors)
388399
}, "prob047";
389400

390-
subtest {
391-
plan 1;
401+
skip("prob052 takes too long in tests");
402+
unless $skip {
403+
subtest {
404+
plan 1;
392405

393-
my $problem = "prob052";
394-
my @authors = <duff>;
395-
my $expected-output = 142857;
406+
my $problem = "prob052";
407+
my @authors = <duff>;
408+
my $expected-output = 142857;
396409

397-
check-example-solutions($problem, $expected-output, @authors)
398-
}, "prob052";
410+
check-example-solutions($problem, $expected-output, @authors)
411+
}, "prob052";
412+
}
399413

400414
subtest {
401415
plan 2;
@@ -407,15 +421,18 @@ subtest {
407421
check-example-solutions($problem, $expected-output, @authors)
408422
}, "prob053";
409423

410-
subtest {
411-
plan 1;
424+
skip("prob054 takes too long in tests");
425+
unless $skip {
426+
subtest {
427+
plan 1;
412428

413-
my $problem = "prob054";
414-
my @authors = <andreoss>;
415-
my $expected-output = 376;
429+
my $problem = "prob054";
430+
my @authors = <andreoss>;
431+
my $expected-output = 376;
416432

417-
check-example-solutions($problem, $expected-output, @authors);
418-
}, "prob054";
433+
check-example-solutions($problem, $expected-output, @authors);
434+
}, "prob054";
435+
}
419436

420437
subtest {
421438
plan 1;
@@ -445,15 +462,20 @@ subtest {
445462

446463
check-example-solutions($problem, $expected-output, @authors)
447464
}, "prob065";
448-
subtest {
449-
plan 1;
450465

451-
my $problem = "prob066";
452-
my @authors = <andreoss>;
453-
my $expected-output = 661;
466+
skip("prob066 takes too long in tests");
467+
unless $skip {
468+
subtest {
469+
plan 1;
470+
471+
my $problem = "prob066";
472+
my @authors = <andreoss>;
473+
my $expected-output = 661;
474+
475+
check-example-solutions($problem, $expected-output, @authors)
476+
}, "prob066";
477+
}
454478

455-
check-example-solutions($problem, $expected-output, @authors)
456-
}, "prob066";
457479
subtest {
458480
plan 1;
459481

@@ -554,15 +576,18 @@ if False {
554576
}, "prob104";
555577
}
556578

557-
subtest {
558-
plan 1;
579+
skip("prob105 takes too long in tests");
580+
unless $skip {
581+
subtest {
582+
plan 1;
559583

560-
my $problem = "prob105";
561-
my @authors = <shlomif>;
562-
my $expected-output = 73702;
584+
my $problem = "prob105";
585+
my @authors = <shlomif>;
586+
my $expected-output = 73702;
563587

564-
check-example-solutions($problem, $expected-output, @authors)
565-
}, "prob105";
588+
check-example-solutions($problem, $expected-output, @authors)
589+
}, "prob105";
590+
}
566591

567592
skip("prob149-shlomif.pl takes too long to run");
568593
if False {
@@ -577,15 +602,18 @@ if False {
577602
}, "prob149";
578603
}
579604

580-
subtest {
581-
plan 1;
605+
skip("prob151 takes too long in tests");
606+
unless $skip {
607+
subtest {
608+
plan 1;
582609

583-
my $problem = "prob151";
584-
my @authors = <shlomif>;
585-
my $expected-output = 0.464399;
610+
my $problem = "prob151";
611+
my @authors = <shlomif>;
612+
my $expected-output = 0.464399;
586613

587-
check-example-solutions($problem, $expected-output, @authors)
588-
}, "prob151";
614+
check-example-solutions($problem, $expected-output, @authors)
615+
}, "prob151";
616+
}
589617

590618
subtest {
591619
plan 1;

0 commit comments

Comments
 (0)