Skip to content

Commit

Permalink
[wasm] bootstraptest, basictest: disable backquote literal tests
Browse files Browse the repository at this point in the history
WASI doesn't support spawning a new process for now.
  • Loading branch information
kateinoigakukun committed Jan 19, 2022
1 parent df31fa4 commit dd99ee1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions basictest/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,8 @@ module EvTest
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')
Expand Down Expand Up @@ -2010,6 +2012,7 @@ module EvTest

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
Expand Down
8 changes: 8 additions & 0 deletions bootstraptest/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ def show_progress(message = '')
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
Expand Down
7 changes: 5 additions & 2 deletions bootstraptest/test_literal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@
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'
Expand Down

0 comments on commit dd99ee1

Please sign in to comment.