THP: Allow a single site to be specified on the cli

The normal mode for running THP is to run though all the tests for all sites:

./TestHandsPlayers.py

This is a bit noisy and slow when trying to fix issues in a single parser.

Added '-s' so that you can run the regression tests against a single site

eg.
./TestHandsPlayers.py -s "Full Tilt Poker"
./TestHandsPlayers.py -s PokerStars
./TestHandsPlayers.py -s Winamax
This commit is contained in:
Worros 2010-12-10 18:21:21 +08:00
parent 3db9cfa6a7
commit 9a956e41b6

View File

@ -28,6 +28,7 @@ import Configuration
import Database
import SQL
import fpdb_import
import Options
class FpdbError:
@ -121,6 +122,19 @@ def main(argv=None):
if argv is None:
argv = sys.argv[1:]
(options, argv) = Options.fpdb_options()
test_all_sites = True
if options.usage == True:
#Print usage examples and exit
print "USAGE:"
sys.exit(0)
if options.sitename:
print "Only regression testing '%s' files" % (options.sitename)
test_all_sites = False
config = Configuration.Config(file = "HUD_config.test.xml")
db = Database.Database(config)
sql = SQL.Sql(db_server = 'sqlite')
@ -159,21 +173,27 @@ def main(argv=None):
]
sites = {
'PokerStars' : True,
'Full Tilt Poker' : True,
'PartyPoker' : True,
'Betfair' : True,
'OnGame' : True,
'Absolute' : True,
'UltimateBet' : True,
'Everleaf' : True,
'Carbon' : True,
'PKR' : False,
'iPoker' : True,
'Win2day' : True,
'Winamax' : True,
'PokerStars' : False,
'Full Tilt Poker' : False,
'PartyPoker' : False,
'Betfair' : False,
'OnGame' : False,
'Absolute' : False,
'UltimateBet' : False,
'Everleaf' : False,
'Carbon' : False,
#'PKR' : False,
'iPoker' : False,
'Win2day' : False,
'Winamax' : False,
}
if test_all_sites == True:
for s in sites:
sites[s] = True
else:
sites[options.sitename] = True
if sites['PokerStars'] == True:
walk_testfiles("regression-test-files/cash/Stars/", compare, importer, PokerStarsErrors, "PokerStars")
walk_testfiles("regression-test-files/tour/Stars/", compare, importer, PokerStarsErrors, "PokerStars")
@ -195,8 +215,8 @@ def main(argv=None):
walk_testfiles("regression-test-files/cash/Everleaf/", compare, importer, EverleafErrors, "Everleaf")
if sites['Carbon'] == True:
walk_testfiles("regression-test-files/cash/Carbon/", compare, importer, CarbonErrors, "Carbon")
if sites['PKR'] == True:
walk_testfiles("regression-test-files/cash/PKR/", compare, importer, PKRErrors, "PKR")
#if sites['PKR'] == True:
# walk_testfiles("regression-test-files/cash/PKR/", compare, importer, PKRErrors, "PKR")
if sites['iPoker'] == True:
walk_testfiles("regression-test-files/cash/iPoker/", compare, importer, iPokerErrors, "iPoker")
if sites['Winamax'] == True: