[shellprocess] Fix test

The test was loading the config file (for testing) either from the
build directory or possibly the source directory; if the config
in the build-dir was edited (for other testing purposes) then
the test would fail. Load only the source-dir version of the file.
main
Adriaan de Groot 3 years ago
parent 563c149217
commit b237c73a04

@ -42,16 +42,11 @@ ShellProcessTests::testProcessListSampleConfig()
{
YAML::Node doc;
QStringList dirs { "src/modules/shellprocess", "." };
for ( const auto& dir : dirs )
{
QString filename = dir + "/shellprocess.conf";
if ( QFileInfo::exists( filename ) )
{
doc = YAML::LoadFile( filename.toStdString() );
break;
}
}
QString filename = QStringLiteral( "shellprocess.conf" );
QFile fi( QString( "%1/%2" ).arg( BUILD_AS_TEST, filename ) );
QVERIFY( fi.exists() );
doc = YAML::LoadFile( fi.fileName().toStdString() );
CommandList cl( CalamaresUtils::yamlMapToVariant( doc ).value( "script" ) );
QVERIFY( !cl.isEmpty() );

Loading…
Cancel
Save