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:

  1. Copy my C extension's C file and header to Modules/;
  2. edit Modules/Setup.local, include a line saying foo foomodule.c -lblah;
  3. make clean
  4. ./config.status --recheck
  5. make coverage
  6. ./python.exe ~/path/to/tests.py
  7. gcov -o foomodule

So by the way, I have about 65% test coverage in pylibmc.


RSS 2.0