403Webshell
Server IP : 66.29.132.122  /  Your IP : 18.117.192.120
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/dev/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/cpanel/ea-ruby27/src/passenger-release-6.0.23/dev/list_tests
#!/usr/bin/env ruby
#
# Usage: ./dev/list_tests.rb <FILENAME>
#
# Lists the test names in the given .cpp test file.

require_relative '../src/ruby_supportlib/phusion_passenger/utils/ansi_colors'

include PhusionPassenger::Utils::AnsiColors

def extract_category_name(occurrence)
  occurrence =~ / (.+) /
  return $1
end

def extract_test_name(occurrence)
  occurrence = occurrence.sub(/.*?\((.+)\).*/m, '\1')
  occurrence.gsub!(/"\n[ \t]*"/m, '')
  occurrence.sub!(/\A"/, '')
  occurrence.sub!(/"\Z/, '')
  return occurrence
end

def start(filename)
  STDOUT.write(DEFAULT_TERMINAL_COLOR)
  begin
    occurrences = File.read(filename).scan(%r{/\*\*\*\*\* .+? \*\*\*\*\*/|set_test_name\(.+?\);}m)
    occurrences.each do |occurrence|
      if occurrence =~ %r{\A/}
        puts ansi_colorize("<b>" + extract_category_name(occurrence) + "</b>")
      else
        puts "  " + extract_test_name(occurrence)
      end
    end
  ensure
    STDOUT.write(RESET)
  end
end

start(ARGV[0])

Youez - 2016 - github.com/yon3zu
LinuXploit