Showing line execution count in Xcode - xcode

Does anyone know if it is possible to highlight line execution count in Xcode as in the following screeshot
Line execution count may be found on the right side.
Xcode highlights line execution count automatically when you run tests on a scheme with gather coverage data option turned on.
However, if you run tests from a shell script, line execution count is not highlighted. I use xcov-core tool to parse .xccoverage files into .json. This .json does not contain line execution count by default. I added this feature in my fork of the repo.
I know how to highlight errors and warnings in Xcode:
echo {full_path_to_file}{:line}{:character}: {error,warning}: {content}
I'm looking for a similar way of highlighting line execution count.
Thanks in advance

Related

How would I add a line break at the end of every terminal completion?

After running and completing any command in the terminal I would like to have a --------------------- added on a new line to make it easier to find where I started older commands.
I often have a hard time scrolling back to see where exactly a call was made, and having a line break would help a lot.
Thanks!

How to IGNORE breakpoints and go to a line directly where cursor is in VS

I am trying to understand VS Debugging Techniques.
Situation 1:
I have a 100 line of code. I have break point as 10,20,30,40. Currently my debugger is at line 20. And Now I realize that I want to go to line 50 (Kindly note that I DO NOT HAVE any breakpoint there). So I click on line 50. So is there any way I can go to line 50. P.S: I don't want to skip the execution of previous lines. I want the debugger to execute till line 49 properly w/o stopping at any previous breakpoint and stop at line 50. Is it possible?
Situation 2:
I have a 100 line of code. I have break point as 10,20,30,40. Currently my debugger is at line 20. And Now I realize that I want to go to line 40 (Kindly note that I do HAVE A breakpoint there). So I click on line 40. Is there any way I can go to line 40. P.S: I don't want to skip the execution of previous lines. I want the debugger to execute till line 39 properly w/o stopping at any breakpoint and stop at line 40. Is it possible?
Please guide me if it's possible. And you could tell me keyboard shortcut too that will be awesome.
P.S: If any of the situation 1 or 2 is possible I can live with that as that will be huge help to me. If I can click on a line then I can always put a breakpoint (no laziness) provided I know that I can directly reach to that line ignoring all the previous breakpoints :)

Test complete. Run test from a specific point

Does anybody know if it's possible in Test Complete to run a test from a specific point in a function?
I see options like run routine, run test, run project.
Thank you,
Raluca
There is no way to start execution of a script test from a specific line, but it is possible to move the execution point to the desired line. You can set a breakpoint to the first line of a script routine and run this routine. Once the test execution is stopped at the breakpoint, use the Set Next Statement action to move the execution point to the needed line and continue the execution.
This feature is documented in the Setting Next Execution Point help topic.
TestComplete's Keyword Driven Tests have the possibility to add "Labels" and "Go To Labels".
You can put a label anywhere in your KDT script and set a GoToLabel at the very beginning of your test to move to that point.
It may even be possible to combine this with Project Variables to get a "Last Reached Milestone/Label". This is only speculation, but worth looking into it.
no there is no way you can run testcomplete scripts from a specific point. the closest point you can get to for runnning you script from a specific point is to use break point and then press F10 for executing one by one line of code

R, debug line number

When debugging a function (which has been marked debug using debug("f"), the debugger gives you the Browser prompt which also tells you at what line number in the program you are. If run a couple of test statements at the prompt (to check variables, etc.) the screen scrolls and I no longer know what line number I am at (using SecureCRT so it scrolls past the buffer). The command where only tells you what function you are in. Does anyone know how to get the actual line number and next statement to be executed?
Thanks
When I use the regular browser(), I set max.lines to print to a low number:
options(deparse.max.lines=100)
so that if the output during debugging is long, I don't have to scroll too far up.

(Re)starting Matlab after error from error location

I'm debugging a matlab script that takes ~10 minutes to run. Towards the end of the script I do some i/o and simple calculations with my results, and I keep running into errors. Is there a way to start matlab from a certain sport in a script after it exits with an error--the data is still in the workspace so I could just comment out all of the code up until the error point, but I'm wondering if anyone knows a better way to go about doing this without rerunning the entire script (the ultra-lazy/inefficient way)?
Thanks,
Colorado
Yes, use dbstop. Type dbstop if error and then run your script. The minute it hits an error, it will create a breakpoint there and you're in the workspace of the script --- which means you can debug the error, save data ; anything you want! Here's a snippet from the documentation for dbstop if error --- there are other ways to do dbstop, so do check it out:
dbstop if error
Stops execution when any MATLAB program file you subsequently run produces a run-time error, putting MATLAB in debug mode, paused at the line that generated the error. The errors that stop execution do not include run-time errors that are detected within a try...catch block. You cannot resume execution after an uncaught run-time error. Use dbquit to exit from debug mode.
Double percent signs will enable 'cell mode' which lets you run little blocks of code in steps. Sounds like just what youre looking for.

Resources