Split single unit test directory into multiple ones

The goal is to enable testing of application specific files, e.g. for
mkvpropedit.
This commit is contained in:
Moritz Bunkus 2012-08-13 20:41:35 +02:00
parent 315d84d3de
commit 6a2698f5ec
5 changed files with 26 additions and 10 deletions

2
.gitignore vendored
View File

@ -57,7 +57,7 @@
/src/tools/ebml_validator
/src/tools/vc1parser
/tests/data
/tests/unit/all
/tests/unit/common/common
BROWSE
Makefile
TAGS

View File

@ -1,9 +1,14 @@
#!/usr/bin/env ruby
gtest_apps = %w{common}
gtest_libs = {
'common' => [],
}
namespace :tests do
desc "Build and run the unit tests"
task :unit => [ 'tests/unit/all' ] do
run './tests/unit/all'
task :unit => gtest_apps.collect { |app| "tests/unit/#{app}/#{app}" } do
gtest_apps.each { |app| run "./tests/unit/#{app}/#{app}" }
end
end
@ -22,12 +27,14 @@ $build_system_modules[:gtest] = {
sources([ 'lib/gtest/src' ], :type => :dir).
create
Application.
new('tests/unit/all').
description("Build the unit tests executable").
aliases('unit_tests').
sources([ 'tests/unit' ], :type => :dir).
libraries($common_libs, :gtest, :pthread).
create
gtest_apps.each do |app|
Application.
new("tests/unit/#{app}/#{app}").
description("Build the unit tests executable for '#{app}'").
aliases("unit_tests_#{app}").
sources([ "tests/unit/#{app}" ], :type => :dir).
libraries($common_libs, gtest_libs[app], :gtest, :pthread).
create
end
end,
}

View File

@ -0,0 +1,9 @@
#!/usr/bin/env ruby
$build_unit_tests = true
import ['..', '../..', '../../..'].collect { |subdir| FileList[File.dirname(__FILE__) + "/#{subdir}/build-config.in"].to_a }.flatten.compact.first.gsub(/build-config.in/, 'Rakefile')
# Local Variables:
# mode: ruby
# End: