add integration test for Environment#build_sources

This commit is contained in:
josh committed 2017-05-23 16:28:13 -04:00
1 parent e58b8bd109
commit adcee373df
2 files changed
+24

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
class MyProgram < Rscons::Builder
def run(options)
target, sources, cache, env, vars = options.values_at(:target, :sources, :cache, :env, :vars)
objects = env.build_sources(sources, [".o"], cache, vars)
command = %W[gcc -o #{target}] + objects
return false unless env.execute("#{name} #{target}", command)
target
end
end
Rscons::Environment.new do |env|
env.add_builder(MyProgram.new)
env.MyProgram("simple.exe", "simple.c")
end