summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-08-23Use separate test folder to hold test filesRomain Forlot13-18/+198
Also separate helloWorld example binding test from self aft tests Change-Id: I5b7c48b38cc6629c3edc97d280d7f9228451b337 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-23Update the self-testsRomain Forlot2-10/+6
- Fix: expected data table structure in callbackEvent - Testing event received with a timeout is meaningless since the event are pushed on afb-test request. So They are already received at the assertion moment. - Wrong test waiting for a verb error. Change-Id: I1cec211f7fe4c37d4c238439e8a9a633121a6cf0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-22CleaningRomain Forlot1-35/+0
Cleaning, there is no point to test if we do not receive events Change-Id: I28bc46d7b933c851f716466ad0d97b56cca3d95b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-22Default output format to TAPRomain Forlot1-1/+1
As it is the most common used in AGL environment. Ptest is almost the same and only need a little sed script to be compatible and Jenkins have a TAP plugin that also handle TAP test results. Change-Id: I9f367a01417121aad35753536adece27b3ca0f7d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-22Redirect LUA stdout to a fileRomain Forlot1-0/+1
This is made to have all tests results in 1 place else they will lie in the binder log journal. Change-Id: I60293230bbd8252d1ed947bba7c9583f5957e01e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-22Make the binding root directory availableRomain Forlot1-3/+4
This lets the test lua scripts use this variable to be able to retrieve fixtures files which lie in the 'var' directory Change-Id: Iad321706bd05dfb8e5f0423a15d710fdc540c154 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-22Enhance afm-test scriptRomain Forlot1-6/+18
- Create a cleanup function to be called in case of error - Assume the app home directory to be able to retrieve the test results log file. - Use a sed script to make the output of test results compliant with ptest. Change-Id: I6e3f0ca59a1ca8fc7537955c440a4c55196b9ec6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-21Migration to binding version 3Romain Forlot5-18/+18
For compatibility between different binding versions Submodule app-controller-submodule e3f2c45...4386ec5: > Migration to v3 > Adds v3 function to get binding settings > New function returning the binding root directory > Change the default GLOB pattern > Fix wrong computed length > Add path to the installed widget path. > Controller: Converted README to a gitbook version. Submodule conf.d/app-templates 9c1a0fb..f0b24b0: > Rollback about TEST build type > Adding a TEST build type > Change default compilation options. > Test widget only if there are test materials > Handles more test LABELS. > Missing flag for COVERAGE build type > Create a test widget Change-Id: I4f96cc6773ec4da7eba96f243d6bf06170ef0cb0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-21Wrong file name searched specifiedRomain Forlot1-1/+1
Wrong file name searched specified in the log message. Change-Id: I39d70797191de4cee966dee2793e866b7ab3cbf4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-21Fix: segfault using several test filesRomain Forlot1-3/+5
Fix: getrootdir function usage that needs the context to be passed. This closes file handle before going to the next one. This was causing a segfault on the second file reading. Change-Id: I1d7459e29f9b8725dcbce1a277a10d3adcd4c856 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-21Adds afm-test script in the build directoryRomain Forlot1-0/+26
Then it is possible to use Yocto to retrieve it and include it in the rpm that will be installed in the target. Change-Id: I2038ca67ea62865351436daf48193d1b972d65e2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-16Search in the binding root dir for lua materialsflounder_5.99.3flounder/5.99.35.99.3Romain Forlot2-2/+7
Change-Id: I09f174c99488ff104aaa7995e1575a5e5aa3a0c0 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-16Add path to the installed widget path.Romain Forlot2-5/+21
This resolv the link to the binding aftest library then set the dir path to the widget installation location. Depends-On: I5db247fd9925065684e036d8d458c2131006f9db Change-Id: I4c49b930181a813d0ef3c2d873455a4ac7721206 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-16Use new AppFw feature to find a libraryRomain Forlot1-2/+6
Use new AppFw feature to find a library location. This will help to find the library that hold a binding which could create several different APIs. Depends-On: I70aad7d523ece7a2ae0058b79708a02ef81144e2 Change-Id: I1454eb8ea661d4d3854b344cb989fc05e2704a77 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-16Fix wrong language and auto-versionningRomain Forlot1-2/+2
Version is handled by the app-templates if PROJECT_VERSION is not set. Adjusts pattern to match lua files location Change-Id: I40052e86d5f55ef2c43f9f1266e1ac3fe14db0c8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-16Added afm-test scriptRomain Forlot2-0/+65
This script will be in charge of launching the test binding app. Change-Id: I34d74d173f9f00d916a61b912b0e285b350ead99 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-08Tested and added doc on updated assertEvtGrpReceived functionsCorentinLGS4-21/+18
- Tested changed assertEvtGrpReceived functions - Updated doc about it Change-Id: I91725152e54ebba9d65e501da54a72801699c760 Signed-off-by: Corentin Le Gall <corentinlgs@gmail.com>
2018-08-02Adds a new directory to search for pluginsRomain Forlot1-2/+2
This adding is to find LUA plugins that aren't located to the same directory than C plugins. It uses 2 variables INSTALL_PREFIX and CMAKE_INSTALL_PREFIX because of CMake's files inclusion order in the current app-templates. This will be needed until app-templates migrate as a CMake module. Change-Id: I06bffbc60f132c08eca0cf0793d7c3f25f0524ad Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Bump submodulesRomain Forlot3-0/+0
Submodule afb-helpers 764c355..f0ce5b6: > wrap-json: Fix duplicated lines in header file Submodule app-controller-submodule b79a761..4e30eb1: > New defaults useful functions on lua table > More precise log message when loading a Lua file > Fix: wrong legacy function signature Submodule conf.d/app-templates f94e45e..9c1a0fb: > Fix: interpreted '&' character > More accurate comment about widget template file. Change-Id: I5d18b1005e797f2297c6766266abcbdbc65816e4 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Fix: wrong terminating character handlingRomain Forlot1-3/+3
snprintf include the terminating character when it writes to the buffer. Change-Id: Idca1050deb9af64de1fdd4f08744166b2fa144b1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Move useful functions to lua_utils.cRomain Forlot1-8/+0
This make table_size function accessible by default in all lua scripts. Depends-On: Ia549315e305dd7d02b975a3e8a1278c4ab709eec Change-Id: I312c79581ab3eaef72c1b5725982a70515c62a2a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Asserting the reception of event group:Romain Forlot2-44/+57
Change the way to assert the reception of a group of event. To be able to know the attended event count it is better to define it directly when you pass the table of event group. The event name as the key and the number of event that you are waiting for. Also returning the total of received events instead of 1 then it could be asserted to the expected total count. Fix: segfault when manipulating data history values: There was a segfault and random unexpected behavior when attempting to access old event's data. Only the last one was available and trying to access older values lead to memory access violation as the JSON representing the old data has been released since. So it completely mess up the memory and causes unexpected situations. This is simply fix by deep copying the data into another memory space which could be safely accessed afterwards. Changes the way to receive events from monitor api: The old method isn't accurate because it tolds monitor to trace all api request and all push_after event from that api. But we only want event from the api not the others messages coming from the binder which aren't event. Change-Id: Id5aa4a0c79d2adba050ef03d58c45a3db72ec2a2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Only process event coming from monitor apiRomain Forlot1-2/+2
Processing both event coming from the wanted api and from monitor (which gave the same event but with more informations) leads to unexpected behavior since you can't know which event's data has been registered so data structure changes and can't be asserted. Change-Id: Ifb32c9fdb3b6cc061d0fe5e8d1e5481d51e8d886 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Some fixesRomain Forlot3-46/+44
Fix: No events defined in the mock apis Fix: new_api function has changed in binder Using the dynapi new_api function returned 0 in case of success and -1 on failure. New function since v3 returned NULL in case of failure or the api struct in case of success. Fix: wrong install_prefix variable used in CMake config file Fix: wrong variable used Typo after a copy/paste from event group handling. - Wrong use of table.insert - Wrong variable name used - only pass the data table, which is embed in another data table... - Fix aftereach and beforeeach function's call Change-Id: I9523ae50c170a3cdb9e5c3bc2b9e923c30f6ba39 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Add the binding root dir to the config search pathRomain Forlot1-5/+10
Change-Id: Ia067ce46f13bc49b6050522d0484f92627968ff1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-08-02Changed the way to load new test apisRomain Forlot1-22/+48
Now you could load supplementary tests api by providing either a path to a JSON configuration file or directly a JSON object representing a test configuration. Change-Id: I3145c28aaea482b934e9f9fed6f2969e32da5901 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-28Bump helpers submodulesRomain Forlot1-0/+0
Submodule afb-helpers 4f99d16..764c355: > Add '@' as binder middle name separator. > Enhance 'wrap_json_clone_depth' description > Fix: use of GetBindingDirPath without dynapi Change-Id: I4e9ac6a461e3f938b7e7b2d348bec63dbaba763a Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-26Added callVerb function8000ff1-0/+4
Very helpful for setup and/or teardown of a test scenario Change-Id: I068e779a6812bb89bc65646eda2c0271387513d0 Signed-off-by: 8000ff <clementmallejac@gmail.com>
2018-07-26Fixed bugs on EvtGrpReceived functionsCorentin Le Gall2-8/+26
-Changed event.name to eventName and added a condition in _AFT.triggerEvtCallback. -Added tests functions to assertEvtGrpReceived functions. -Corrected a mistake in _AFT.assertEvtGrpNotReceived. Change-Id: Ic0f72ac9789f5056dd628d950fa53f54b3a82112 Signed-off-by: Corentin Le Gall <corentinlgs@gmail.com>
2018-07-26DynAPI > V3 migration of afb-test binding.Romain Forlot3-16/+16
Controller is still using dynapi and preV3 version. This is a preparation for future controller update to V3 Submodule app-controller-submodule 88892db..b79a761: > Split loading JSON controller file. > Release arguments once C function returned. > Fix : typo introduced in a previous commit. > Fixed character counting that was shortening paths > Keep json unmodified during action execution Change-Id: Iba37b3fbd35e58973b9601a7f91bfdb61abcf76f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-26Update app-templates submodulesRomain Forlot1-5/+0
Submodule conf.d/app-templates 6fb3846..9202fac: > More accurate comment about widget template file. > Align sample on actual default compile options > Add support to binding version 3. Change-Id: I91fc3370959a33372850fa4d0455c6a8a72cbf66 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-26Create new test api from a json filepathRomain Forlot1-32/+46
Implement a new verb that start a new controller from a JSON filepath provided as argument. Change-Id: I498a0f24627357d93ac795cb034dc93dd0e84e62 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-26Provide entire history if the option is enabledRomain Forlot1-16/+15
Then it is possible to compare an event data with past event data. Also rationalize the code to invoke the event's callback Change-Id: I4309e0643d4c21c44d8fef510507e28745a9f83d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-24Changed doc to GitBook format + added docCorentin Le Gall37-1185/+1941
-Changed README.md to a complet GitBook doc. -Added explanations about EvtGrpReceived functions. -Corrected mistakes + reduced lines length. Change-Id: I1a077ddf6acb520a9158de658d3c09b12a2029d4 Signed-off-by: Corentin Le Gall <corentinlgs@gmail.com>
2018-07-23Add simple tests about waiting a group of events.flounder_5.99.2flounder/5.99.25.99.2Romain Forlot4-25/+26
Change-Id: I409f8a07806f613e74cf86d6d001f7762eab7f96 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-23Change the project name to aftestRomain Forlot2-1/+1
This change is made because of the config file search mechanism which is based on the middle binder name. Until a better solution is found with the prefix these are the only informations available to let you choose the correct config files. Change-Id: I416c6b8c71965bb6f38ef56ed78fc9e37b593c80 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-21Fix: events callback aren't correctly registeredRomain Forlot3-58/+165
They were stored in the mapis sections instead of the events one. Clean and handle raw events as well. Before that it could only process events coming from monitoring api. Now it could receive the event directly. Make sure that the event handle is valid before sends the request response. This prevent to subcribe or push an event while the event handle hasn't been correctly created. This could happens if the testVerb hasn't not been called from a session. In that case, the response will just be that tests has been launched. Format. Change-Id: I0aa522939162684f91dd426cc14919bb0ec3f69e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-19Change the default xUnit result log file pathRomain Forlot1-1/+1
Typo. Change-Id: I3bb3639dfbeae1ffbf1f4912e8b30e9c8bc1cc49 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-19Search the conf file using env and static variablesRomain Forlot4-6/+17
This helps finding configuration in several locations by concatenating environment variables and hardcoded variables. Then it is possible for the apps to retrieve its files or values in any environment (native, board, sdk) more easily. Depends-On: I0ad19242612559d1f4b66b6f9af9e7032d4675a8 Depends-On: Ic448ff017e6158bec05895d63688b8968b5c6434 Change-Id: I26a725c368e8354cfc2531d58de6dc362f7d0618 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-17Change lua print function to write in a fileRomain Forlot1-8/+9
This lets you retrieve print messages done by the test binding in a file log in addition of binder runtime log messages. By default, the standard output is redirected to a file in the workdir of the binder. This is convenient when you have a heavy loaded binder output. It's more difficult to extract the test results. Change-Id: Ifae540652ae431d4d9703a19673e5bc69c2b315f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-17Fix: wrong values in config.xml template fileRomain Forlot3-7/+4
Also set the same APIs name for all configurations Change-Id: If565418b552adaeaa767e9c37dd8a65d212ab093 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-17README + helloworld: New test functions + docCorentin Le Gall6-255/+794
Fixed, tested and documented setBefore and setAfter functions. Improved doc for updated functions in aft.lua. Change-Id: Idc7ffc06e98ef7f6af1e06d9e6cda0dcbd4f97b8 Signed-off-by: Corentin Le Gall <corentinlgs@gmail.com>
2018-07-11add gitreview fileRomain Forlot1-0/+6
Change-Id: Ia134389296a5443798dc03f3f9f2a44d2112f6cc Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-10Bump submodulesRomain Forlot2-0/+0
Submodule app-controller-submodule 5137a2c...440be09: < Use binding version to set controller definitions > Use binding version to set controller definitions Submodule afb-helpers ee8dd11...52f0478: > Remove unnecessary 'AFB_DEBUG' redefinition < Use binding version to handle dynapi > Use binding version to handle dynapi Change-Id: Ibd6a2cbed994c9f3f80239e7cb88a55150a25499 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-10Add Licence fileRomain Forlot1-0/+202
Change-Id: I7deabf299df31b295eb37beffa7a8dbeaa44e71f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-10lockwait: loop and ev catcher also received eventClément Bénier1-0/+1
warning: it may be possible to do better than that but the ev catcher is called at the next loop Change-Id: I2d69322f4079ccda0c85968861b8a9d0c4457855 Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-07-10lockwait: add lua lockwait functionClément Bénier1-12/+21
this function handles to wait for one specific afb event Change-Id: Ief730b6b5f2109379ca0191d98b013d1c9e4225e Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
2018-07-10Handle Mock API's eventsRomain Forlot1-3/+38
Add each Mock API event's action to the Mock API controller section. Change-Id: I072b7f2c610cf28760880e02629cafd38dafeb6b Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-10APIv3 + DynAPI compatibilityRomain Forlot1-1/+1
Change-Id: Ice73800c3ee110c641b9a0147bef238c537ef43f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
2018-07-10Bump Submodules:Romain Forlot4-2/+2
Update config.cmake to follow app-templates update. Submodule afb-helpers 5811a53..ee8dd11: > Use binding version to handle dynapi Submodule app-controller-submodule e45d063..5137a2c: > Use binding version to set controller definitions > ctl-lua: typo fix > asynchronism for test: LockWait added > Fix: plugin api assignement order Submodule conf.d/app-templates eec9f07..332f377: > Be able to overwrite BUILD_TYPE using CLI > Use CACHE variable for other common CMAKE variable > Fix:: wrong wgt using RELEASE BUILD TYPE Change-Id: I098393e537e7bd635ddbbe300c023e239ad25cd2 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>