Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf52c3fc6f | ||
|
|
5378afb6f8 |
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
build do
|
||||||
|
Environment.new do |env|
|
||||||
|
env.Program("program.exe", "program.c")
|
||||||
|
env.Install("install/program.exe", "program.exe")
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
sleep(2);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -57,6 +57,7 @@ module Rscons
|
|||||||
printed_message = true
|
printed_message = true
|
||||||
end
|
end
|
||||||
@cache.mkdir_p(File.dirname(dest), install: @install_builder)
|
@cache.mkdir_p(File.dirname(dest), install: @install_builder)
|
||||||
|
FileUtils.rm_f(dest)
|
||||||
FileUtils.cp(src, dest, :preserve => true)
|
FileUtils.cp(src, dest, :preserve => true)
|
||||||
end
|
end
|
||||||
@cache.register_build(dest, :Copy, [src], @env, install: @install_builder)
|
@cache.register_build(dest, :Copy, [src], @env, install: @install_builder)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module Rscons
|
module Rscons
|
||||||
# Project version.
|
# Project version.
|
||||||
VERSION = "2.0.0"
|
VERSION = "2.0.1"
|
||||||
end
|
end
|
||||||
@@ -337,6 +337,20 @@ EOF
|
|||||||
expect(result.stderr).to match /Could not find a registered build target "foo"/
|
expect(result.stderr).to match /Could not find a registered build target "foo"/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows replacing a running executable when performing an 'install' operation" do
|
||||||
|
test_dir("install_running_exe")
|
||||||
|
result = run_rscons(op: "install")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
|
fcontents = File.read("program.c", mode: "rb")
|
||||||
|
File.open("program.c", "wb") do |fh|
|
||||||
|
fh.write(fcontents.sub(/2/, '3'))
|
||||||
|
end
|
||||||
|
pid = Process.spawn("install/program.exe")
|
||||||
|
result = run_rscons(op: "install")
|
||||||
|
expect(result.stderr).to eq ""
|
||||||
|
Process.wait(pid)
|
||||||
|
end
|
||||||
|
|
||||||
context "clean operation" do
|
context "clean operation" do
|
||||||
it 'cleans built files' do
|
it 'cleans built files' do
|
||||||
test_dir("simple")
|
test_dir("simple")
|
||||||
|
|||||||
Reference in new issue
Block a user