Skip to content
Snippets Groups Projects
Closed Building Unit Tests on Windows
  • View options
  • Building Unit Tests on Windows

  • View options
  • Closed Issue created by teor

    Reported by Gisle Vanem on tor-dev@ https://lists.torproject.org/pipermail/tor-dev/2016-January/010126.html

    The src/test/test_util.c have this statement:
    
    #ifdef _WIN32
    #define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
    #define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f))
    #define UTIL_LEGACY_NO_WIN(n) UTIL_NO_WIN(n)
    
    But I fail to see where 'UTIL_NO_WIN(n)' is defined. Should not the
    above read:
    
    --- a/test/test_util.c 2016-01-05 13:19:07
    +++ b/test/test_util.c 2016-01-05 14:36:52
    @@ -4676,7 +4676,7 @@
    #ifdef _WIN32
    #define UTIL_TEST_NO_WIN(n, f) { #n, NULL, TT_SKIP, NULL, NULL }
    #define UTIL_TEST_WIN_ONLY(n, f) UTIL_TEST(n, (f))
    -#define UTIL_LEGACY_NO_WIN(n) UTIL_NO_WIN(n)
    +#define UTIL_LEGACY_NO_WIN(n)   { #n, NULL, TT_SKIP, NULL, NULL }
    #else
    #define UTIL_TEST_NO_WIN(n, f) UTIL_TEST(n, (f))
    
    With this, my test.exe runs fine. Although 36 SKIPPED tests.
    
    Another thing regarding MSVC. In test/test_checkdir.c,
    <dirent.h> is included for _WIN32. MSVC does not have this header.
    Hence I think this patch is needed:
    
    --- a/test/test_checkdir.c 2015-08-31 13:24:33
    +++ b/test/test_checkdir.c 2015-08-31 14:50:53
    @@ -4,9 +4,7 @@
    #include "orconfig.h"
    #include "or.h"
    
    -#ifdef _WIN32
    -#include <direct.h>
    -#else
    +#ifndef _MSC_VER
    #include <dirent.h>
    #endif
    
    Since <direct.h> is already included in "or.h", it's not needed here
    too.

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading