Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Getting summaries from programs that don't exit

LegacyForum Posts: 1,664 ✭✭
edited December 2016 in Insure++
If you have a program that runs perpetually i.e client/server application daemon, service or something similar to any of these. You will typically not get a summary from insure because insure does not create the summaries until after exit has been called.

There are couple of things that can be done about this

1. you can run the program in the systems debugger and from a point in your programs execution where it would be safe for you to exit you can call exit(0) . Insure will intercept the call to exit() and produce it's summaries before insure itself calls the final system exit routine.

2. You can in the top level control loop add some kind of dynamic check for a condition that can be made true during execution. One simple one is to look for the existance of a file and if that file exists then call exit like:
if (access ("/tmp/byebye", F_OK) == 0) { unlink("/tmp/byebye"); exit(0); }
Then at some point during execution after you feel your program has ran long enough you can just create the file.