mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Skip socket tests on Windows platform.
Some test may be OK but we skip everything as a starting point.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
unless SocketTest.win?
|
||||
|
||||
# Note: most of tests below will fail if UDPSocket is broken.
|
||||
|
||||
assert('IPSocket.getaddress') do
|
||||
@@ -38,3 +40,5 @@ assert('IPSocket.peeraddr') do
|
||||
server.close
|
||||
true
|
||||
end
|
||||
|
||||
end # win?
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
unless SocketTest.win?
|
||||
|
||||
assert('Socket.gethostname') do
|
||||
assert_true(Socket.gethostname.is_a? String)
|
||||
end
|
||||
@@ -32,3 +34,5 @@ assert('Socket#recvfrom') do
|
||||
c.close rescue nil
|
||||
end
|
||||
end
|
||||
|
||||
end # win?
|
||||
|
||||
@@ -12,9 +12,20 @@ mrb_sockettest_tmppath(mrb_state *mrb, mrb_value klass)
|
||||
return str;
|
||||
}
|
||||
|
||||
mrb_value
|
||||
mrb_sockettest_win_p(mrb_state *mrb, mrb_value klass)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return mrb_true_value();
|
||||
#else
|
||||
return mrb_false_value();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
mrb_mruby_socket_gem_test(mrb_state* mrb)
|
||||
{
|
||||
struct RClass *c = mrb_define_module(mrb, "SocketTest");
|
||||
mrb_define_class_method(mrb, c, "tmppath", mrb_sockettest_tmppath, MRB_ARGS_NONE());
|
||||
mrb_define_class_method(mrb, c, "win?", mrb_sockettest_win_p, MRB_ARGS_NONE());
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
unless SocketTest.win?
|
||||
|
||||
def unixserver_test_block
|
||||
path = SocketTest.tmppath
|
||||
File.unlink path rescue nil
|
||||
@@ -124,3 +126,5 @@ assert('UNIXSocket#recvfrom') do
|
||||
# a[1][1] would be "" or something
|
||||
end
|
||||
end
|
||||
|
||||
end # win?
|
||||
|
||||
Reference in New Issue
Block a user