Create rspec test structure for build tests

This commit is contained in:
Josh Holtrop 2013-06-16 17:57:45 -04:00
parent 07579fea35
commit 22e332e1fe
5 changed files with 23 additions and 0 deletions

2
.rspec Normal file
View File

@ -0,0 +1,2 @@
--color
--require spec_helper

View File

@ -1 +1,6 @@
require "bundler/gem_tasks" require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec

View File

@ -0,0 +1,2 @@
it 'builds a C program with one source file' do
end

13
spec/build_tests_spec.rb Normal file
View File

@ -0,0 +1,13 @@
require 'fileutils'
describe Rscons do
FileUtils.rm_rf('build_tests/test')
test_dirs = Dir['build_tests/*/']
test_dirs.each do |build_test_rel_path|
FileUtils.cp_r(build_test_rel_path, 'build_tests/test')
Dir.chdir('build_tests/test') do
instance_eval(File.read('spec.rb'))
end
FileUtils.rm_rf('build_tests/test')
end
end

1
spec/spec_helper.rb Normal file
View File

@ -0,0 +1 @@
require "rscons"