Do you want to do a unit-test (as in 'testing for correctness') or a performance test (as in 'how fast is it')? For the former, I can recommend the combination of Ceedling, CMock and Unity. Note that especially mocking can be interesting since you need to abstract from your hardware.
And for the second case (how fast...) use a logic analyzer and toggle a pin to see how fast things go on...
You can measure amount of CPU clock cycles consumed by some piece of code using custom StopWatch component (attached). It uses system SysTick timer to count CPU cycles. The component is rather unfinished, but works for PSoC4, 4M and 5LP. To measure CPU clocks put StopWatch_Start() and StopWatch_Stop() in your code, and print result on terminal:
StopWatch_Start() ; // reset timer
// your code is here (function, ISR, etc.)
StopWatch_Stop() ; // stop timer
uint32 BusClockTicks = StopWatch_Cycles; // read result
To add StopWatch component to you project, Import it from the demo project attached.