Comments (19)
Thanks, @claremacrae. It should be fixed by #293, would you please be able to check it 🤔 Thanks again 👍
from ut.
Awesome! Thanks very much.
Leave it with me... I've updated I'm getting compiler errors in our code - I think possibly because of warnings that ut turns on, though I'm not sure - so it'll take me a little while to fix them so I can check it...
from ut.
Hi @kris-jusiak
Summary: It's improved, but not quite there yet! It gives filenames with clang now, but not quite yet with gcc.
ut git commit id = bd458f1
With this config, my tests pass
CMAKE_VERSION = 3.16.2
CMAKE_GENERATOR = Unix Makefiles
CMAKE_CXX_COMPILER = /opt/local/bin/clang++-mp-9.0
CMAKE_CXX_COMPILER_ID = Clang
CMAKE_CXX_COMPILER_VERSION = 9.0.1
CMAKE_UNITY_BUILD =
With this config, I get filename = 'unknown'
CMAKE_VERSION = 3.16.2
CMAKE_GENERATOR = Unix Makefiles
CMAKE_CXX_COMPILER = /usr/local/Cellar/gcc/9.2.0_2/bin/g++-9
CMAKE_CXX_COMPILER_ID = GNU
CMAKE_CXX_COMPILER_VERSION = 9.2.0
CMAKE_UNITY_BUILD =
from ut.
hmm, the following should work now, I think 🤔
#if not defined(__has_builtin)
#if (__GNUC__ >= 9)
#define __has___builtin_FILE 1
#define __has___builtin_LINE 1
#endif
#define __has_builtin(...) __has_##__VA_ARGS__
#endif
@claremacrae, can you check __GNUC__
for /usr/local/Cellar/gcc/9.2.0_2/bin/g++-9
and/or it has __has_builtin
defined? It seems unusal for some reason 🤔
from ut.
std::cout << "__GNUC__ " << __GNUC__ << '\n';
#if defined(__has_builtin)
std::cout << "has __has_builtin\n";
#else
std::cout << "NO __has_builtin\n";
#endif
Writes out:
__GNUC__ 9
has __has_builtin
from ut.
@kris-jusiak Is that what you meant?
Thanks for looking at this... I need to head off now.
If it helps, I'd be happy to pair on it, sharing screens... Wednesday, about 7pm UK time?
from ut.
Hi @kris-jusiak I'm unexpectedly free to pair for the next little while, if it helps -
If it works for you, or to arrange another time, feel free to email [email protected]
from ut.
Thanks for looking in to this. I just checked again, and this config is still giving filename unknown
:
With this config, I get filename = 'unknown'
CMAKE_VERSION = 3.16.2 CMAKE_GENERATOR = Unix Makefiles CMAKE_CXX_COMPILER = /usr/local/Cellar/gcc/9.2.0_2/bin/g++-9 CMAKE_CXX_COMPILER_ID = GNU CMAKE_CXX_COMPILER_VERSION = 9.2.0 CMAKE_UNITY_BUILD =
Was this info I posted above any use? I'm happy to work together on it, if it would help - as what was recently a working set-up for me with Boost.UT now no longer works...
Until then, I think it would be worth re-opening this ticket, please.
from ut.
Hi @claremacrae, sorry for the late response on this one. I believe that gcc 9.2.0_2 has a bug because both: gcc-9 (I guess versions after 9.2.0_2) and gcc-10 seem to work properly 🤔
Anyway, added a wknd for gcc-9 which should fix the issue 🙏
from ut.
Hi @krzysztof-jusiak thanks very much for looking at this again!
Really sorry to be the bearer of bad news, but I downloaded the bug-fix, and got this compiler output:
====================[ Build | UT_Tests | Debug-g++-9-brew ]=====================
/opt/local/bin/cmake --build /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew --target UT_Tests -- -j 4
/opt/local/bin/cmake -S/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp -B/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew --check-build-system CMakeFiles/Makefile.cmake 0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew/googletest-download
[ 11%] Performing update step for 'googletest'
[ 22%] No configure step for 'googletest'
[ 33%] No build step for 'googletest'
[ 44%] No install step for 'googletest'
[ 55%] No test step for 'googletest'
[ 66%] Completed 'googletest'
[100%] Built target googletest
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 UT_Tests
/opt/local/bin/cmake -S/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp -B/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew --check-build-system CMakeFiles/Makefile.cmake 0
/opt/local/bin/cmake -E cmake_progress_start /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew/CMakeFiles 2
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 tests/UT_Tests/CMakeFiles/UT_Tests.dir/all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f tests/UT_Tests/CMakeFiles/UT_Tests.dir/build.make tests/UT_Tests/CMakeFiles/UT_Tests.dir/depend
cd /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/tests/UT_Tests /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew/tests/UT_Tests /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew/tests/UT_Tests/CMakeFiles/UT_Tests.dir/DependInfo.cmake --color=
Scanning dependencies of target UT_Tests
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f tests/UT_Tests/CMakeFiles/UT_Tests.dir/build.make tests/UT_Tests/CMakeFiles/UT_Tests.dir/build
[ 50%] Building CXX object tests/UT_Tests/CMakeFiles/UT_Tests.dir/ApprovalTestTests.cpp.o
cd /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-gcc9-brew/tests/UT_Tests && /usr/local/Cellar/gcc/9.2.0_2/bin/g++-9 -DDUMMY_TEST_DEFINE -I/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/.. -I/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests -I/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/third_party/ut/include -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wall -Wextra -Wpedantic -Werror -std=gnu++2a -o CMakeFiles/UT_Tests.dir/ApprovalTestTests.cpp.o -c /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/tests/UT_Tests/ApprovalTestTests.cpp
In file included from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/../ApprovalTests/integrations/ut/UTApprovals.h:15,
from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/ApprovalTests.hpp:28,
from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/tests/UT_Tests/ApprovalTestTests.cpp:3:
/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/third_party/ut/include/boost/ut.hpp:48: error: "__has_builtin" redefined [-Werror]
48 | #define __has_builtin(...) __has_##__VA_ARGS__
|
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h:32,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h:27,
from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/wchar.h:70,
from /usr/local/Cellar/gcc/9.2.0_2/include/c++/9.2.0/cwchar:44,
from /usr/local/Cellar/gcc/9.2.0_2/include/c++/9.2.0/bits/postypes.h:40,
from /usr/local/Cellar/gcc/9.2.0_2/include/c++/9.2.0/bits/char_traits.h:40,
from /usr/local/Cellar/gcc/9.2.0_2/include/c++/9.2.0/string:40,
from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/../ApprovalTests/Approvals.h:4,
from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/ApprovalTests.hpp:11,
from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/tests/UT_Tests/ApprovalTestTests.cpp:3:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:89: note: this is the location of the previous definition
89 | #define __has_builtin(x) 0
|
cc1plus: all warnings being treated as errors
make[3]: *** [tests/UT_Tests/CMakeFiles/UT_Tests.dir/ApprovalTestTests.cpp.o] Error 1
make[2]: *** [tests/UT_Tests/CMakeFiles/UT_Tests.dir/all] Error 2
make[1]: *** [tests/UT_Tests/CMakeFiles/UT_Tests.dir/rule] Error 2
make: *** [UT_Tests] Error 2
from ut.
In case it helps, this is the revision that worked: 8004290
When I ignore white-space changes, there aren't many differences between that and the latest one...
from ut.
Thanks, @claremacrae, it's because APPLE defines
#define __has_builtin(x) 0
so __has_builtin
is available but is always bogous 😞
Created another fix -> #296 🙏
from ut.
Oh no, sorry you are having to chase your tail on this...
That fixes gcc 9 - but I'm really very sad to report that it breaks clang 9:
[ 50%] Building CXX object tests/UT_Tests/CMakeFiles/UT_Tests.dir/ApprovalTestTests.cpp.o
cd /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/cmake-build-spaces/cmake-build-debug-clang-mp-90/tests/UT_Tests && /opt/local/bin/clang++-mp-9.0 -DDUMMY_TEST_DEFINE -I/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/.. -I/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests -I/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/third_party/ut/include -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -Wall -Wextra -Wpedantic -Werror -Wno-c99-extensions -std=gnu++2a -o CMakeFiles/UT_Tests.dir/ApprovalTestTests.cpp.o -c /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/tests/UT_Tests/ApprovalTestTests.cpp
In file included from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/tests/UT_Tests/ApprovalTestTests.cpp:3:
In file included from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/ApprovalTests.hpp:28:
In file included from /Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/ApprovalTests/../ApprovalTests/integrations/ut/UTApprovals.h:15:
/Users/clare/Documents/develop/ApprovalTests/ApprovalTests.cpp/third_party/ut/include/boost/ut.hpp:44:8: error: undefining builtin macro [-Werror,-Wbuiltin-macro-redefined]
#undef __has_builtin
^
1 error generated.
make[3]: *** [tests/UT_Tests/CMakeFiles/UT_Tests.dir/ApprovalTestTests.cpp.o] Error 1
make[2]: *** [tests/UT_Tests/CMakeFiles/UT_Tests.dir/all] Error 2
make[1]: *** [tests/UT_Tests/CMakeFiles/UT_Tests.dir/rule] Error 2
make: *** [UT_Tests] Error 2
from ut.
(my line numbers are 1 higher than yours, as I add a comment in with the git id of the version I've copied in...)
Do I need to just give up on the compiler versions I'm using and update them?
It feels like UT is living on the bleeding edge and maybe only those happy with using the very newest shiny things will tend to try it out - as it seems to be only me reporting problems with older compilers! 😢
from ut.
I've gotta go for today - thanks ever so much for your efforts! 😄
from ut.
I'm committed to getting it working with gcc9 and apple.
I pushed another fix, hopefully, the last one, thanks for your help @claremacrae.
from ut.
Awesome - it works on my gcc 9.2.0 and clang 9.0.1! 🎉 😄
Huge thanks for persisting with this @krzysztof-jusiak 🙏
from ut.
This is the change I tested: 46a4f2e
from ut.
Fantastic, thanks, @claremacrae 🙏
from ut.
Related Issues (20)
- running clang-format on ut.hpp in master produces changes?
- 7 tests fail
- Would be nice if the _i operator accepted hex constants HOT 1
- Boost review process
- `using namespace boost::ut;` breaks piping views that are copied to local variable.
- Test crashes in aarch64 built with clang++ HOT 1
- clang-scan-deps fails on ut.hpp
- Tests fail due to global instances destroyed HOT 1
- Leak when a source file starts with an A
- std::cout blocked from printing, is there an option to set?
- Version 2.0.1 segfaults when using std::format and std::cout on multiple threads HOT 24
- aborts support on Windows?
- Tests are always skipped when ut is #included into a module
- Number of asserts is reported wrongly HOT 1
- Fatal expression with custom message compile error HOT 2
- Custom message for fatal expressions not shown
- Add the option to display a diff when comparing strings
- Unnecessary CPM.cmake to Get PackageProject.cmake
- Disable Install Targets If It Is a Subproject HOT 1
- SEGV when using Clang [12, 16] HOT 12
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 ut.