Quick tip no Terminal Tab Switching
As mentioned in an earlier post, terminaltabswitching is a very nice way to get Cmd+[0-9] to go to the correct tab in Mac OS X's Terminal.
I've had issues with Cmd-1 though, and I've come up with a work-around.
You need to close the first window Terminal opens for you on start, because I think it loads before swizzling takes place. Exiting it and starting a new one works fine for me.
Test coverage for Python C modules
It's actually pretty easy to get some coverage statistics of C code, even with Python. You've just gotta grip it.
First, you shouldn't write half a script duplicating Tools/freeze/freeze.py in the Python distribution. Freezing for C libraries equals statically compiling! It's true.
Here's what I did, rougly:
- Copy my C extension's C file and header to
Modules/; - edit
Modules/Setup.local, include a line sayingfoo foomodule.c -lblah; make clean./config.status --recheckmake coverage./python.exe ~/path/to/tests.pygcov -o foomodule
So by the way, I have about 65% test coverage in pylibmc.
