diff options
author | Adrien M <adrienx.martin@intel.com> | 2015-03-10 15:21:30 +0100 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-04-24 13:39:12 -0700 |
commit | ec5130b950992fe79400ba66336d19169772a530 (patch) | |
tree | 0ddf66f1d680bf4be582b949d2596b7f08c8b74a /test/functional-tests/ACTCampaignEngine.py | |
parent | 5aaddd16f2aabccf07687f1761567eb6455abe61 (diff) | |
download | external_parameter-framework-ec5130b950992fe79400ba66336d19169772a530.zip external_parameter-framework-ec5130b950992fe79400ba66336d19169772a530.tar.gz external_parameter-framework-ec5130b950992fe79400ba66336d19169772a530.tar.bz2 |
Add functionnal tests to the pfw.
This patch adds functionnal test to the PFW.
The execution of these tests needs the test-subsystem to be compiled.
The tests can be launch with 'make test'.
We set the environment vars in the cmake.
Then we launch ACTCampaignEngine.py.
Temporary files like build time conf files are placed on the build directory.
Next steps :
- Test-subsystem needs to be reworked (with binding python).
Signed-off-by: Adrien M <adrienx.martin@intel.com>
Diffstat (limited to 'test/functional-tests/ACTCampaignEngine.py')
-rwxr-xr-x | test/functional-tests/ACTCampaignEngine.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/test/functional-tests/ACTCampaignEngine.py b/test/functional-tests/ACTCampaignEngine.py index 6d39436..d4aeaf9 100755 --- a/test/functional-tests/ACTCampaignEngine.py +++ b/test/functional-tests/ACTCampaignEngine.py @@ -40,7 +40,9 @@ These commands are tested using the methods of the classes """ import sys +import os import unittest +import shutil from Util import PfwUnitTestLib class Logger(object): @@ -61,7 +63,32 @@ def testsRunner(testDirectory): return runner.run(tests).wasSuccessful() def main(): - sys.exit(not testsRunner('PfwTestCase')) + + pfw_root = os.environ["PFW_ROOT"] + pfw_result = os.environ["PFW_RESULT"] + xml_path = "xml/configuration/ParameterFrameworkConfiguration.xml" + + os.environ["PFW_TEST_TOOLS"] = os.path.dirname(os.path.abspath(__file__)) + os.environ["PFW_TEST_CONFIGURATION"] = os.path.join(pfw_root, xml_path) + + try: + # This directory must not exist. An exception will be raised if it does. + os.makedirs(pfw_result) + + isAlive = os.path.join(pfw_result,"isAlive") + with open(isAlive, 'w') as fout: + fout.write('true') + + needResync = os.path.join(pfw_result,"needResync") + with open(needResync, 'w') as fout: + fout.write('false') + + success = testsRunner('PfwTestCase') + + finally: + shutil.rmtree(pfw_result) + + sys.exit(0 if success else 1) if __name__ == "__main__": main() |