[前][次][番号順一覧][スレッド一覧]

ruby-changes:70976

From: Yuta <ko1@a...>
Date: Wed, 19 Jan 2022 11:19:47 +0900 (JST)
Subject: [ruby-changes:70976] dd99ee1f7d (master): [wasm] bootstraptest, basictest: disable backquote literal tests

https://git.ruby-lang.org/ruby.git/commit/?id=dd99ee1f7d

From dd99ee1f7d366e6b92b952fb96221bf0ea3dc348 Mon Sep 17 00:00:00 2001
From: Yuta Saito <kateinoigakukun@g...>
Date: Sat, 15 Jan 2022 22:11:55 +0900
Subject: [wasm] bootstraptest, basictest: disable backquote literal tests

WASI doesn't support spawning a new process for now.
---
 basictest/test.rb             | 3 +++
 bootstraptest/runner.rb       | 8 ++++++++
 bootstraptest/test_literal.rb | 7 +++++--
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/basictest/test.rb b/basictest/test.rb
index 52008b78db4..95875b52a6e 100755
--- a/basictest/test.rb
+++ b/basictest/test.rb
@@ -1960,6 +1960,8 @@ test_ok(p1.call == 5) https://github.com/ruby/ruby/blob/trunk/basictest/test.rb#L1960
 test_ok(i7 == nil)
 end
 
+# WASI doesn't support spawning a new process for now.
+unless /wasi/ =~ RUBY_PLATFORM
 test_check "system"
 test_ok(`echo foobar` == "foobar\n")
 test_ok(`./miniruby -e 'print "foobar"'` == 'foobar')
@@ -2010,6 +2012,7 @@ test_ok(done) https://github.com/ruby/ruby/blob/trunk/basictest/test.rb#L2012
 
 File.unlink script_tmp or `/bin/rm -f "#{script_tmp}"`
 File.unlink "#{script_tmp}.bak" or `/bin/rm -f "#{script_tmp}.bak"`
+end # not /wasi/ =~ RUBY_PLATFORM
 
 test_check "const"
 TEST1 = 1
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 2cd91ffd07b..b155db18aa7 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -271,6 +271,14 @@ ensure https://github.com/ruby/ruby/blob/trunk/bootstraptest/runner.rb#L271
   end
 end
 
+def target_platform
+  if @ruby
+    `#{@ruby} --disable-gems -e 'print RUBY_PLATFORM'`
+  else
+    RUBY_PLATFORM
+  end
+end
+
 def show_limit(testsrc, opt = '', **argh)
   result = get_result_string(testsrc, opt, **argh)
   if @tty and @verbose
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index 9b3c10d519c..a0d4ee08c6b 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -65,8 +65,11 @@ assert_equal ':a3c',            ':"a#{1+2}c".inspect' https://github.com/ruby/ruby/blob/trunk/bootstraptest/test_literal.rb#L65
 assert_equal 'Symbol',          ':"a#{1+2}c".class'
 
 # xstring
-assert_equal "foo\n",           %q(`echo foo`)
-assert_equal "foo\n",           %q(s = "foo"; `echo #{s}`)
+# WASI doesn't support spawning a new process for now.
+if /wasi/ !~ target_platform
+  assert_equal "foo\n",           %q(`echo foo`)
+  assert_equal "foo\n",           %q(s = "foo"; `echo #{s}`)
+end
 
 # regexp
 assert_equal '',                '//.source'
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]