Commit Graph

155 Commits

Author SHA1 Message Date
Vladislav Shchapov
07211701f4
Disable the -Wstringop-overflow warning from GCC 7 (#2442) 2021-08-02 14:20:18 -07:00
Daniela Engert
f2b03facd9
Include test sources to pick up functions and classes from the module rather than from the non-modular library which is baked into the test-main library. (#2356)
This averts linker problems:
 - strong ownership model: missing linker symbols
 - weak ownership model: duplicate linker symbols

Simplify `gtest-extra.cc` while at it.
2021-07-03 07:21:54 -07:00
Daniela Engert
5221242f6e Instruct msvc to report the _true_ value in __cplusplus and force _full_ C++ conformance
* do this  in _some_ tests to improve test coverage and catch possible problems due to that
 * fix invalid export of `static constexpr` constant
 * fix msvc warnings about unreachable code in high warning levels
2021-06-24 09:10:08 -07:00
Daniela Engert
59a298f124 Enable enforce-checks-test for MSVC, too 2021-06-10 12:54:54 -07:00
Victor Zverovich
16c3514d01 wchar-test -> xchar-test 2021-06-06 07:59:18 -07:00
Владислав Щапов
f286139d22 Fix "undefined reference to `fmt::v7::detail::basic_data<void>::digits'"
Remove unused FMT_EXTERN_TEMPLATE_API
2021-06-02 14:33:17 -07:00
Daniela Engert
70e67ae018 Re-enable module testing
Prepare for compilation with gcc (modules branch).
2021-06-01 14:49:56 -07:00
Victor Zverovich
bf9904ee4d Workaround msvc bugs 2021-05-31 08:25:05 -07:00
Daniela Engert
272b0f36b3
More module tests (#2309)
core.h, format.h, args.h, chrono.h, color.h, printf.h, os.h
2021-05-28 15:49:39 -07:00
Victor Zverovich
069131dc25 Add unicode-test 2021-05-24 06:20:51 -07:00
Victor Zverovich
703005c8ba Deprecate locale.h 2021-05-22 10:21:17 -07:00
Daniela Engert
5a0d99fa0b Add a test for the module 2021-05-20 10:26:31 -07:00
Victor Zverovich
0dd91e20d5 Add wchar.h for wide char overloads 2021-05-17 21:59:10 -07:00
Victor Zverovich
ed7c4320f6 Cleanup tests 2021-05-02 09:28:38 -07:00
Victor Zverovich
9155e2de4c Cleanup tests 2021-05-01 17:11:45 -07:00
Victor Zverovich
38127d9ec0 Cleanup tests 2021-04-30 15:50:03 -07:00
Alexey Ochapov
53ca0cbe75 gtest: move GTest/GMock files to separate directory, update GTest/GMock usages
* all GTest/GMock files moved to `test/gtest` directory
* `CMakeLists.txt` created in `test/gtest` from `CMakeLists.txt` in `test`
* GTest/GMock target in CMake renamed to `gtest` (was `gmock`)
* CMake `gtest` target updated to export includes as "gtest/gtest.h" or "gmock/gmock.h" only
* includes in tests updated: "gtest.h" -> "gtest/gtest.h", "gmock.h" -> "gmock/gmock.h"
* removed duplications of `target_include_directories` for GTest/GMock directories (CMake manages them)
2021-04-29 07:11:49 -07:00
Alexey Ochapov
b441532396 CI linux: add clang++-11 C++20 (with LLVM libc++) build
* find-package-test fixed by passing CXX_FLAGS, i.e. -stdlib=libc++
 * std::array usage in compile-test.cc replaced with plain array, because
   <array> header was not included
2021-04-10 07:20:05 -07:00
Vladislav Shchapov
4dc7170d21
Fix C++17 builds: (#2192)
- Fix C++17 Visual Studio builds.
- Use C++17 for `windows-2019` builds.
- Removed options for unsupported compiler (MSVC11).
- Removed options, not needed after enabling C++11+ features in gmock/gtest.
2021-03-26 06:19:43 -07:00
Victor Zverovich
a6408a3b09 Add args-test 2021-03-18 09:04:17 -07:00
Victor Zverovich
1256541d7a Fix formatting 2020-12-24 07:07:15 -08:00
Walter Gray
4fa4c9248f
Add tests for FMT_ENFORCE_COMPILE_STRING, fix several errors (#2038) 2020-12-24 06:40:46 -08:00
Victor Zverovich
bcc20b29df Implement compile-time checks by default 2020-11-15 17:24:36 -08:00
Victor Zverovich
1d112bdd1e Remove old test 2020-10-11 10:13:42 -07:00
Victor Zverovich
a905d8f704 Merge grisu-test into format-test 2020-09-26 08:23:16 -07:00
Dmitriy Vetutnev
a03bd3ddb0
Autodetect MSVC static runtime (#1770)
* Autodetect MSVC static runtime

* Update condition (MSVC)
2020-07-13 06:11:23 -07:00
Victor Zverovich
9f70fc3e7a Minor tweaks for dynamic_format_arg_store 2020-03-16 07:58:15 -07:00
Vladimir Solontsov
6012dc9ab4
Dynamic arguments storage. Implementation of enhancement from issue #1170. (#1584) 2020-03-16 07:00:29 -07:00
Victor Zverovich
b1adaa9881 Remove gcc 4.4 workaround 2020-03-07 14:50:52 -08:00
Victor Zverovich
f733882b55 Remove misleading FMT_USE_WINDOWS_H 2020-02-14 14:09:27 +01:00
Victor Zverovich
9ea42fb26e Rename posix-test to os-test 2019-12-15 16:43:40 -08:00
Victor Zverovich
fd52de0c6b Add FMT_CUDA_TEST CMake option to enable cuda-test 2019-12-09 07:30:34 -08:00
Victor Zverovich
9b7fe2a4a1 Don't use POSIX API on UWP 2019-11-17 08:29:08 -08:00
Victor Zverovich
dcde089b4e Improve POSIX API detection 2019-11-15 07:28:02 -08:00
Richard Musil
3b2fc033d1 Making CUDA test work with CMAKE_MSVC_RUNTIME_LIBRARY
CMake 3.15 introduced a new way of handling MSVC CRT type definition for
the build: CMAKE_MSVC_RUNTIME_LIBRARY variable.
(https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html)

This is supposed to be the way to go with MSVC CRT selection in new
projects. Using this method however breaks the current CMake script for
CUDA test. The reason is the CUDA test uses "FindCUDA" CMake module to
detect and set up CUDA support in CMake, which is deprecated since CMake
version 3.10, and which does not support CMAKE_MSVC_RUNTIME_LIBRARY
selector correctly (i.e. it does not propagate the compiler option
related to the CRT).

I did not find a way to "patch" in the correct compiler options, so
(while knowing this feature is only available from CMake 3.15 on) I
decided to change also the way CUDA is handled and instead of using
FindCUDA, used enable_language. Apart from having some nice additional
side-effects, it also fixed the problem with CRT selection.

However, the propagation of the compiler options (and in particular the
options related to C++ standard selection) is still a bit flaky on
Windows+MSVC platform, so it had to be done manually.

The patch makes two things in parallel:

1) Introduces MSVC_BUILD_STATIC, which, together with CMake version >=
3.15, allows building static version of the 'fmt' lib (and all the
tests).

2) At the same time, for CMake >= 3.15 it switches handling of CUDA
support from (old) FindCUDA to (new) enable_language, to fix the
problems which the old method has with the new CRT selector for MSVC in
a new CMake.

Added a check for CUDA before enabling it.

Using VERSION_LESS instead of VERSION_GREATER_EQUAL

Since apparently VERSION_GREATER_EQUAL exists only from CMake 3.7, while
Android is using CMake 3.6.

Removed MSVC_RUNTIME_LIBRARY logic from the CMake file.

The static build can be set on the command line with CMake >= 3.15
by defining the policy and the CMAKE_MSVC_RUNTIME_LIBARY this way:

cmake -G <gen> <options>
    -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
    -DMSVC_BUILD_STATIC=ON
    -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>"

When MSVC_BUILD_DEBUG is set the test 'posix-mock-test' is skipped as it
does not build with the static runtime.
2019-09-25 06:46:11 -07:00
Victor Zverovich
24a88545d9 Add -Werror to tests 2019-08-31 09:26:45 -07:00
luncliff
345ba07f1d Add a CUDA test
test cuda: import fmt in CUDA source code

Current test is only for Windows(cl.exe).
Need to test more with the other host compilers...

* Activate the test when `find_package(CUDA)` worked
* The test runs with C++14

Detailed comments in 'test/cuda-test'

test cuda: add more comment / macro check

* checks both `__NVCC__` and `__CUDACC__`

More comments for CMake and CUDA source file.

test cuda: <fmt/core.h> checks NVCC and CUDA

The header file checks 2 things.

* __NVCC__: if the compiler is from NVIDIA
* __CUDACC__: if the source code is CUDA(.cu) file

Since we can't sure all users prefer latest, Version for
`find_pacakge(CUDA)` is downgraded to 9.0.
This is the minimum version for C++14 in CUDA
2019-08-30 17:45:50 -07:00
Victor Zverovich
9393fe26f6 prepare -> compile 2019-07-25 19:39:41 +03:00
Victor Zverovich
d5d5865615 Move strtod_l check to CMake since it's very system-specific 2019-06-23 17:10:57 -07:00
Victor Zverovich
87e4ea2906 Fix a warning 2019-06-01 08:24:36 -07:00
Victor Zverovich
bb254d146b Disable std-format-test by default 2019-05-27 20:02:08 -07:00
Victor Zverovich
5ee0804631 Experiment with scan API 2019-05-15 10:02:40 -07:00
denchat
f4dfd6e30f Suppress all clang-target-msvc test warning in CMake and other misc fixes (#1151)
* Fix conditional `char8_t` from `format.h` and fix `-Wunused-result` of [[no_discard]] begin() when in c++17

* Suppress `-Winconsistent-dllimport` when in clang-target-msvc

* Suppress warning _CRT_SECURE_NO_WARNINGS in MSVC and -Wdeprecated-declarations

Suppress warning _CRT_SECURE_NO_WARNINGS in MSVC and -Wdeprecated-declarations of POSIX functions in Clang target MSVC.
Those functions are used by gtest.

* Remove FMT_FUNC, mark FMT_API to export
2019-05-11 11:48:27 -07:00
Victor Zverovich
41fbaeb3b1 Add <format> test 2019-04-13 11:37:52 -07:00
Victor Zverovich
8bc0adb9ba Get rid of obsolete cmake stuff 2019-04-13 11:37:52 -07:00
Victor Zverovich
dd6cc0e6ac Merge time-test into chrono-test 2019-03-14 18:10:56 -07:00
Victor Zverovich
8129b9bc46 Test that the library can be compiled witout locales 2019-03-10 07:57:29 -07:00
Victor Zverovich
835087dd04 Add color-test 2019-03-10 07:57:29 -07:00
Victor Zverovich
355eb6d29a Enable grisu for shortest roundtrip (default) formatting 2019-02-03 10:38:28 -08:00
Victor Zverovich
4f6fda558c Add a grisu test stub 2019-01-27 10:10:13 -08:00