2011-03-16 13:18:12 +00:00
|
|
|
use strict;
|
2021-08-19 20:36:43 +00:00
|
|
|
use warnings;
|
2011-03-16 13:18:12 +00:00
|
|
|
use Setup;
|
2021-02-23 19:28:57 +00:00
|
|
|
use Test2::V0;
|
2011-03-16 13:18:12 +00:00
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
my $ctx = test_context();
|
2011-03-17 08:48:27 +00:00
|
|
|
|
2013-03-20 17:05:21 +00:00
|
|
|
# Test build products
|
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
my $builds = $ctx->makeAndEvaluateJobset(
|
|
|
|
expression => "build-products.nix",
|
|
|
|
build => 1
|
|
|
|
);
|
|
|
|
|
|
|
|
subtest "For the build job 'simple'" => sub {
|
|
|
|
my $build = $builds->{"simple"};
|
2013-03-20 17:05:21 +00:00
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
is($build->finished, 1, "Build should have finished");
|
|
|
|
is($build->buildstatus, 0, "Build should have buildstatus 0");
|
2013-03-20 17:05:21 +00:00
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
my $buildproduct = $build->buildproducts->next;
|
|
|
|
is($buildproduct->name, "text.txt", "We should have \"text.txt\"");
|
|
|
|
};
|
2021-02-23 19:44:23 +00:00
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
subtest "For the build job 'with_spaces'" => sub {
|
|
|
|
my $build = $builds->{"with_spaces"};
|
2021-02-23 19:44:23 +00:00
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
is($build->finished, 1, "Build should have finished");
|
|
|
|
is($build->buildstatus, 0, "Build should have buildstatus 0");
|
2021-02-23 19:44:23 +00:00
|
|
|
|
2021-12-15 01:32:13 +00:00
|
|
|
my $buildproduct = $build->buildproducts->next;
|
|
|
|
is($buildproduct->name, "some text.txt", "We should have: \"some text.txt\"");
|
|
|
|
};
|
2021-02-23 19:44:23 +00:00
|
|
|
|
2021-02-23 19:28:57 +00:00
|
|
|
|
|
|
|
done_testing;
|