Commit 1ac74a8e authored by Michael Pyne's avatar Michael Pyne
Browse files

Run test suite from temporary test directory.

A couple of git tests were passing when the test suite was run from a
git checkout and failing when not. This was due to an underlying
errorneous assumption.

This commit fixes that assumption by making a new
git checkout, and also changes to the temporary directory setup for the
test at the start to hopefully prevent other tests from passing when
they shouldn't.

(cherry picked from commit 5a01d0d1)
parent 3c318f92
......@@ -98,13 +98,23 @@ $ctx->setOption('#unused', '1');
$ctx->setOption('branch', '4.3');
# Commence testing proper
p_chdir ($testSourceDirName);
SKIP: {
skip 'git not installed', 1 unless defined absPathToExecutable('git');
if (!is(system('git', 'init', 'test-git-dir'), 0, 'Create new git directory')) {
skip 'git does not work', 1;
}
p_chdir('test-git-dir');
my @gitStatusOutput = filter_program_output(sub { /On branch/ }, qw/git status/);
is(@gitStatusOutput, 1, 'Correct number of items from filter_program_output');
is(`git status`, join('', filter_program_output(undef, qw/git status/)), 'Ensure filter_program_output works w/ no filter');
is($ctx->getSourceDir(), $ENV{HOME} . "/kdesrc-build-unused", 'Correct tilde-expansion for source-dir');
p_chdir($testSourceDirName);
}
# We know tilde-expansion works for source-dir, reset to our temp dir.
......
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