[libcalamares] Expand tests for runCommand
- try both with and without a working-directory set, this would have shown up the problem with bad indentation much earlier.
This commit is contained in:
parent
7be33b8196
commit
4e13f780f1
@ -132,5 +132,29 @@ LibCalamaresTests::testCommands()
|
||||
QVERIFY( tf.open() );
|
||||
QVERIFY( !tf.fileName().isEmpty() );
|
||||
|
||||
QVERIFY( r.getOutput().contains( tf.fileName() ) );
|
||||
QFileInfo tfn( tf.fileName() );
|
||||
QVERIFY( !r.getOutput().contains( tfn.fileName() ) );
|
||||
|
||||
// Run ls again, now that the file exists
|
||||
r = System::runCommand(
|
||||
System::RunLocation::RunInHost,
|
||||
{ "/bin/ls", "/tmp" }
|
||||
);
|
||||
QVERIFY( r.getOutput().contains( tfn.fileName() ) );
|
||||
|
||||
// .. and without a working directory set, assume builddir != /tmp
|
||||
r = System::runCommand(
|
||||
System::RunLocation::RunInHost,
|
||||
{ "/bin/ls" }
|
||||
);
|
||||
QVERIFY( !r.getOutput().contains( tfn.fileName() ) );
|
||||
|
||||
r = System::runCommand(
|
||||
System::RunLocation::RunInHost,
|
||||
{ "/bin/ls" },
|
||||
"/tmp"
|
||||
);
|
||||
QVERIFY( r.getOutput().contains( tfn.fileName() ) );
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user