Skip to content

Commit

Permalink
Add test for repository-specific-variables.
Browse files Browse the repository at this point in the history
[ssu] Add test for repository-specific-variables. JB#46366

Signed-off-by: Marko Saukko <marko.saukko@jolla.com>
  • Loading branch information
saukko committed Jun 20, 2019
1 parent a534fc8 commit 030f880
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ut_deviceinfo/deviceinfotest.cpp
Expand Up @@ -26,6 +26,17 @@ void DeviceInfoTest::testAdaptationVariables()
QCOMPARE(repoName, QString("adaptation"));
}

void DeviceInfoTest::testFeatureVariables()
{
SsuDeviceInfo deviceInfo("N950");
QHash<QString, QString> featureVariables;
QString repoName = deviceInfo.adaptationVariables("feature1", &featureVariables);
QHash<QString, QString> featureVariablesExpected;
featureVariablesExpected["feature"] = "test";
QCOMPARE(featureVariables, featureVariablesExpected);
QCOMPARE(repoName, QString("feature1"));
}

void DeviceInfoTest::testDeviceUid()
{
QVERIFY2(!SsuDeviceInfo().deviceUid().isEmpty(), "No method to get device UID on this platform");
Expand Down
1 change: 1 addition & 0 deletions tests/ut_deviceinfo/deviceinfotest.h
Expand Up @@ -16,6 +16,7 @@ class DeviceInfoTest: public QObject

private slots:
void testAdaptationVariables();
void testFeatureVariables();
void testDeviceUid();
void testVariableSection();
void testValue();
Expand Down
5 changes: 5 additions & 0 deletions tests/ut_deviceinfo/testdata/board-mappings.ini
Expand Up @@ -16,6 +16,7 @@ N950=N9
family=n950-n9
adaptation-repos=n9xx-common,n950-n9
variables = n9
repository-specific-variables=N9-feature1

[var-n9]
foo-n9 = foo-n9-val
Expand Down Expand Up @@ -49,3 +50,7 @@ bar2 = bar2Val

[var-baz]
variables = foo, bar

[var-N9-feature1]
feature=test

0 comments on commit 030f880

Please sign in to comment.