-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
Added travis.yml #4
Conversation
I had considered Travis and decided not to use it for now. The incremental benefit from testing on two Unix compilers (rather than one) is much less than from testing on both MSVC and a Unix compiler (rather than only one of those). This change may help people developing on MSVC the most, but there are more immediate challenges with MSVC, such as running Perhaps Visual Studio Online can help with MSVC testing, and then we can use Travis for Unix testing. I spent some time looking into that setup, but ultimately wrote I don't have enough experience to know this: is it relatively easy to get Travis to test on more than one version each of clang and gcc? |
This should be trivial to accomplish. If you are fine with using travis I could write up a matrix for all compiler versions mentioned in test.py. For windows there is appveyor, but I remember that being a pain to set up. |
I don't remember why I rejected AppVeyor before. The reason may since have become moot. I'm looking at it again now. Getting automated builds on MSVC is a high priority compared to clang/gcc, so I think the best thing to do is for me to focus on setting up AppVeyor. If, after that, it looks straightforward to also build with clang and gcc in AppVeyor's Windows environment (as weird as that sounds), then I will opt for that. Otherwise, we should extend this My reasoning is that a typical developer on a Unix-like system is probably using something like gcc 4.9 or clang 3.6 locally. In my experience, the behavior of recent versions of gcc and clang is mostly equivalent for the features |
While working on a version with all compilers installed I noticed that g++-3.4 is in that list. This compiler version is pretty old. So old in fact, that it is not even in any package repository available for ubuntu precise. As a result, I have been unable to install it. Would you mind if I removed this compiler version from test.py? |
I think you mean g++ 4.3. I prefer you not remove any of the compilers covered by
What it's looking like now is that CI services will cover a bunch of gcc and clang versions (Travis), and only some recent versions of MSVC (AppVeyor). If AppVeyor still supports even VS2013, they don't make it obvious. Since I want to cover more than what AppVeyor seems to support, I will need to keep I am testing out AppVeyor now, by the way. |
Will try to get a build matrix running on travis with as many compilers as I can. Appveyor images do have VS2013 installed. I can confirm that Windows Server 2012 R2 does. |
Cool, thanks, and thanks! |
Quick update: The build matrix currently looks like this. |
Thanks. I see that you are not using |
This looks like a use case for CMake, actually. We can check if a compiler supports a specific flag with CHECK_CXX_COMPILER_FLAG and starting with 3.1 we can also check for specific features. This way we don't have do update the list for every compiler. There are also script out there for cmake < 3.1 that do this. The only problem would be testing multiple compilers in one go. We would have to write a script that calls cmake for every version. For now, I could just add options to test.py for modern_gnu, gnu_re_constexpr and gnu_pre_enum_class and configure in travis what compiler needs what flag. |
I actually started on that at some point after I sent the last message. I uploaded the CMake branch, in the interest of coordination. It's still very basic. You can see the diff here: https://github.com/aantron/better-enums/compare/cmake I'm a CMake newb, as in this is the first time I use it, so don't hesitate to give any advice if you have experience. Also, I checked out options for building on multiple clang/gcc versions in AppVeyor yesterday, and decided that it's easier to just use Travis side-by-side. |
The current matrix looks like this. The clang builds fail because they have a test case which compiles with c++98. enum.h uses char32_t and char16_t if clang >= 2.9. But as these types are a c++11 extension and clang is compiling these with c++98 it (correctly) fails to build. g++ only passes these tests because it also checks for GXX_EXPERIMENTAL_CXX0X and __cplusplus. |
Going to take a look at the CMake branch now. |
I am aware of the danger of globbing, but I am not aware of a good way to do this automatically. I'd rather not resort to generating CMakeLists.txt. That's a little ridiculous :) As for the clang issue, the feature detection code is indeed apparently wrong. My local clang accepts |
Since I'm having trouble reproducing the problem with the compilers I already have installed, can you give this a try in Travis? https://github.com/aantron/better-enums/compare/clang-char-types This check might miss some old clang versions that took the EDIT: Actually, that might be slightly wrong, since clang probably supported |
You can check the status of the new build with your fix here. |
Cool, watching it. In the interest of me not wasting your time by us working on the same thing, I suggest we do this:
We will have one build matrix row per combination of compiler/configuration. |
Sounds good. We will see how big the build matrix gets for travis. While travis does not have a upper limit in total build time and size, the huge delay between single builds blows up the total build time. The current build was created on hour ago and only completed 4 out of 11 builds. We might want to have one row per compiler and iterate over all possible combinations in the build script. Edit: this appears to be a problem on travis' side |
I am also reconsidering one row per combination for another reason, which is it might be a good idea to give developers the ability to test all configurations on their compiler locally. Perhaps it won't be fast enough to use while first implementing a change, but these tests can be run before submitting a pull request. Once we have this ability, it will be easy to trigger it in Travis/AppVeyor, and we can have one matrix row per compiler. |
Ok, the changes are in It should now be possible to test in Travis by running |
Rebased my work on top of master und currently running the tests. |
You may want to also try Also, some upcoming nits:
After this goes in, I will commit an updated |
I'm seeing this in the Travis testing output: |
Fix added. |
All tests passed for the latest build. Is there anything else you would like me to add? |
Looks good :) Ready for the squashed & rebased patch. |
@aantron done. |
In as 1769fbb. Thanks! |
Your CONTRIBUTING.md states that you are looking for a third-party service to run your tests on. Travis is a continous integration service that builds every commit and even pull requests for you. You can log in using your github account and add your repository. Every time you push a new commit or someone submits a pull request, travis will build the commit and notify you if it failed. You can learn more about travis here.
This PR adds a .travis.yml so that travis knows how to run your tests. It currently tests clang 3.4 and g++ 4.8. For an example how this might look see https://travis-ci.org/UnrealQuester/better-enums/builds/68665505