aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/test_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/test_lib.c')
-rw-r--r--src/plugins/test_lib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/test_lib.c b/src/plugins/test_lib.c
index 8bd6d4e..6cd880d 100644
--- a/src/plugins/test_lib.c
+++ b/src/plugins/test_lib.c
@@ -27,6 +27,8 @@
27#include <sys/types.h> 27#include <sys/types.h>
28#include <regex.h> 28#include <regex.h>
29#include <signal.h> 29#include <signal.h>
30#include <stdbool.h>
31#include <unistd.h>
30 32
31/** 33/**
32 * Function that libextractor calls for each 34 * Function that libextractor calls for each
@@ -143,17 +145,31 @@ run (const char *plugin_name,
143 unsigned int i; 145 unsigned int i;
144 unsigned int j; 146 unsigned int j;
145 int ret; 147 int ret;
148 bool skipped = false;
146 149
147 pl = EXTRACTOR_plugin_add_config (NULL, 150 pl = EXTRACTOR_plugin_add_config (NULL,
148 plugin_name, 151 plugin_name,
149 opt); 152 opt);
150 for (i = 0; NULL != ps[i].filename; i++) 153 for (i = 0; NULL != ps[i].filename; i++)
154 {
155 if (0 != access (ps[i].filename,
156 R_OK))
157 {
158 fprintf (stderr,
159 "Failed to access %s, skipping test\n",
160 ps[i].filename);
161 skipped = true;
162 continue;
163 }
151 EXTRACTOR_extract (pl, 164 EXTRACTOR_extract (pl,
152 ps[i].filename, 165 ps[i].filename,
153 NULL, 0, 166 NULL, 0,
154 &process_replies, 167 &process_replies,
155 ps[i].solution); 168 ps[i].solution);
169 }
156 EXTRACTOR_plugin_remove_all (pl); 170 EXTRACTOR_plugin_remove_all (pl);
171 if (skipped)
172 return 0;
157 ret = 0; 173 ret = 0;
158 for (i = 0; NULL != ps[i].filename; i++) 174 for (i = 0; NULL != ps[i].filename; i++)
159 for (j = 0; -1 != ps[i].solution[j].solved; j++) 175 for (j = 0; -1 != ps[i].solution[j].solved; j++)