Skip to content

Commit

Permalink
Added runtests.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
igormironchik committed Jul 14, 2017
1 parent 3c8e328 commit 348bb9d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
28 changes: 28 additions & 0 deletions runtests.rb
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 348bb9d

Please sign in to comment.