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
@@ -1,3 +1,3 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env.Program('simple', Dir['*.c'])
|
||||
env.Program('simple.exe', Dir['*.c'])
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env["LIBS"] += ["c"]
|
||||
env.Program('simple.exe', Dir['*.c'])
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env.Copy("simple.copy", "simple.c")
|
||||
end
|
||||
@@ -0,0 +1,6 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env.Object("simple.o", "simple.c")
|
||||
env.process
|
||||
env["LDCMD"] = %w[gcc -o ${_TARGET} simple.o]
|
||||
env.Program('simple.exe', [])
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env.Object("simple.o", "simple.c")
|
||||
env["LDCMD"] = %w[gcc -o ${_TARGET} simple.o]
|
||||
env.Program('simple.exe', ["simple.o"])
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env.Program("simple.exe", "simple.c")
|
||||
user_deps = File.read("user_deps", mode: "rb").split(" ")
|
||||
env.depends("simple.exe", *user_deps)
|
||||
end
|
||||
@@ -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