Commit a84bfd53 authored by Johan Ouwerkerk's avatar Johan Ouwerkerk

Move smoke tests to a separate t/smoke directory and fixup assumptions/mocking...

Move smoke tests to a separate t/smoke directory and fixup assumptions/mocking in tests which have become out of date with the new dependency resolver
parent 8bbd8954
......@@ -16,13 +16,40 @@ use ksb::Module;
package ksb::Application {
no warnings 'redefine';
sub _resolveModuleDependencies {
my ($self, @modules) = @_;
# simulate effect of --include-dependencies, using ksb::Application's
# built-in module-name to ksb::Module resolver.
sub _resolveModuleDependencyGraph {
my $self = shift;
my @modules = @_;
my $newModule = $self->{module_factory}->('setmod2');
splice @modules, 1, 0, $newModule;
return @modules;
my $graph = {
'setmod1' => {
votes => {
'setmod2' => 1,
'setmod3' => 1
},
build => 1,
module => $modules[0]
},
'setmod2' => {
votes => {
'setmod3' => 1
},
build => 1,
module => $newModule
},
'setmod3' => {
votes => {},
build => 1,
module => $modules[1]
}
};
my $result = {
graph => $graph
};
return $result;
}
};
......
......@@ -44,9 +44,9 @@ my $app = ksb::Application->new(qw(--pretend --rc-file t/data/sample-rc/kdesrc-b
my @moduleList = @{$app->{modules}};
is(scalar @moduleList, 4, 'Right number of modules');
is($moduleList[3]->name(), 'module2', 'Right module name');
is($moduleList[0]->name(), 'module2', 'Right module name');
my $scm = $moduleList[3]->scm();
my $scm = $moduleList[0]->scm();
isa_ok($scm, 'ksb::Updater::Git');
my ($branch, $type) = $scm->_determinePreferredCheckoutSource();
......@@ -54,8 +54,8 @@ my ($branch, $type) = $scm->_determinePreferredCheckoutSource();
is($branch, 'refs/tags/fake-tag5', 'Right tag name');
is($type, 'tag', 'Result came back as a tag');
is($moduleList[1]->name(), 'setmod2', 'Right module name from module-set');
($branch, $type) = $moduleList[1]->scm()->_determinePreferredCheckoutSource();
is($moduleList[2]->name(), 'setmod2', 'Right module name from module-set');
($branch, $type) = $moduleList[2]->scm()->_determinePreferredCheckoutSource();
is($branch, 'refs/tags/tag-setmod2', 'Right tag name (options block)');
is($type, 'tag', 'options block came back as tag');
......@@ -66,10 +66,10 @@ is($type, 'tag', 'options block came back as tag');
#
# Override auto-detection since no source is downloaded
$moduleList[1]->setOption('override-build-system', 'kde');
$moduleList[2]->setOption('override-build-system', 'kde');
# Should do nothing in --pretend
ok($moduleList[1]->setupBuildSystem(), 'setup fake build system');
ok($moduleList[2]->setupBuildSystem(), 'setup fake build system');
ok(@ksb::test::CMD, 'log_command cmake was called');
is($ksb::test::CMD[2], '-DCMAKE_BUILD_TYPE=a b', 'CMake options can be quoted');
......
......@@ -16,18 +16,18 @@ my @moduleList = @{$app->{modules}};
is(scalar @moduleList, 4, 'Right number of modules');
my $scm = $moduleList[3]->scm();
my $scm = $moduleList[0]->scm();
my ($branch, $type) = $scm->_determinePreferredCheckoutSource();
is($branch, 'refs/tags/fake-tag10', 'Right tag name');
is($type, 'tag', 'Result came back as a tag');
($branch, $type) = $moduleList[1]->scm()->_determinePreferredCheckoutSource();
($branch, $type) = $moduleList[2]->scm()->_determinePreferredCheckoutSource();
is($branch, 'refs/tags/tag-setmod10', 'Right tag name (options block from cmdline)');
is($type, 'tag', 'cmdline options block came back as tag');
ok(!$moduleList[1]->isKDEProject(), 'setmod2 is *not* a "KDE" project');
is($moduleList[1]->fullProjectPath(), 'setmod2', 'fullProjectPath on non-KDE modules returns name');
ok(!$moduleList[2]->isKDEProject(), 'setmod2 is *not* a "KDE" project');
is($moduleList[2]->fullProjectPath(), 'setmod2', 'fullProjectPath on non-KDE modules returns name');
done_testing();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment