Commit Graph

19 Commits

Author SHA1 Message Date
Michael Grunder cc9d032971
Win32 tests and timeout fix (#776)
Unit tests in Windows and a Windows timeout fix

This commit gets our unit tests compiling and running on Windows as well as removes a duplicated `timeval` -> `DWORD` conversion logic in sockcompat.c 

There are minor differences in behavior between Linux and Windows to note:

1.  In Windows, opening a non-existent hangs forever in WSAPoll whereas
    it correctly returns with a "Connection refused" error on Linux.
    For that reason, I simply skip this test in Windows.

    It may be related to this known issue:
    https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/

2.  Timeouts are handled slightly differently in Windows and Linux.  
    In Linux, we intentionally set REDIS_ERR_IO for connection
    timeouts whereas in Windows we set REDIS_ERR_TIMEOUT.  It may be
    prudent to fix this discrepancy although there are almost certainly
    users relying on the current behavior.
2020-04-02 22:41:34 -07:00
Michael Grunder 38675d23cc
Housekeeping fixes (#764)
Housekeeping

* Check for C++ (#758, #750) 
* Include `alloc.h` in `make install` and `cmake`
* Add a `.def` file for Windows (#760)
* Include allocation wrappers referenced in adapter headers
* Fix minor syntax errors and typos in README
* Fix CI in Windows by properly escaping arguments (#761)
2020-02-27 21:29:05 -08:00
Michael Grunder 669ac9d0c8
Safe allocation wrappers (#754)
Create allocation wrappers with a configurable OOM handler (defaults to abort()).

See #752, #747
2020-01-28 12:13:05 -08:00
Paul Botros f052fd1add Adding an option to DISABLE_TESTS
Useful when hiredis is used as a CMake dependency in other projects and
added via add_subdirectory(). With DISABLE_TESTS on, `make test` in the
parent project won't run hiredis tests.
2019-11-03 22:01:28 -08:00
Yossi Gottlieb dd408e8e3f Update CMakelists for hiredis/hiredis_ssl builds.
Also rename the SSL option from `HIREDIS_SSL` to `ENABLE_SSL` to conform
with CMake convnetions.
2019-09-01 13:47:39 +03:00
Yossi Gottlieb 44ef4de9d9 Update CMakeLists with sslio.c rename. 2019-08-29 22:21:40 +03:00
kevin1018 8249e67355
Add install adapters header files 2019-07-17 19:05:06 +08:00
m e38cd75562 CMake: Minor modernization
Rely more on transitive dependencies, as provided by
TARGET_LINK_LIBRARIES. Avoid using ADD_DEFINITIONS and
INCLUDE_DIRECTORIES. This avoids leakage/pollution of defines and
includes.
2019-04-01 11:54:37 +02:00
m dc6d19b9ec Port network layer to Winsock
With this change, Hiredis builds with MinGW and runs on Windows.
2019-04-01 11:54:37 +02:00
Mark Nunberg 792bdbab7e cmake: ssl disabled by default 2019-02-21 12:04:53 -05:00
Mark Nunberg 0bc2356ed5 CMake: update for SSL 2019-02-20 09:11:10 -05:00
Justin Brewer ebe1657c8f Obey HIREDIS_SONAME for shared library
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2019-02-20 05:01:09 -05:00
Justin Brewer 7d38176bdb Call project() with parsed version string
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2019-02-20 05:01:09 -05:00
Justin Brewer 58d0e28333 Enable make test
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2019-02-20 05:01:09 -05:00
Justin Brewer 9ea7ddec0c Generate and install hiredis.pc
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2019-02-20 05:01:09 -05:00
Justin Brewer edfab35cdc Install async.h
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2019-02-20 05:01:08 -05:00
Justin Brewer 0c57a083c7 Add ENABLE_EXAMPLES option, off by default
Signed-off-by: Justin Brewer <jzb0012@auburn.edu>
2019-02-20 05:01:08 -05:00
Mark Nunberg bbad21f5ca Add examples to CMakeLists 2019-02-20 05:01:08 -05:00
Mark Nunberg ead586a2cb Add CMake system. Initial commit
This provides a target to build a DSO, as well as the ability to install
it.
2019-02-20 05:01:08 -05:00