mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 16:38:21 -04:00
[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
1 changed files with 25 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue