test/readline - allow ENV control of test class creation

In ruby/ruby, the tests run on both readline & reline by creating four test classes:
```
TestReadline
TestReadlineHistory

TestRelineAsReadline
TestRelineAsReadlineHistory
```

Reline inports the test files and uses them in its CI.  Adding the ENV control allows it to only run the `TestRelineAsReadline` classes.
This commit is contained in:
MSP-Greg 2020-02-19 08:11:32 -06:00 committed by aycabta
parent d7984d0f54
commit da31035687
Notes: git 2020-02-22 10:01:32 +09:00
2 changed files with 4 additions and 3 deletions

View File

@ -784,7 +784,7 @@ class TestReadline < Test::Unit::TestCase
use_ext_readline
super
end
end if defined?(ReadlineSo)
end if defined?(ReadlineSo) && ENV["TEST_READLINE_OR_RELINE"] != "Reline"
class TestRelineAsReadline < Test::Unit::TestCase
include BasetestReadline
@ -801,4 +801,4 @@ class TestRelineAsReadline < Test::Unit::TestCase
super
end
end
end if defined?(Reline)
end if defined?(Reline) && ENV["TEST_READLINE_OR_RELINE"] != "Readline"

View File

@ -260,6 +260,7 @@ class TestReadlineHistory < Test::Unit::TestCase
super
end
end if defined?(::ReadlineSo) && defined?(::ReadlineSo::HISTORY) &&
ENV["TEST_READLINE_OR_RELINE"] != "Reline" &&
(
begin
ReadlineSo::HISTORY.clear
@ -283,4 +284,4 @@ class TestRelineAsReadlineHistory < Test::Unit::TestCase
super
end
end
end if defined?(Reline)
end if defined?(Reline) && ENV["TEST_READLINE_OR_RELINE"] != "Readline"