Final tidies, comments etc.

This commit is contained in:
Patrick J Cherry
2018-02-09 11:42:25 +00:00
parent 195de41d86
commit 9817fd7b0a
2 changed files with 18 additions and 6 deletions

View File

@@ -1,7 +1,11 @@
require 'tempfile'
# LdPreload is a little wrapper for using LD_PRELOAD when testing flexnbd
#
# LdPreload is a little wrapper for using LD_PRELOAD loggers to pick up system
# calls when testing flexnbd.
#
module LdPreload
#
# This takes an object name, sets up a temporary log file, whose name is
# recorded in the environment as OUTPUT_obj_name, where obj_name is the
# name of the preload module to build and load.
@@ -34,6 +38,10 @@ module LdPreload
lines
end
#
# The next to methods assume the log file has one entry per line, and that
# each entry is a series of values separated by colons.
#
def parse_ld_preload_logs(obj_name)
read_ld_preload_log(obj_name).map do |l|
l.split(':').map { |i| i =~ /^\d+$/ ? i.to_i : i }