class Inspec::Profile

def collect_tests

def collect_tests
  unless @tests_collected || failed?
    return unless supports_platform?
    locked_dependencies.each(&:collect_tests)
    tests = filter_waived_controls
    # Collect tests
    tests.each do |path, content|
      next if content.nil? || content.empty?
      abs_path = source_reader.target.abs_path(path)
      begin
        @runner_context.load_control_file(content, abs_path, nil)
      rescue => e
        @state = :failed
        raise Inspec::Exceptions::ProfileLoadFailed, "Failed to load source for #{path}: #{e}"
      end
    end
    @tests_collected = true
  end
  @runner_context.all_rules
end