Comments (9)
@matu3ba I already showed MSVC compiler version on my last post. Look at picture of console.
from tau.
@GibbOne I ran this locally, and it seems to work:
Try this in a test file:
#include <tau/tau.h>
TAU_MAIN()
TEST(TAU, ItShouldFailWithMessage)
{
CHECK(0); // this check fails correctly.
CHECK(0, "It should FAIL"); // this check doesn't fail.
}
from tau.
@jasmcaus if I use gcc
it works like you did. But if I use MSVC, it doesn't.
from tau.
@GibbOne See this. Only MSVC 2017 seems to fail. Not sure why. I don't have a Windows machine w/ me so it's quite hard for me to explore this. Would you mind taking a look and opening a PR with your changes?
from tau.
@matu3ba maybe you could have a look at this as well?
from tau.
Let me spin up Windows in a WM to see, if I can reproduce.
// file t1.c
#include <tau/tau.h>
TAU_MAIN()
TEST(TAU, ItShouldFailWithMessage)
{
CHECK(0); // this check fails correctly.
//CHECK(0, "It should FAIL"); // this check doesn't fail.
}
// file t2.c
#include <tau/tau.h>
TAU_MAIN()
TEST(TAU, ItShouldFailWithMessage)
{
//CHECK(0); // this check fails correctly.
CHECK(0, "It should FAIL"); // this check doesn't fail.
}
// windows cmds:
// cl /I . t1.c -o t1
// cl /I . t2.c -o t2
// linux (works)
// gcc -I . test.c -o t1 && ./t1
// gcc -I . test.c -o t2 && ./t2
from tau.
@GibbOne Please always provide version numbers for the compiler version.
On the latest? release 19.13.31105 I get with cl /I tau t1.c
with t1.c having the following content:
// file t1.c
#include <tau/tau.h>
TAU_MAIN()
TEST(TAU, ItShouldFailWithMessage)
{
CHECK(0); // this check fails correctly.
//CHECK(0, "It should FAIL"); // this check doesn't fail.
}
the following error:
tau\tau/misc.h(34): fatal error C1083: Cannot open include fils: 'inttypes.h': No such file or directory.
So to me it looks like tau is broken on MSVC.
from tau.
@GibbOne My bad.
At least this post indicates that Microsoft only guarantees compatibility via their libraries.
https://stackoverflow.com/questions/41975672/abi-compatibility-of-visual-studio-c-libraries
A proper fix would probably require https://stackoverflow.com/questions/9233118/library-abi-compatibility-between-versions-of-visual-studio with https://github.com/lvc/abi-compliance-checker to figure out what is broken,
since unfortunately Microsoft does not generate reports what stuff they broke how and when.
from tau.
I solved by adding /Zc:preprocessor
compiler option.
See https://stackoverflow.com/a/5134656/6539880 and https://docs.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170.
from tau.
Related Issues (20)
- Refactor of macro names related to strings and substrings check, to avoid confusion HOT 11
- Support for Mocks + other features? HOT 6
- cmake's install() macro fails with _deps/tau-src/include/tau not found HOT 4
- Please fix tauPrintf macro HOT 1
- --no-summary option doesn't works HOT 1
- --list option must not run but only list the tests HOT 1
- defaults and changing them for compiler errors HOT 8
- question: how can I test for arithmetic overflow HOT 3
- base types: 128bit support and description of what arithmetic is checked or not checked (or how to check stuff)
- specify code formatting HOT 1
- Filtering by exact name doesn't work HOT 5
- Abi tests/Helper macros for char signedness HOT 2
- design questions on minimizing dependencies HOT 1
- docs: TEST blocks require that there is no return value HOT 3
- gcc 12.1.0 fails to compile the example
- Compiler warning: -Wunused-but-set-variable
- Documentation for fixture-based testing needed
- If we do tests in a loop, it seems we don't have an easy way to prompt which iteration failed HOT 4
- problem in tauClock under cygwin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tau.