]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
testsolv: show an error if the testcase could not be written
authorMichael Schroeder <mls@suse.de>
Tue, 22 Feb 2022 17:04:30 +0000 (18:04 +0100)
committerMichael Schroeder <mls@suse.de>
Tue, 22 Feb 2022 17:10:02 +0000 (18:10 +0100)
tools/testsolv.c

index a9e67ec71e34fce0055a1f6ef4c5145dae6c87d3..9d5d28b9f75da79693411db3813efcdbeb5d3a0e 100644 (file)
@@ -298,7 +298,13 @@ main(int argc, char **argv)
            {
              int pcnt = solver_solve(solv, &job);
              if (writetestcase)
-               testcase_write(solv, writetestcase, resultflags, 0, 0);
+               {
+                 if (!testcase_write(solv, writetestcase, resultflags, 0, 0))
+                   {
+                     fprintf(stderr, "Could not write testcase: %s\n", pool_errstr(pool));
+                     exit(1);
+                   }
+               }
              if (pcnt && solq.count)
                {
                  int i, taken = 0;