configurationengine/source/plugins/runtests.py
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
equal deleted inserted replaced
-1:000000000000 0:2e8eeb919028
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description:
       
    15 #
       
    16 
       
    17 import sys, os, re, unittest
       
    18 import plugin_utils
       
    19 
       
    20 ROOT_PATH = os.path.abspath(os.path.dirname(__file__))
       
    21 
       
    22 if __name__ == "__main__":
       
    23     # Collect a list of plug-in source paths and plug-in module names
       
    24     sources = plugin_utils.find_all_plugin_sources(ROOT_PATH)
       
    25     
       
    26     # Flatten the source list
       
    27     flattened_sources = []
       
    28     for subpackage_name, paths_and_modnames in sources.iteritems():
       
    29         flattened_sources.extend(paths_and_modnames)
       
    30     
       
    31     # Create a test suite from them
       
    32     suite = plugin_utils.collect_suite_from_source_list(flattened_sources)
       
    33     
       
    34     # Run the suite
       
    35     unittest.TextTestRunner(verbosity=2).run(suite)