File tree Expand file tree Collapse file tree 4 files changed +14
-66
lines changed Expand file tree Collapse file tree 4 files changed +14
-66
lines changed Original file line number Diff line number Diff line change 57
57
cabal sdist -z -o .
58
58
cabal get unix-*.tar.gz
59
59
cd unix-*/
60
- cabal test all --test-show-details=direct
60
+ cabal test -f+non-portable-tests all --test-show-details=direct
61
61
- name : Haddock
62
62
run : |
63
63
cabal haddock --disable-documentation
85
85
cabal update
86
86
autoreconf --version
87
87
autoreconf -i
88
- cabal test all --test-show-details=direct
88
+ cabal test -f+non-portable-tests all --test-show-details=direct
89
89
90
90
fedora37 :
91
91
runs-on : ubuntu-latest
@@ -110,7 +110,7 @@ jobs:
110
110
autoreconf --version
111
111
autoreconf -i
112
112
# test filepath >= 1.5
113
- cabal test --constraint='filepath >= 1.5.0.0' all --test-show-details=direct
113
+ cabal test -f+non-portable-tests - -constraint='filepath >= 1.5.0.0' all --test-show-details=direct
114
114
115
115
i386 :
116
116
runs-on : ubuntu-latest
@@ -182,5 +182,5 @@ jobs:
182
182
cabal sdist -z -o .
183
183
cabal get unix-*.tar.gz
184
184
cd unix-*/
185
- cabal test all --test-show-details=direct
185
+ cabal test -f+non-portable-tests all --test-show-details=direct
186
186
Original file line number Diff line number Diff line change @@ -65,66 +65,6 @@ FP_CHECK_CONST([DT_WHT], [
65
65
#include <dirent.h>
66
66
#endif] , [ -9] )
67
67
68
- AC_LANG ( C )
69
- AC_MSG_CHECKING ( whether kernel returns a useful d_type )
70
- AC_RUN_IFELSE (
71
- [ AC_LANG_SOURCE ( [ [
72
- #if HAVE_STRUCT_DIRENT_D_TYPE
73
- #include <dirent.h>
74
- #include <errno.h>
75
- #include <stdio.h>
76
- #include <stdlib.h>
77
- #include <string.h>
78
- #include <sys/types.h>
79
-
80
- void check_error(const char *msg) {
81
- if (errno) {
82
- perror(msg);
83
- exit(1);
84
- }
85
- }
86
-
87
- int main() {
88
- DIR *dir = opendir(".");
89
- check_error("opendir");
90
-
91
- struct dirent *de = NULL;
92
-
93
- do {
94
- de = readdir(dir);
95
- check_error("readdir");
96
- } while (de && strcmp(de->d_name, ".") != 0);
97
- // We found the . dir or encountered end of dir stream
98
-
99
- int status = 0;
100
-
101
- if (!de) {
102
- status = 1;
103
- } else if (de->d_type == DT_DIR) {
104
- } else if (de->d_type == DT_UNKNOWN) {
105
- // Signal that we should skip test for non-zero d_type
106
- status = 2;
107
- } else {
108
- status = 1;
109
- }
110
-
111
- closedir(dir);
112
- check_error("closedir");
113
-
114
- exit(status);
115
- }
116
- #else
117
- int main() { exit(2); }
118
- #endif
119
- ] ] ) ] ,
120
- [ AC_MSG_RESULT ( yes ) ] ,
121
- [ if test $? -eq 1 ; then
122
- AC_MSG_FAILURE ( Unexpected failure when testing for kernels d_type )
123
- else
124
- AC_MSG_RESULT ( no ( skipping DirEnt test ))
125
- AC_DEFINE ( [ NO_DTIR_TEST] , [ 1] , [ Define to 1 if we want to stkip DirEnt test.] )
126
- fi] )
127
-
128
68
AC_CHECK_FUNCS ( [ getgrgid_r getgrnam_r getpwnam_r getpwuid_r getpwnam getpwuid] )
129
69
AC_CHECK_FUNCS ( [ getpwent getgrent] )
130
70
AC_CHECK_FUNCS ( [ lchown setenv sysconf unsetenv clearenv] )
Original file line number Diff line number Diff line change 3
3
#include "HsUnixConfig.h"
4
4
5
5
module Main (main ) where
6
- #if defined(NO_DTIR_TEST )
6
+ #if ! defined(HAVE_STRUCT_DIRENT_D_TYPE )
7
7
main :: IO ()
8
8
main = do
9
- putStrLn " Skipping DirEnt test, since kernel seems to always return DT_UNKNOWN "
9
+ putStrLn " Skipping DirEnt test, since the system doesn't support d_type "
10
10
#else
11
11
12
12
import Control.Exception (bracket , finally )
Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ flag os-string
53
53
default : False
54
54
manual : False
55
55
56
+ flag non-portable-tests
57
+ description : Run tests that may not be portable across all systems, but are guaranteed to succeed in our own CI
58
+ default : False
59
+ manual : True
60
+
56
61
source-repository head
57
62
type : git
58
63
location : https://github.com/haskell/unix.git
@@ -390,4 +395,7 @@ test-suite DirEnt
390
395
default-language : Haskell2010
391
396
build-depends : base, unix
392
397
ghc-options : -Wall
398
+ if !flag(non-portable-tests)
399
+ build-depends : unbuildable< 0
400
+ buildable : False
393
401
You can’t perform that action at this time.
0 commit comments