Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 0a98f9a

Browse files
committed
Merge pull request #141 from krocard/functional-test-rebirth
Functional test rebirth Start from scratch a new functional test suite. This new test framework: - wrap all PF calls that can fail in order to throw exception (automatic failure detection) - wrap the PF for a more user friendly api (less boilerplate) - permit to generate temporary custom xml config file. Current implemented functional tests (see test plan for details): - Default logger - No logger - Logger should receive info and warnings - Unset logger - Wrong plugin - Settings OK - Wrong settings - Wrong settings but ignore - invalid top level config file - invalid structure - invalid settings
2 parents 7271b40 + b501fea commit 0a98f9a

File tree

90 files changed

+1302
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1302
-42
lines changed

bindings/python/pfw.i

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ public:
9595
bool getFailureOnMissingSubsystem() const;
9696

9797
void setFailureOnFailedSettingsLoad(bool bFail);
98-
bool getFailureOnFailedSettingsLoad();
98+
bool getFailureOnFailedSettingsLoad() const;
9999

100100
void setSchemaFolderLocation(const std::string& strSchemaFolderLocation);
101+
const std::string& getSchemaFolderLocation() const;
102+
101103
void setValidateSchemasOnStart(bool bValidate);
102104
bool getValidateSchemasOnStart() const;
103105

ctest/CTestCustom.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ SET(CTEST_CUSTOM_MEMCHECK_IGNORE
33
# Python generates too many valgrind errors,
44
# runing python based tests would be long and useless.
55
fix_point_parameter
6-
functional-test
6+
functional-test-legacy
77
)

parameter/ParameterMgr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ bool CParameterMgr::loadSettings(string& strError)
620620
if (!success && !_bFailOnFailedSettingsLoad) {
621621
// Load can not fail, ie continue but log the load errors
622622
log_info("%s", strLoadError.c_str());
623-
log_info("Failed to load settings, continue without domains.");
623+
log_warning("Failed to load settings, continue without domains.");
624624
success = true;
625625
}
626626

@@ -855,7 +855,7 @@ void CParameterMgr::setFailureOnFailedSettingsLoad(bool bFail)
855855
_bFailOnFailedSettingsLoad = bFail;
856856
}
857857

858-
bool CParameterMgr::getFailureOnFailedSettingsLoad()
858+
bool CParameterMgr::getFailureOnFailedSettingsLoad() const
859859
{
860860
return _bFailOnFailedSettingsLoad;
861861
}

parameter/ParameterMgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class CParameterMgr : private CElement
177177
*
178178
* @return failure on failed settings load policy state.
179179
*/
180-
bool getFailureOnFailedSettingsLoad();
180+
bool getFailureOnFailedSettingsLoad() const;
181181

182182
/** Get the path to the directory containing the XML Schemas
183183
*

parameter/ParameterMgrFullConnector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void CParameterMgrFullConnector::setFailureOnFailedSettingsLoad(bool bFail)
125125
_pParameterMgr->setFailureOnFailedSettingsLoad(bFail);
126126
}
127127

128-
bool CParameterMgrFullConnector::getFailureOnFailedSettingsLoad()
128+
bool CParameterMgrFullConnector::getFailureOnFailedSettingsLoad() const
129129
{
130130
return _pParameterMgr->getFailureOnFailedSettingsLoad();
131131
}

parameter/ParameterMgrPlatformConnector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ bool CParameterMgrPlatformConnector::setFailureOnMissingSubsystem(bool bFail, st
115115
return true;
116116
}
117117

118-
bool CParameterMgrPlatformConnector::getFailureOnMissingSubsystem()
118+
bool CParameterMgrPlatformConnector::getFailureOnMissingSubsystem() const
119119
{
120120
return _pParameterMgr->getFailureOnMissingSubsystem();
121121
}
@@ -133,7 +133,7 @@ bool CParameterMgrPlatformConnector::setFailureOnFailedSettingsLoad(
133133
return true;
134134
}
135135

136-
bool CParameterMgrPlatformConnector::getFailureOnFailedSettingsLoad()
136+
bool CParameterMgrPlatformConnector::getFailureOnFailedSettingsLoad() const
137137
{
138138
return _pParameterMgr->getFailureOnFailedSettingsLoad();
139139
}
@@ -161,7 +161,7 @@ bool CParameterMgrPlatformConnector::setValidateSchemasOnStart(
161161
return true;
162162
}
163163

164-
bool CParameterMgrPlatformConnector::getValidateSchemasOnStart()
164+
bool CParameterMgrPlatformConnector::getValidateSchemasOnStart() const
165165
{
166166
return _pParameterMgr->getValidateSchemasOnStart();
167167
}

parameter/SystemClass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ bool CSystemClass::loadPlugins(list<string>& lstrPluginFiles, list<string>& lstr
255255

256256
lstrError.push_back("Subsystem plugin " + strPluginFileName +
257257
" does not contain " + strPluginSymbol + " symbol.");
258+
// Next plugin
259+
++it;
258260

259261
continue;
260262
}

parameter/include/ParameterMgrFullConnector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class CParameterMgrFullConnector
109109
*
110110
* @return failure on failed settings load policy state.
111111
*/
112-
bool getFailureOnFailedSettingsLoad();
112+
bool getFailureOnFailedSettingsLoad() const;
113113

114114
/** Get the path to the directory containing the XML Schemas
115115
*

parameter/include/ParameterMgrPlatformConnector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class CParameterMgrPlatformConnector
108108
*
109109
* @return if the subsystem load will fail on missing subsystem.
110110
*/
111-
bool getFailureOnMissingSubsystem();
111+
bool getFailureOnMissingSubsystem() const;
112112

113113
/** Should start fail in failed settings load.
114114
*
@@ -125,7 +125,7 @@ class CParameterMgrPlatformConnector
125125
*
126126
* @return failure on failed settings load policy state.
127127
*/
128-
bool getFailureOnFailedSettingsLoad();
128+
bool getFailureOnFailedSettingsLoad() const;
129129

130130
/** Get the path to the directory containing the XML Schemas
131131
*
@@ -154,7 +154,7 @@ class CParameterMgrPlatformConnector
154154
*
155155
* @return areSchemasValidated
156156
*/
157-
bool getValidateSchemasOnStart();
157+
bool getValidateSchemasOnStart() const;
158158

159159
private:
160160
CParameterMgrPlatformConnector(const CParameterMgrPlatformConnector&);

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
add_subdirectory(test-platform)
3030
add_subdirectory(test-fixed-point-parameter)
3131
add_subdirectory(tokenizer)
32+
add_subdirectory(functional-tests-legacy)
3233
add_subdirectory(functional-tests)
3334
add_subdirectory(test-subsystem)

0 commit comments

Comments
 (0)