Afaik, it should work as you describe.
Have a look in core/vil/tests/CMakeLists.txt at e.g.
As you can see from test_file_format_read.cxx, this effectively sets argc to 2 and argv to the core/vil/tests/file_read_data path.
You need indeed TESTMAIN_ARGS(function_name) or TEST_MAIN_ARGS(main_name) (instead of TESTMAIN(f)) in the test_*.cxx file.
test_driver.cxx does not need anything different.
In response to Andrew Hoelscher <anjruu@... message:
I was wondering how to pass arguments into the tests in the test
framework. I've declared my tests with "TESTMAIN_ARGS", and specified
arguments in the ADD_TEST function in the CMakeList.txt, but when I
run the test, argc is 1 and argv is garbage. Is there some other
declaration I would need to make, or some place besides the
CMakeList.txt where I would need to specify the arguments I want
passed into the test?