X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=tests%2Fruntc.c;h=11ae560dbea4766c63872d09018dbf9b333a6e66;hp=b75e4142c67d079b19035be1b806d2d7501d4041;hb=1f6f2ad8c33e58cfd40ea0370e6d2dfbd6040026;hpb=9eec72cb2bf132600db3330f49dace3bdf74080a
diff --git a/tests/runtc.c b/tests/runtc.c
index b75e414..11ae560 100644
--- a/tests/runtc.c
+++ b/tests/runtc.c
@@ -17,6 +17,7 @@
* along with this program. If not, see .
*/
+#include
#include "../libsigrokdecode.h"
#include
#include
@@ -30,28 +31,30 @@
#include
#include
#include
+#include
#include
#ifdef __LINUX__
#include
#endif
-#include "../config.h"
+#include "config.h"
int debug = FALSE;
int statistics = FALSE;
+char *coverage_report;
-struct probe {
+struct channel {
char *name;
- int probe;
+ int channel;
};
struct option {
char *key;
- char *value;
+ GVariant *value;
};
struct pd {
char *name;
- GSList *probes;
+ GSList *channels;
GSList *options;
};
@@ -64,6 +67,19 @@ struct output {
int outfd;
};
+struct cvg {
+ int num_lines;
+ int num_missed;
+ float coverage;
+ GSList *missed_lines;
+};
+
+
+struct cvg *get_mod_cov(PyObject *py_cov, char *module_name);
+void cvg_add(struct cvg *dst, struct cvg *src);
+struct cvg *cvg_new(void);
+gboolean find_missed_line(struct cvg *cvg, char *linespec);
+
static void logmsg(char *prefix, FILE *out, const char *format, va_list args)
{
@@ -80,7 +96,7 @@ static void DBG(const char *format, ...)
if (!debug)
return;
va_start(args, format);
- logmsg("DBG: ", stdout, format, args);
+ logmsg("DBG: runtc: ", stdout, format, args);
va_end(args);
}
@@ -125,11 +141,12 @@ static void usage(char *msg)
printf("Usage: runtc [-dPpoiOf]\n");
printf(" -d Debug\n");
printf(" -P \n");
- printf(" -p (optional)\n");
- printf(" -o (optional)\n");
+ printf(" -p (optional)\n");
+ printf(" -o (optional)\n");
printf(" -i \n");
printf(" -O \n");
printf(" -f