webengine/osswebengine/WebKitTools/iExploder/tools/showtest.rb
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 #!/usr/bin/ruby
       
     2 # showtest.rb - simple CLI interface to grab a testcase
       
     3 #####################
       
     4 #
       
     5 # Copyright (c) 2006 Thomas Stromberg <thomas%stromberg.org>
       
     6 # 
       
     7 # This software is provided 'as-is', without any express or implied warranty.
       
     8 # In no event will the authors be held liable for any damages arising from the
       
     9 # use of this software.
       
    10 # 
       
    11 # Permission is granted to anyone to use this software for any purpose,
       
    12 # including commercial applications, and to alter it and redistribute it
       
    13 # freely, subject to the following restrictions:
       
    14 # 
       
    15 # 1. The origin of this software must not be misrepresented; you must not
       
    16 # claim that you wrote the original software. If you use this software in a
       
    17 # product, an acknowledgment in the product documentation would be appreciated
       
    18 # but is not required.
       
    19 # 
       
    20 # 2. Altered source versions must be plainly marked as such, and must not be
       
    21 # misrepresented as being the original software.
       
    22 # 
       
    23 # 3. This notice may not be removed or altered from any source distribution.
       
    24 
       
    25 Dir.chdir('../htdocs')
       
    26 require 'iexploder';
       
    27 require 'config';
       
    28 
       
    29 ### THE INTERACTION ##################################
       
    30 ie = IExploder.new($HTML_MAX_TAGS, $HTML_MAX_ATTRS, $CSS_MAX_PROPS)
       
    31 ie.readTagFiles()
       
    32 
       
    33 if ! ARGV[0]
       
    34   puts "syntax: showtest.rb [test#] [subtest#]"
       
    35   exit
       
    36 end
       
    37 
       
    38 ie.test_num = ARGV[0].to_i
       
    39 ie.subtest_num = ARGV[1].to_i || 0
       
    40 ie.lookup_mode = 1
       
    41 ie.setRandomSeed
       
    42 
       
    43 puts ie.buildPage()