From 348bb9ddf2557e260134a8360489c88cd5434c0d Mon Sep 17 00:00:00 2001 From: Igor Mironchik Date: Fri, 14 Jul 2017 14:09:59 +0300 Subject: [PATCH] Added runtests.rb --- CMakeLists.txt | 3 +++ runtests.rb | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 runtests.rb diff --git a/CMakeLists.txt b/CMakeLists.txt index a7c130e7..2b5b379d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,9 @@ SET( CMAKE_CXX_STANDARD 14 ) SET( CMAKE_CXX_STANDARD_REQUIRED ON ) +file( COPY runtests.rb + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} ) + project( Args ) add_subdirectory( samples ) diff --git a/runtests.rb b/runtests.rb new file mode 100644 index 00000000..5646bed7 --- /dev/null +++ b/runtests.rb @@ -0,0 +1,28 @@ + +def find_tests( path ) + tests = Array.new + + Dir.foreach( path ) { |name| + full = File.expand_path( name, path ) + + if name != "." && name != ".." + if File.directory?( full ) + tests.push( *find_tests( full ) ) + elsif File.executable?( full ) + tests.push( full ) + end + end + } + + return tests +end + +tests = find_tests( "tests" ) + +tests.each { |t| + Dir.chdir( File.dirname( t ) ) { + if !system( t ) + break + end + } +}