migrate some Cache tests to integration tests
This commit is contained in:
1 parent
bfbbc19728
commit
06cb4b7a55
9 files changed
+213
-190
No files matched your search
@@ -0,0 +1,19 @@
|
||||
class StrictBuilder < Rscons::Builder
|
||||
def run(options)
|
||||
target, sources, cache, env = options.values_at(:target, :sources, :cache, :env)
|
||||
command = %W[gcc -o #{target}] + sources.sort
|
||||
unless cache.up_to_date?(target, command, sources, env, strict_deps: true)
|
||||
return false unless env.execute("StrictBuilder #{target}", command)
|
||||
cache.register_build(target, command, sources, env)
|
||||
end
|
||||
target
|
||||
end
|
||||
end
|
||||
|
||||
Rscons::Environment.new(echo: :command) do |env|
|
||||
env.add_builder(StrictBuilder.new)
|
||||
env.Object("one.o", "one.c", "CCFLAGS" => %w[-DONE])
|
||||
env.Object("two.o", "two.c")
|
||||
sources = File.read("sources", mode: "rb").split(" ")
|
||||
env.StrictBuilder("program.exe", sources)
|
||||
end
|
||||
Reference in new issue
Block a user