]> sigrok.org Git - libsigrokdecode.git/blobdiff - tests/runtc.c
runtc: Return errorcode according to testcase result.
[libsigrokdecode.git] / tests / runtc.c
index 04151f8043048a42b5646d4a06809b500bbccab2..427697301fc1d9e890549660600945faa5ba325c 100644 (file)
@@ -378,6 +378,7 @@ int main(int argc, char **argv)
        struct probe *probe;
        struct option *option;
        struct output *op;
+       int ret;
        char c, *opt_infile, **kv, **opstr;
 
        op = malloc(sizeof(struct output));
@@ -484,12 +485,14 @@ int main(int argc, char **argv)
        if (srd_init(DECODERS_DIR) != SRD_OK)
                return 1;
 
-       run_testcase(opt_infile, pdlist, op);
+       ret = 0;
+       if (!run_testcase(opt_infile, pdlist, op))
+               ret = 1;
 
        srd_exit();
        sr_exit(ctx);
 
-       return 0;
+       return ret;
 }