4 * Copyright 2013 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #include <linux/unistd.h>
21 #include <sys/utsname.h>
23 #include "pts_common.h"
24 #include "pts_debug.h"
26 void pts_util_show_error_popup(Evas_Object *parent, const char *msg)
28 PTS_RET_IF(parent == NULL, "parent is NULL");
29 PTS_RET_IF(msg == NULL, "msg is NULL");
31 Evas_Object *error_popup = elm_popup_add(parent);
32 PTS_RET_IF(error_popup == NULL, "error_popup is NULL");
33 evas_object_size_hint_weight_set(error_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
34 elm_object_text_set(error_popup, msg);
35 evas_object_show(error_popup);
36 evas_object_show(parent);
40 Eina_Bool pts_util_supported_arch(void)
43 int ret = uname(&buf);
45 PTS_DEBUG("Failed to get uname");
46 } else if (strstr(buf.machine,"arm") == NULL) {
47 PTS_DEBUG("No supported : %s", buf.machine);
50 PTS_DEBUG("Supported : %s", buf.machine);
55 void pts_util_remove_tmp_files(const char *path)
58 PTS_RET_IF(path == NULL, "path is NULL");
65 cwd = get_current_dir_name();
66 PTS_RET_IF(cwd == NULL, "cwd is NULL");
77 while ((entry = readdir(dir)) != NULL) {
78 PTS_DEBUG("Remove %s", entry->d_name);
79 iret = remove(entry->d_name);
81 PTS_DEBUG("unable to remove %s",entry->d_name);
88 PTS_DEBUG("unable to chdir");
95 if (errno == ENOENT) {
96 PTS_DEBUG("Not existed %s, just skip", path);