This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add expandargv test to libiberty testsuite.
I was thinking something like this:
const char *test_data[] = {
"data to write\nto some file N"
"data to write to\r\nsome file N+1",
0, /* ends list of files */
"argv[1]",
"@argv[2]",
0, /* ends list of "before" command line */
"argv[1]",
"argv[2]",
"argv[3]",
0, /* ends list of "after" command line */
"start\bof\bsecond\btest\b",
...
0,
0
};
The test would just cycle through the whole array, building and
running tests as it found them. Testing for \0 might be tricky; we'd
have to have some hook that says "When you see \b, write \0". Output
files would have predetermined names, like "file1.txt" through
"fileN.txt" so the tests can put the right @file in.
This way, we avoid the problem of checking binary files into cvs/svn
(cr/lf conversions happen by accident a lot) and keep everything in
one source file. It also lets us comment the test cases.