-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes BUILDINSOURCE detection #798
Conversation
thanks @remram44. @dlonie let's not merge it until we tag 2.0 and put the binaries out. |
Note: apparently this introduced a bug for Brian Smith (who's not on Github) |
No problem @aashish24 -- since you pinged me on it this morning, I thought it was needed. As for testing, the travis CI builds had passed. |
@dlonie no problem. The travis might not check for all possible conditions. When you get a chance, please look at the code. |
Well, we know it doesn't work for at least one case. @remram44 can you fix Brian's issue, test the implementation a bit more before pushing, and update this branch? I was going to ask on the other pull request, but figured this patch was needed at the time...Since that's not the case, is this change actually necessary? True, paths are not regular expressions, but they are strings, which regex's are designed to test/analyze...Is there a non-pathological case where the current implementation fails? |
The problem is not the right-hand-side of the Brian's issue is not known to me. |
Bah, the thread with his output is yet another discussion that wasn't on the mailing list...We really should be using the list to discuss these things so the relevant people stay notified. Here's the relevant bit:
At a glance, it looks like an off by one error in the substring call. Can you be more specific about the regex error? The left hand side |
Sorry here it is: bs1mbpro:build bs1$ /usr/local/CMake.app/Contents/bin/cmake ../source -DGIT_PROTOCOL=http:// [INFO] We reset your path to: /Users/bs1/uvcdat-devel/build/install/Externals/bin:/Users/bs1/uvcdat-devel/build/install/bin:/Users/bs1/uvcdat-devel/build/install/Externals/bin:/Users/bs1/uvcdat-devel/build/install/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/local/munki:/usr/texbin |
That's assuming nothing in I have no idea how SUBSTRING counts characters, the CMake documentation (and language...) is not exactly workable. I'll test this some more when I get the chance. |
Alright got it, tests are over there: https://gist.github.com/remram44/615b7e19f1ff2a724c1a (CMake has no support for unit-testing!?) |
a37cf18
to
b86b5b3
Compare
nice. cmake it self is not a replacement for junit or cppunit or things like that. It is at a higher level than the unit testing or regression testing framework. It collects information from these testing frameworks and post them on the web-server. |
I mean testing CMake code itself. |
@dlonie can you look into this? |
Into testing CMake code? http://www.cmake.org/cmake/help/v2.8.12/cmake.html#opt:-Pfile
Add the cmake code you want to test to |
@remram44 can you add test for it based on what @dlonie 's suggestion? |
Probably not... it's not worth it as failures would be easy to spot (and work around). |
@remram44 I would suggest we add test even as for some it may not be as easy plus in the future if somone make any changes, then atleast we can verify that we have not broken the code. |
You are welcome to add this, or at least to set up a test suite infrastructure in the CMake code. I won't pursue this myself. |
Just an FYI: See my last comment for how to unit test cmake code. The infrastructure exists. |
The CTest suite tests the build tree, not the source. There would need to be a system to copy the CMake test files over, with the files they test, and then register them with CTest. I'm not writing that for a single piece of code that can only fail in harmless ways. |
Not sure I see where the difficulty is...All it would take is one line, But I'm not going to twist your arm on this. If it's not worth it to you as the author of the patch, it's really not worth it to me. shrugs |
I agree and disagree. Obviously the old code failed that bothered a developer enough to push a patch like this. Yes, it was a harmless error but it could annoy someone right? I will look at the code morefully before I am comfortable merging it (in case you don't want to add testing for it). Now that will add extra work for me because now I have to think of all possible scenarios which otherwise could be tested by a test. But I understand that adding a test is some work and developers often don't like that. |
I posted a test case 16 days ago, here it is again: https://gist.github.com/remram44/615b7e19f1ff2a724c1a Again, you're welcome to add it to CTest if you feel this is useful. |
This is not in. |
Unless we have some tests for this, we won't be able to merge this in. A previous change broke the build for few folks and now we have to make sure that we do some testing for it. |
Reopening as discussed; removed "gatekeeper" label since CMake tests are to be added before merging. |
@aashish24 where is kitware at with this? |
It's on my list. I'm out next week for the holiday, should have something afterwards. |
doh! |
@dlonie can we add a simple test and get this one merged as well? |
This is next on my list. Should get to it soon. |
Issued new PR (can't update this one as it is in a fork, so I pushed a new branch to the UVCDAT repo). New PR is #973. |
Fixes #713
Amends #736; paths are not regexps.
Re-applies #791 wrongly merged and reverted by #797; please test BEFORE merging.
(low priority)