Skip to content

Commit 4b7ba76

Browse files
committed
Improve launcher specs for actually running
1 parent c9a9d58 commit 4b7ba76

File tree

2 files changed

+51
-12
lines changed

2 files changed

+51
-12
lines changed

spec/tags/truffle/launcher_tags.txt

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,46 @@ slow:The launcher ignores --jit option with a warning
6262
slow:The launcher ignores --jit-... options with a warning and a hint to look at Graal options
6363
slow:The launcher ignores --jit... options with a warning and a hint to look at Graal documentation
6464
slow:The launcher warns on ignored options
65-
fails:The launcher 'gem' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
66-
fails:The launcher 'gem' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
67-
fails:The launcher 'gem' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
68-
fails:The launcher 'irb' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
69-
fails:The launcher 'irb' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
70-
fails:The launcher 'irb' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
71-
fails:The launcher 'rdoc' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
72-
fails:The launcher 'rdoc' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
73-
fails:The launcher 'rdoc' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
74-
fails:The launcher 'ri' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
75-
fails:The launcher 'ri' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
76-
fails:The launcher 'ri' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
7765
slow:The launcher 'bundle' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
7866
slow:The launcher 'bundle' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
7967
slow:The launcher 'bundle' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
8068
slow:The launcher 'bundler' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
8169
slow:The launcher 'bundler' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
8270
slow:The launcher 'bundler' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
71+
fails:The launcher 'rdoc' in `RbConfig::CONFIG['bindir']` directory runs
72+
fails:The launcher 'rdoc' in `RbConfig::CONFIG['bindir']` directory runs when symlinked
73+
fails:The launcher 'rdoc' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
74+
fails:The launcher 'rdoc' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs when symlinked
75+
fails:The launcher 'rdoc' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
76+
fails:The launcher 'rdoc' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs when symlinked
77+
slow:The launcher 'bundle' in `RbConfig::CONFIG['bindir']` directory runs
78+
slow:The launcher 'bundle' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
79+
slow:The launcher 'bundle' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
80+
slow:The launcher 'bundler' in `RbConfig::CONFIG['bindir']` directory runs
81+
slow:The launcher 'bundler' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
82+
slow:The launcher 'bundler' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
83+
slow:The launcher 'gem' in `RbConfig::CONFIG['bindir']` directory runs
84+
slow:The launcher 'gem' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
85+
slow:The launcher 'gem' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
86+
slow:The launcher 'irb' in `RbConfig::CONFIG['bindir']` directory runs
87+
slow:The launcher 'irb' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
88+
slow:The launcher 'irb' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
89+
slow:The launcher 'rake' in `RbConfig::CONFIG['bindir']` directory runs
90+
slow:The launcher 'rake' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
91+
slow:The launcher 'rake' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
92+
slow:The launcher 'ri' in `RbConfig::CONFIG['bindir']` directory runs
93+
slow:The launcher 'ri' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
94+
slow:The launcher 'ri' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
95+
slow:The launcher 'ruby' in `RbConfig::CONFIG['bindir']` directory runs
96+
slow:The launcher 'ruby' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
97+
slow:The launcher 'ruby' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
98+
slow:The launcher 'truffleruby' in `RbConfig::CONFIG['bindir']` directory runs
99+
slow:The launcher 'truffleruby' in `RbConfig::CONFIG['extra_bindirs'][0]` directory runs
100+
slow:The launcher 'truffleruby' in `RbConfig::CONFIG['extra_bindirs'][1]` directory runs
101+
fails:The launcher 'rdoc' runs as an -S command
102+
slow:The launcher 'bundle' runs as an -S command
103+
slow:The launcher 'bundler' runs as an -S command
104+
slow:The launcher 'gem' runs as an -S command
105+
slow:The launcher 'irb' runs as an -S command
106+
slow:The launcher 'rake' runs as an -S command
107+
slow:The launcher 'ri' runs as an -S command

spec/truffle/launcher_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,27 @@ def graalvm_bash_launcher?
3333
truffleruby: /truffleruby .* like ruby 2\.6\.1/ }
3434

3535
launchers.each do |launcher, (test, skip_success)|
36+
unless [:ruby, :truffleruby].include?(launcher)
37+
it "'#{launcher}' runs as an -S command" do
38+
out = ruby_exe(nil, options: "-S#{launcher} --version 2>&1")
39+
out.should =~ test
40+
$?.success?.should == true unless skip_success
41+
end
42+
end
43+
3644
extra_bin_dirs_described = RbConfig::CONFIG['extra_bindirs'].
3745
split(File::PATH_SEPARATOR).
3846
each_with_index.
3947
reduce({}) { |h, (dir, i)| h.update "RbConfig::CONFIG['extra_bindirs'][#{i}]" => dir }
4048
bin_dirs = { "RbConfig::CONFIG['bindir']" => RbConfig::CONFIG['bindir'] }.merge extra_bin_dirs_described
4149

4250
bin_dirs.each do |name, bin_dir|
51+
it "'#{launcher}' in `#{name}` directory runs" do
52+
out = `#{bin_dir}/#{launcher} --version 2>&1`
53+
out.should =~ test
54+
$?.success?.should == true unless skip_success
55+
end
56+
4357
it "'#{launcher}' in `#{name}` directory runs when symlinked" do
4458
require "tmpdir"
4559
# Use the system tmp dir to not be under the Ruby home dir

0 commit comments

Comments
 (0)