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
Cannot compile for UWP (Universal Windows Platform) #1020
Comments
Interesting. I guess it makes sense that Win32 APIs when building for UWPs, but I wonder why |
@horenmar Looking at the templates available and a quick Google seems to suggest that you cannot create console application using UWP. This makes sense to me as the point in UWP (as I understand it) is that the 'App' can run on Desktop, Tablet, Phone, Console etc |
This should be fixed in Catch 2 |
@horenmar Thats awesome, thanks very much! I think maybe we got our wires crossed about the console though. Although I don't think you can create a console only App using UWP, it is still possible to write to the console output window using |
@horenmar I tried release v2.0.0-develop.4 and now I am getting:
Its also worth noting that when I replace this with my own |
I had the same problem with OutputDebugStringA on Windows with Visual Studio 2017 in a console application project. #include <windows.h> |
That is weird. The problem is definitely with stitching. We are working on making it saner, but didn't have much time lately. |
Can you check whether the attached single include works for you? |
I've tested it without |
@horenmar That build works for me too using UWP. Still no console output though. When a test fails all that is shown is
And its lost in a lot of other debug output. |
@michaelcowan Well, UWP apps do not provide proper stdout, you will have to redirect it yourself to wherever. We could do it as well, but the only place that is at least semi-guaranteed to exist is the debug output and that can already be pretty full. |
@horenmar A quick look at the Catch source and I can see its using To be clear, In my UWP application I can simply: #include <windows.h>
// snip
::OutputDebugStringA("test"); |
@michaelcowan I know. However, the debug output can already be quite noisy, thus I think it is better to let our user redirect stdout to wherever is most appropriate for their application (or use |
@horenmar Because I'm working on several platforms at once, it was consistency I was looking for. Catch::ConfigData config;
config.showDurations = Catch::ShowDurations::Always;
config.useColour = Catch::UseColour::No;
session.useConfigData(config); For iOS (XCode) the test results are written to the Output window. I found though that I can have all platforms write results to their output windows by adding: config.outputFilename = "%debug"; I'm not sure if this is a bug or not but from a user experience I expected all platforms to work the same. That said I'm more than happy with the build you provided as it does exactly what I need with this tiny tweak. Thanks for all the help and the impressively speedy updates - its really appreciated 👍 |
@michaelcowan You could argue that the inconsistency stems from inconsistent behaviour between XCode and Visual Studio. By default, Catch writes its output to stdout. UWP apps do not show stdout anywhere, but it can be redirected by However, as you found out, you can ask Catch to redirect the output to a file (including a special file, |
@horenmar Yup, agreed. That makes sense to me. |
Is there anything outstanding on this issue? |
@philsquared Absolutely! |
Cool - thanks |
Description
I am porting an existing project that makes use of Catch to UWP. When compiling I get the following errors (amongst others):
It would seem that UWP does not supply these classes.
Steps to reproduce
File -> New Project -> Installed -> Visual C++ -> Windows Universal ->DirectX 11 App (Universal Windows)
Extra information
The text was updated successfully, but these errors were encountered: