Add build_dir script method - close #155
This commit is contained in:
parent
8269a98d01
commit
e9e3c6711f
3
build_tests/typical/build_dir.rb
Normal file
3
build_tests/typical/build_dir.rb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
default do
|
||||||
|
touch "#{build_dir}/a.file"
|
||||||
|
end
|
@ -10,6 +10,14 @@ module Rscons
|
|||||||
@script = script
|
@script = script
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Get the Rscons build directory path.
|
||||||
|
#
|
||||||
|
# @return [String]
|
||||||
|
# Rscons build directory path.
|
||||||
|
def build_dir
|
||||||
|
Rscons.application.build_dir
|
||||||
|
end
|
||||||
|
|
||||||
# Return a list of paths matching the specified pattern(s).
|
# Return a list of paths matching the specified pattern(s).
|
||||||
#
|
#
|
||||||
# A pattern can contain a "/**" component to recurse through directories.
|
# A pattern can contain a "/**" component to recurse through directories.
|
||||||
|
@ -3187,4 +3187,22 @@ EOF
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "build_dir method" do
|
||||||
|
it "returns the top-level build directory path 1" do
|
||||||
|
test_dir "typical"
|
||||||
|
result = run_rscons(args: %w[-f build_dir.rb])
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
|
expect(result.status).to eq 0
|
||||||
|
expect(File.exist?("build/a.file")).to be_truthy
|
||||||
|
end
|
||||||
|
|
||||||
|
it "returns the top-level build directory path 2" do
|
||||||
|
test_dir "typical"
|
||||||
|
result = run_rscons(args: %w[-f build_dir.rb -b bb])
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
|
expect(result.status).to eq 0
|
||||||
|
expect(File.exist?("bb/a.file")).to be_truthy
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user