#!/usr/bin/python

__author__ = 'Elisabetta Ronchieri'

import sys
import unittest
import getopt

from tstorm.utils import stress_file
from tstorm.utils import report_file

from tstorm.utils import settings
from tstorm.utils import release
from tstorm.utils import range
from tstorm.utils import limit
from tstorm.utils import test
from tstorm.utils import tests
from tstorm.utils import configuration

from tstorm.run import run_tests
from tstorm.run import run_stress_tests

if __name__ == '__main__':
    try:
        rst = run_stress_tests.RunStressTests()
        rst.do_parse()
        rst.do_pre_run()
        rst.do_run_tests()
    except run_tests.OptionError, err:
        print '\n\nExecution: ', err
    except tests.TestsError, err:
        print '\n\nExecution: ', err
    except run_tests.RunTestsError, err:
        print '\n\nExecution: ', err
    except run_stress_tests.RunStressTestsError, err:
        print '\n\nExecution: ', err
    except range.RangeError, err:
        print '\n\nExecution: ', err
    except limit.LimitError:
        print '\n\nExecution: ', err
    except release.ReleaseError:
        print '\n\nExecution: ', err
    except test.TestStructureError, err:
        print '\n\nExecution: ', err
    except KeyboardInterrupt:
        print '\n\nExecution n!'
        sys.exit(1)
