-
Notifications
You must be signed in to change notification settings - Fork 471
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
Repair VC8 compile of test applications #593
Conversation
Update master from soci/soci
- soci-platform.h got minimal required _WIN32_WINNT version to enable usage due to windows.h include of Add/RemoveVectoredExceptionHandler - default macro parameter (3 required / 2 given or 2 required / 1 given) do not expand and lead to syntax error (missing ')')
What are these? The Catch does not seem to like the change, I'm afraid. |
The AppVeyor show similar things like my local build for ODBC.
This should be fixed with the define inside soci/soci-platform.h related to this Remarks: https://msdn.microsoft.com/de-de/library/windows/desktop/ms679274(v=vs.85).aspx Tested compiler: |
Ok, this one could be catched by conditional:
But this is MinGW build I not tested yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If,
- AppVeyor build is fixed
- Nobody reports any objections
it LGTM.
include/soci/soci-platform.h
Outdated
@@ -74,6 +74,7 @@ namespace std { | |||
|
|||
//define DLL import/export on WIN32 | |||
#ifdef _WIN32 | |||
# define _WIN32_WINNT 0x0500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd do:
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
# endif
tests/common-tests.h
Outdated
@@ -537,7 +537,7 @@ TEST_CASE_METHOD(common_tests, "Exception on not connected", "[core][exception]" | |||
CHECK_THROWS_AS(sql.get_last_insert_id(s, l), soci_error); | |||
} | |||
|
|||
TEST_CASE_METHOD(common_tests, "Basic functionality") | |||
TEST_CASE_METHOD(common_tests, "Basic functionality", "basics") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, isn't the third argument of TEST_CASE_METHOD supposed to be a tag?
Aren't Catch tags supposed to be in form of ["tag1", "tag2"]
?
tests/common-tests.h
Outdated
@@ -570,15 +570,15 @@ TEST_CASE_METHOD(common_tests, "Use and into", "[core][into]") | |||
|
|||
auto_table_creator tableCreator(tc_.table_creator_1(sql)); | |||
|
|||
SECTION("Round trip works for char") | |||
SECTION("Round trip works for char", "section") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I'd make it a proper tag like ["char"]
tests/common-tests.h
Outdated
{ | ||
char c('a'); | ||
sql << "insert into soci_test(c) values(:c)", use(c); | ||
sql << "select c from soci_test", into(c); | ||
CHECK(c == 'a'); | ||
} | ||
|
||
SECTION("Round trip works for string") | ||
SECTION("Round trip works for string", "section") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I'd make it a proper tag like ["string"]
tests/common-tests.h
Outdated
@@ -587,7 +587,7 @@ TEST_CASE_METHOD(common_tests, "Use and into", "[core][into]") | |||
CHECK(str == "Hello, SOCI!"); | |||
} | |||
|
|||
SECTION("Round trip works for short") | |||
SECTION("Round trip works for short", "section") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I'd make it a proper tag like ["short"]
etc.
tests/common-tests.h
Outdated
@@ -596,7 +596,7 @@ TEST_CASE_METHOD(common_tests, "Use and into", "[core][into]") | |||
CHECK(sh == 3); | |||
} | |||
|
|||
SECTION("Round trip works for int") | |||
SECTION("Round trip works for int", "section") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, I'd make it a proper tag like ["int"]
Unless, we are going to get rid of it once SOCI switches to C++11 anyway.
If so, we may agree to replace all those with ["dummy"]
(or even empty string if kosher for Catch) as we don't seem to use the tags currently anyway. That would be simpler to re-work the PR with search & replace.
Either would work for me.
After updating the PR AppVeyor passes the MinGW build and tests. |
Let's see if the master builds https://ci.appveyor.com/project/mloskot/soci/build/4.0.0.287 |
The additions of And if not, I think there ought to be a macro like |
Ok, I will try to find another way but the issue at VC8 by one of many examples is:
on C:\Github\hrabe\soci\tests\common-tests.h(573) as:
and define as:
|
We're at Catch v1.9.6. Could you try to pull the latest (single header) and check if it works? Meanwhile, I asked to confirm VC++ 8.0 support catchorg/Catch2#1029 |
Will try that, but there seems to be a problem on MS side: https://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement |
Used now
for compile but no luck at all, the problem of VC 8 variadic macros with too less argument persist! |
@hrabe Thanks for checking Catch 1.10.0. I think we can safely assume VC8 is not (fully) supported any longer. |
So how to solve? Drop support of VC 8.0 is no option to me (currently). And could your please update the issue headline you created at Catch from 2015 to 2005 please ? |
I, personally, don't care about anything older than VS2015 (and GCC/clang with equivalent C++ support). Nevertheless, I understand
So, until SOCI team decides to switch to C++11 or later, I'm fine accepting PRs with any (reasonable) plumbing required by the older compilers. I, however, am not able to provide any assistance myself or promise I won't break anything with some commits in future - simply, I have no means to try such old compilers. Unless AppVeyor can help us.
Any chance to address @vadz suggestion #593 (comment) ? Then, either Vadim or myself, we'll be happy to merge this PR in. |
Would try the macro for dummy but what would you say @vadz and @mloskot about this:
Why not using the tags really without dummy but with prefixed TestMethod Tag and Tag for current section like char, string, short etc? |
I'm not sure, can tags be actually used with sections? I've never done this... If they can, then using real tags is indeed better, but if they can't, then this would be surprising/confusing, so I'd still prefer the dummy macro idea. In fact... what about something like this:
Shouldn't this solve the problem for it? |
AFAIK, tags work for
👍 |
In fact the second parameter of the So we should either add real descriptions to all of them, which seems to be a bit too verbose and redundant with the name, but bearable, or use the hack for VC8 above. |
This would solve it but only as long as nobody uses descriptions, if so, this workaround will break. |
Now Travis complains about wrong CMake version.
|
This is due to Travis timeout'ed during apt steps and did not pull CMake update from PPA repository. I have manually restarted the three failing build jobs. |
Travis is green. AppVeyor is also green https://ci.appveyor.com/project/mloskot/soci/build/4.0.0.288 despite the "Waiting for status to be reported". I'll hit "Update Branch" button to rebase from master and nudge the rebuild. Once builds complete, it's ready to merge. @vadz you agree? |
Holy s***t! I had no idea the "Update branch" button messes the commit history a bit: It triggered builds, at least I'm not gonna use this button any more:) @hrabe I'm sorry, feel free to |
PR updated. Hope will now be valid for merge after travis and appveyor. Small question beside: If I work on a branch at my fork, could I also use travis and appveyor at forked branch? |
Yes, of course. I do it myself. Just enable the the services for your fork. CI builds don't send any notifications to mailing list, so there won't be any unwanted noise. Good practices is also to develop contributions in topic branch, not in master branch of your fork. Then, you submit PR from on that topic branch. |
Thanks for confirmation and suggestion. Will do next changes in feature branches beside master and will use a forked_master to sum up all in fork too. |
@hrabe I wouldn't worry about using |
FYI, I've decide to try out the GitHub's Squash and merge button (second of the three buttons). I think it worked fine, no damage noticed. |
@hrabe Thanks for your efforts! |
Due to unsupported default param usage in macros and no qualified given _WIN32_WINNT version the test apps will not compile with some of Microsoft compilers.
Exception Features used are only available if a minimum version is set due to conditional enabling in windows.h file (and sub required files)