diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-05-17 02:32:11 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-07-10 17:12:13 +0200 |
commit | fd65ad40cb1a1b52b5207d45a58962b5f590046b (patch) | |
tree | e4672ca39036955444b76ca27f1246be0509255f /src/test-binding.c | |
parent | 63df935362a9c25553696d72ce85089f5a1c7ed0 (diff) |
Adding more material to do tests
Make the lua interpreter find the luaunit module.
Find a way to use it from the controller.
Adding canreplayer file and write a script that could
launch in background the canplayer. No process handling
by now which have to done in the next step
Change-Id: I2d35472ba0e2fbb03ead121ff2587d831fe4ff17
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/test-binding.c')
-rw-r--r-- | src/test-binding.c | 66 |
1 files changed, 16 insertions, 50 deletions
diff --git a/src/test-binding.c b/src/test-binding.c index 7b28b01..2f6f915 100644 --- a/src/test-binding.c +++ b/src/test-binding.c @@ -1,19 +1,20 @@ /* - * Copyright (C) 2016 "IoT.bzh" - * Author Fulup Ar Foll <fulup@iot.bzh> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +* Copyright (C) 2016 "IoT.bzh" +* Author Fulup Ar Foll <fulup@iot.bzh> +* Author Romain Forlot <romain@iot.bzh> +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ #define _GNU_SOURCE #include <stdio.h> @@ -31,7 +32,6 @@ static CtlSectionT ctrlSections[] = { {.key = "resources", .loadCB = PluginConfig}, {.key = "onload", .loadCB = OnloadConfig}, {.key = "events", .loadCB = EventConfig}, - {.key = NULL} }; @@ -107,36 +107,6 @@ static int CtrlLoadOneApi(void *cbdata, AFB_ApiT apiHandle) { return err; } -int AddLunitFrameworkResource(AFB_ApiT apihandle, CtlConfigT *ctrlConfig) -{ - int err = 0; - json_object *luaunitFrameworkJ = NULL, *resourcesJ = NULL; - json_object *savedJ = NULL; - - err = wrap_json_pack(&luaunitFrameworkJ, "{ss, ss, ss, ss}", - "uid", "lunit", - "info", "Lunit LUA xUnit framework", - "spath", CONTROL_PLUGIN_PATH, - "libs", "luaunit.lua"); - if(err) { - AFB_ApiError(apihandle, "Loading LUA xUnit framework"); - return ERROR; - } - - if(json_object_object_get_ex(ctrlConfig->configJ, "resources", &resourcesJ) && - json_object_is_type(resourcesJ, json_type_array)) { - savedJ = json_object_get(json_object_array_get_idx(resourcesJ, 0)); - json_object_array_put_idx(resourcesJ, 0, luaunitFrameworkJ); - json_object_array_add(resourcesJ, savedJ); - } - else { - AFB_ApiError(apihandle, "Resources section isn't a JSON array or does not exists."); - return ERROR; - } - - return 0; -} - int afbBindingVdyn(afb_dynapi *apiHandle) { AFB_default = apiHandle; @@ -171,10 +141,6 @@ int afbBindingVdyn(afb_dynapi *apiHandle) { AFB_ApiNotice(apiHandle, "Controller API='%s' info='%s'", ctrlConfig->api, ctrlConfig->info); - - if (AddLunitFrameworkResource(apiHandle, ctrlConfig)) - return ERROR; - // create one API per config file (Pre-V3 return code ToBeChanged) int status = afb_dynapi_new_api(apiHandle, ctrlConfig->api, ctrlConfig->info, 1, CtrlLoadOneApi, ctrlConfig); |