|
From: | Rik |
Subject: | Re: test code in .oct sources |
Date: | Sun, 21 Jul 2013 17:04:17 -0700 |
On 07/21/2013 02:26 PM,
address@hidden wrote:
7/21/13Message: 4 Date: Mon, 15 Jul 2013 10:44:44 +0200 From: Daniel Kraft <address@hidden> To: address@hidden Subject: Test code in .oct sources Message-ID: <address@hidden> Content-Type: text/plain; charset=ISO-8859-1 Hi, I just tried to include test code in the sources to an .oct function of mine, and at first Octave didn't find them. A look at test.m showed that it only looks for sources in .cc files, while I use .cpp as extension for C++ files. (As I get it, .C and .cxx are also used.) What do you think about extending the range of supported file extensions? I don't think this could lead to any problems, because the only case when it differs from the current situation would be if someone types "test foo", doesn't have foo.m or foo.cc, but has foo.cpp. And in this case, I presume it is valid to assume that the he/she actually *wanted* to get the test code from foo.cpp. While at it, one could even rewrite the corresponding lines in test.m with a loop over a cell-array of supported file extensions. Does this sound like a good idea? If yes, I will provide a patch for it. Daniel, It's not a bad idea, but I think there are more important issues to fix. Octave uses the .cc extension and that isn't going to change. If your code is eventually aimed at incorporation into Octave core or into an Octave-Forge package then you might as well rename the extension to .cc now. Of course, for your own projects it is fine to develop using the .cpp extension. But, then the workaround is easy--just use 'test file.cpp' rather than 'test file' and it will work correctly. Cheers, Rik |
[Prev in Thread] | Current Thread | [Next in Thread] |