import subprocess
import src
+import prepare
# Define all possible option for log command : sat log <options>
parser = src.options.Options()
runner.cfg.APPLICATION.out_dir, 2)
logger.write("\n", 2, False)
- # Get the modules to be prepared, regarding the options
- if options.modules is None:
- # No options, get all modules sources
- modules = runner.cfg.APPLICATION.modules
- else:
- # if option --modules, check that all modules of the command line
- # are present in the application.
- modules = options.modules
- for m in modules:
- if m not in runner.cfg.APPLICATION.modules:
- raise src.SatException(_("Module %(module)s "
- "not defined in application %(application)s") %
- { 'module': m, 'application': runner.cfg.VARS.application} )
-
- # Construct the list of tuple containing
- # the modules name and their definition
- modules_infos = src.module.get_modules_infos(modules, runner.cfg)
-
- # if the --no_sample option is invoked, suppress the sample modules from
- # the list
- if options.no_sample:
- modules_infos = filter(lambda l: not src.module.module_is_sample(l[1]),
- modules_infos)
+ # Get the modules list with modules informations reagrding the options
+ modules_infos = prepare.get_modules_list(options, runner.cfg, logger)
# Get the maximum name length in order to format the terminal display
max_module_name_len = 1
res_count = "%d / %d" % (good_result, good_result)
else:
status = src.KO_STATUS
- res_count = "%d / %d" % (good_result, len(modules))
+ res_count = "%d / %d" % (good_result, len(modules_infos))
# write results
logger.write("Patching sources of the application:", 1)
parser.add_option('f', 'force', 'boolean', 'force',
_("force to prepare the modules in development mode."))
+def get_modules_list(options, cfg, logger):
+ '''method that gives the module list with their informations from
+ configuration regarding the passed options.
+
+ :param options Options: The Options instance that stores the commands
+ arguments
+ :param config Config: The global configuration
+ :param logger Logger: The logger instance to use for the display and logging
+ :return: The list of (module name, module_infomrmations).
+ :rtype: List
+ '''
+ # Get the modules to be prepared, regarding the options
+ if options.modules is None:
+ # No options, get all modules sources
+ modules = cfg.APPLICATION.modules
+ else:
+ # if option --modules, check that all modules of the command line
+ # are present in the application.
+ modules = options.modules
+ for m in modules:
+ if m not in cfg.APPLICATION.modules:
+ raise src.SatException(_("Module %(module)s "
+ "not defined in application %(application)s") %
+ { 'module': m, 'application': cfg.VARS.application} )
+
+ # Construct the list of tuple containing
+ # the modules name and their definition
+ modules_infos = src.module.get_modules_infos(modules, cfg)
+
+ # if the --no_sample option is invoked, suppress the sample modules from
+ # the list
+ if options.no_sample:
+
+ lmodules_sample = [m for m in modules_infos if src.module.module_is_sample(m[1])]
+
+ modules_infos = [m for m in modules_infos if m not in lmodules_sample]
+
+ if len(lmodules_sample) > 0:
+ logger.write(src.printcolors.printcWarning(_("Ignoring the following sample modules:\n")), 1)
+ for i, module in enumerate(lmodules_sample):
+ end_text = ', '
+ if i+1 == len(lmodules_sample):
+ end_text = '\n'
+
+ logger.write(module[0] + end_text, 1)
+
+ return modules_infos
+
def description():
'''method that is called when salomeTools is called with --help option.
import shutil
import src
+import prepare
# Define all possible option for log command : sat log <options>
parser = src.options.Options()
checkout)
return retcode
-def get_sources_from_dir(module_info, source_dir, logger):
- '''The method called if the module is to be get in dir mode
-
- :param module_info Config: The configuration specific to
- the module to be prepared
- :param source_dir Path: The Path instance corresponding to the
- directory where to put the sources
- :param logger Logger: The logger instance to use for the display and logging
- :return: True if it succeed, else False
- :rtype: boolean
- '''
- # Check if it is a symlink?
- use_link = ('symlink' in module_info.dir_info and
- module_info.dir_info.symlink)
- dirflag = 'dir'
- if use_link: dirflag = 'lnk'
-
- # check that source exists if it is not a symlink
- if (not use_link) and (not os.path.exists(module_info.dir_info.dir)):
- raise src.SatException(_("Source directory not found: '%s'") %
- module_info.dir_info.dir)
-
- logger.write('%s:%s ... ' %
- (dirflag, src.printcolors.printcInfo(module_info.dir_info.dir)),
- 3,
- False)
- logger.flush()
-
- if use_link:
- retcode = src.Path(source_dir).symlink(module_info.dir_info.dir)
- else:
- retcode = src.Path(module_info.dir_info.dir).copy(source_dir)
-
- return retcode
-
def get_module_sources(config,
module_info,
is_dev,
logger,
pad)
- if module_info.get_method == "git":
+ if module_info.get_sources == "git":
return get_sources_from_git(module_info, source_dir, logger, pad,
is_dev)
- if module_info.get_method == "archive":
+ if module_info.get_sources == "archive":
return get_sources_from_archive(module_info, source_dir, logger)
- if module_info.get_method == "cvs":
+ if module_info.get_sources == "cvs":
cvs_user = config.USER.cvs_user
return get_sources_from_cvs(cvs_user,
module_info,
logger,
pad)
- if module_info.get_method == "svn":
+ if module_info.get_sources == "svn":
svn_user = config.USER.svn_user
return get_sources_from_svn(svn_user, module_info, source_dir,
checkout,
logger)
-
- if module_info.get_method == "dir":
- return get_sources_from_dir(module_info, source_dir, logger)
+
+ if module_info.get_sources == "native":
+ # skip
+ logger.write('%s ...' % _("native (ignored)"), 3, False)
+ return True
+
+ if module_info.get_sources == "fixed":
+ # skip
+ logger.write('%s ...' % _("fixed (ignored)"), 3, False)
+ return True
- if len(module_info.get_method) == 0:
+ if len(module_info.get_sources) == 0:
# skip
logger.write('%s ...' % _("ignored"), 3, False)
return True
- # if the get_method is not in [git, archive, cvs, svn, dir]
+ # if the get_sources is not in [git, archive, cvs, svn, dir]
logger.write(_("Unknown get_mehtod %(get)s for module %(module)s") % \
- { 'get': module_info.get_method, 'module': module_info.name }, 3, False)
+ { 'get': module_info.get_sources, 'module': module_info.name }, 3, False)
logger.write(" ... ", 3, False)
logger.flush()
return False
for module_name, module_info in modules:
# get module name, module informations and the directory where to put
# the sources
- source_dir = src.Path(module_info.source_dir)
+ if not src.module.module_is_fixed(module_info):
+ source_dir = src.Path(module_info.source_dir)
+ else:
+ source_dir = src.Path('')
# display and log
logger.write('%s: ' % src.printcolors.printcLabel(module_name), 3)
"on modules in development mode\n\n")
logger.write(src.printcolors.printcWarning(msg))
- # Get the modules to be prepared, regarding the options
- if options.modules is None:
- # No options, get all modules sources
- modules = runner.cfg.APPLICATION.modules
- else:
- # if option --modules, check that all modules of the command line
- # are present in the application.
- modules = options.modules
- for m in modules:
- if m not in runner.cfg.APPLICATION.modules:
- raise src.SatException(_("Module %(module)s "
- "not defined in application %(application)s") %
- { 'module': m, 'application': runner.cfg.VARS.application} )
+ # Get the modules list with modules informations reagrding the options
+ modules_infos = prepare.get_modules_list(options, runner.cfg, logger)
- # Construct the list of tuple containing
- # the modules name and their definition
- modules_infos = src.module.get_modules_infos(modules, runner.cfg)
-
- # if the --no_sample option is invoked, suppress the sample modules from
- # the list
- if options.no_sample:
-
- lmodules_sample = [m for m in modules_infos if src.module.module_is_sample(m[1])]
-
- modules_infos = [m for m in modules_infos if m not in lmodules_sample]
-
- if len(lmodules_sample) > 0:
- logger.write(src.printcolors.printcWarning(_("Ignoring the following sample modules:\n")), 1)
- for i, module in enumerate(lmodules_sample):
- end_text = ', '
- if i+1 == len(lmodules_sample):
- end_text = '\n'
-
- logger.write(module[0] + end_text, 1)
-
# Call to the function that gets all the sources
good_result, results = get_all_module_sources(runner.cfg,
modules_infos,
return 0
;;
source)
- opts="--modules --no_sample --force"
+ opts="--module --no_sample --force"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ ;;
+ patch)
+ opts="--module --no_sample"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
-KERNEL_7_7_1 :
+KERNEL_V7_7_1 :
{
name : "KERNEL"
- has_gui : "no"
- compile_method : "cmake"
- get_method : "git"
+ build_sources : "cmake"
+ get_sources : "git"
git_info:
{
repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : 'V7_7_1'
}
environ :
{
}
depend : []
opt_depend : []
- module_type : "sample"
+ type : "sample"
source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
}
MODULE_ARCHIVE :
{
name : "MODULE_ARCHIVE"
- has_gui : "no"
compile_method : "cmake"
- get_method : "archive"
+ get_sources : "archive"
git_info:
{
repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : 'V7_7_1'
}
archive_info:
{
}
depend : []
opt_depend : []
- module_type : "sample"
+ type : "sample"
source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
patches : ['/home/salome/salomeTools-4.3.7/data/compil_scripts/patches/scipy.patch', '/export/home/serioja/MODULE_ARCHIVE.patch']
-MODULE_CVS_6_7_0 :
+MODULE_CVS_V6_7_0 :
{
name : "MODULE_CVS"
- has_gui : "no"
- compile_method : "cmake"
- get_method : "cvs"
+ build_sources : "cmake"
+ get_sources : "cvs"
git_info:
{
repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : 'V7_7_1'
}
archive_info:
{
server : "cvs.opencascade.com"
module_base : "/home/server/cvs/KERNEL"
source : 'KERNEL_SRC'
- tag : "V6_7_0"
}
environ :
{
}
depend : []
opt_depend : []
- module_type : "sample"
+ type : "sample"
source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
}
\ No newline at end of file
--- /dev/null
+MODULE_DEFAULTVERSION :
+{
+ name : "MODULE_DEFAULTVERSION"
+ build_sources : "cmake"
+ get_sources : "git"
+ git_info:
+ {
+ repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
+ repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
+ }
+ archive_info:
+ {
+ archive_name : ''
+ }
+ cvs_info:
+ {
+ server : "cvs.opencascade.com"
+ module_base : "/home/server/cvs/KERNEL"
+ source : 'KERNEL_SRC'
+ }
+ environ :
+ {
+ "_LD_LIBRARY_PATH" : "${SOFT_ROOT_DIR}" + $VARS.sep + "lib"
+ "_PYTHONPATH" : ["${SOFT_ROOT_DIR}" + $VARS.sep + "lib"
+ "${SOFT_ROOT_DIR}" + $VARS.sep + "${PYTHON_LIBDIR0}"
+ "${SOFT_ROOT_DIR}" + $VARS.sep + "${PYTHON_LIBDIR1}"]
+ }
+ depend : []
+ opt_depend : []
+ type : "sample"
+ source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+ build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+}
\ No newline at end of file
MODULE_DIR :
{
name : "MODULE_DIR"
- has_gui : "no"
compile_method : "cmake"
- get_method : "dir"
+ get_sources : "dir"
git_info:
{
repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : 'V7_7_1'
}
archive_info:
{
svn_info:
{
repo: 'https://www-svn-corpus.cea.fr/corpus/CORPUS'
- tag: 'master'
}
environ :
{
}
depend : []
opt_depend : []
- module_type : "sample"
+ type : "sample"
source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
}
\ No newline at end of file
--- /dev/null
+MODULE_FIXED :
+{
+ name : "MODULE_FIXED"
+ get_sources : "fixed"
+ environ :
+ {
+ "_LD_LIBRARY_PATH" : "${SOFT_ROOT_DIR}" + $VARS.sep + "lib"
+ "_PYTHONPATH" : ["${SOFT_ROOT_DIR}" + $VARS.sep + "lib"
+ "${SOFT_ROOT_DIR}" + $VARS.sep + "${PYTHON_LIBDIR0}"
+ "${SOFT_ROOT_DIR}" + $VARS.sep + "${PYTHON_LIBDIR1}"]
+ }
+ type : "sample"
+}
\ No newline at end of file
--- /dev/null
+MODULE_NATIVE :
+{
+ name : "MODULE_NATIVE"
+ compile_method : "cmake"
+ get_sources : "native"
+ git_info:
+ {
+ repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
+ repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
+ }
+ archive_info:
+ {
+ archive_name : '/data/tmpsalome/salome/prerequis/archives/tclx8.4.tar.bz2'
+ }
+ svn_info:
+ {
+ repo: 'https://www-svn-corpus.cea.fr/corpus/CORPUS'
+ }
+ environ :
+ {
+ "_LD_LIBRARY_PATH" : "${SOFT_ROOT_DIR}" + $VARS.sep + "lib"
+ "_PYTHONPATH" : ["${SOFT_ROOT_DIR}" + $VARS.sep + "lib"
+ "${SOFT_ROOT_DIR}" + $VARS.sep + "${PYTHON_LIBDIR0}"
+ "${SOFT_ROOT_DIR}" + $VARS.sep + "${PYTHON_LIBDIR1}"]
+ }
+ depend : []
+ opt_depend : []
+ type : "sample"
+ source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+ build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+}
\ No newline at end of file
MODULE_SVN :
{
name : "MODULE_SVN"
- has_gui : "no"
- compile_method : "cmake"
- get_method : "svn"
+ build_sources : "cmake"
+ get_sources : "svn"
git_info:
{
repo : "http://git.salome-platform.org/gitpub/modules/kernel.git"
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : 'V7_7_1'
}
archive_info:
{
svn_info:
{
repo: 'https://www-svn-corpus.cea.fr/corpus/CORPUS'
- tag: 'master'
}
environ :
{
}
depend : []
opt_depend : []
- module_type : "sample"
+ type : "sample"
source_dir : $APPLICATION.out_dir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
build_dir : $APPLICATION.out_dir + $VARS.sep + 'BUILD' + $VARS.sep + $name
}
\ No newline at end of file
softA :
{
name : "softA"
- has_gui : "no"
- compile_method : "cmake" # ou autotools, ou script
+ get_sources : "cmake" # ou autotools, ou script
get_method : "git" # "archive", embedded", "native" "fixed"
cvs_info:
{
server : $SITE.prepare.default_cvs_server
module_base : $SITE.prepare.cvs_dir + $name
source : 'softA_SRC'
- tag : ''
}
git_info:
{
repo : $SITE.prepare.default_git_server + $VARS.sep + $name
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : $APPLICATION.default_version_to_download
}
archive_info:
{
softB :
{
name : "softB"
- has_gui : "no"
- compile_method : "cmake" # ou autotools, ou script
+ get_sources : "cmake" # ou autotools, ou script
get_method : "git" # "archive", embedded", "native" "fixed"
cvs_info:
{
server : $SITE.prepare.default_cvs_server
module_base : $SITE.prepare.cvs_dir + $name
source : 'softB_SRC'
- tag : ''
}
git_info:
{
repo : $SITE.prepare.default_git_server + $VARS.sep + $name
repo_dev : $SITE.prepare.default_git_server_dev + $VARS.sep + $name
- tag : $APPLICATION.default_version_to_download
}
archive_info:
{
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-'''In this file are implemented the classes and method
+'''In this file are implemented the classes and methods
relative to the module notion of salomeTools
'''
import src
+AVAILABLE_VCS = ['git', 'svn', 'cvs']
+
def get_module_config(config, module_name, version):
'''Get the specific configuration of a module from the global configuration
for depend in mod_info.opt_depend:
if depend in config.MODULES:
mod_info.depend.append(depend,'')
+
+ # Check if the module is defined as native in the application
+ pass # to be done
+
+ # In case of a module get with a vcs, put the tag (equal to the version)
+ if mod_info is not None and mod_info.get_sources in AVAILABLE_VCS:
+
+ if mod_info.get_sources == 'git':
+ mod_info.git_info.tag = version
+
+ if mod_info.get_sources == 'svn':
+ mod_info.svn_info.tag = version
+
+ if mod_info.get_sources == 'cvs':
+ mod_info.cvs_info.tag = version
+
+ # In case of a fixed module, define the install_dir (equal to the version)
+ if mod_info is not None and mod_info.get_sources=="fixed":
+ mod_info.install_dir = version
+
return mod_info
def get_modules_infos(lmodules, config):
# Loop on module names
for mod in lmodules:
# Get the version of the module from the application definition
- version_mod = config.APPLICATION.modules[mod][0]
+ version_mod = config.APPLICATION.modules[mod]
+ # if no version, then take the default one defined in the application
+ if isinstance(version_mod, bool):
+ version_mod = config.APPLICATION.tag
+
# Get the specific configuration of the module
mod_info = get_module_config(config, mod, version_mod)
if mod_info is not None:
'''Know if a module has the sample type
:param module_info Config: The configuration specific to
- the module to be prepared
+ the module
:return: True if the module has the sample type, else False
:rtype: boolean
'''
- mtype = module_info.module_type
- return mtype.lower() == 'sample'
\ No newline at end of file
+ mtype = module_info.type
+ return mtype.lower() == 'sample'
+
+def module_is_fixed(module_info):
+ '''Know if a module is fixed
+
+ :param module_info Config: The configuration specific to
+ the module
+ :return: True if the module is fixed, else False
+ :rtype: boolean
+ '''
+ get_src = module_info.get_sources
+ return get_src.lower() == 'fixed'
\ No newline at end of file
import HTMLTestRunner
import src.xmlManager
-sleep_time = 3
+sleep_time = 2
class TestLog(unittest.TestCase):
'''Test of log command: launch of browser
OK = "KO"
sat = Sat("-oUSER.browser='konqueror'")
+ time.sleep(sleep_time)
cmd_log = threading.Thread(target=sat.log, args=('',))
cmd_log.start()
OK = "OK"
sys.stdin = sys.__stdin__
except:
- pass
+ sys.stdin = sys.__stdin__
# pyunit method to compare 2 str
self.assertEqual(OK, "OK")
sys.stdin = io.StringIO(one)
try:
- sat.log('appli-test --last')
+ sat.log('appli-test -t --last')
OK = "OK"
sys.stdin = sys.__stdin__
except:
sat.config('appli-test -v VARS.python')
+
+ time.sleep(sleep_time)
cmd_log = threading.Thread(target=sat.log, args=('appli-test --last',))
cmd_log.start()
OK = "KO"
sat = Sat("-oUSER.browser='konqueror'")
+ time.sleep(sleep_time)
cmd_log = threading.Thread(target=sat.log, args=('--full',))
cmd_log.start()
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Unit Test Report</title>
+ <meta name="generator" content="HTMLTestRunner 0.8.2"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+
+<style type="text/css" media="screen">
+body { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; }
+table { font-size: 100%; }
+pre { }
+
+/* -- heading ---------------------------------------------------------------------- */
+h1 {
+ font-size: 16pt;
+ color: gray;
+}
+.heading {
+ margin-top: 0ex;
+ margin-bottom: 1ex;
+}
+
+.heading .attribute {
+ margin-top: 1ex;
+ margin-bottom: 0;
+}
+
+.heading .description {
+ margin-top: 4ex;
+ margin-bottom: 6ex;
+}
+
+/* -- css div popup ------------------------------------------------------------------------ */
+a.popup_link {
+}
+
+a.popup_link:hover {
+ color: red;
+}
+
+.popup_window {
+ display: none;
+ position: relative;
+ left: 0px;
+ top: 0px;
+ /*border: solid #627173 1px; */
+ padding: 10px;
+ background-color: #E6E6D6;
+ font-family: "Lucida Console", "Courier New", Courier, monospace;
+ text-align: left;
+ font-size: 8pt;
+ width: 500px;
+}
+
+}
+/* -- report ------------------------------------------------------------------------ */
+#show_detail_line {
+ margin-top: 3ex;
+ margin-bottom: 1ex;
+}
+#result_table {
+ width: 80%;
+ border-collapse: collapse;
+ border: 1px solid #777;
+}
+#header_row {
+ font-weight: bold;
+ color: white;
+ background-color: #777;
+}
+#result_table td {
+ border: 1px solid #777;
+ padding: 2px;
+}
+#total_row { font-weight: bold; }
+.passClass { background-color: #6c6; }
+.failClass { background-color: #c60; }
+.errorClass { background-color: #c00; }
+.passCase { color: #6c6; }
+.failCase { color: #c60; font-weight: bold; }
+.errorCase { color: #c00; font-weight: bold; }
+.hiddenRow { display: none; }
+.testcase { margin-left: 2em; }
+
+
+/* -- ending ---------------------------------------------------------------------- */
+#ending {
+}
+
+</style>
+
+</head>
+<body>
+<script language="javascript" type="text/javascript"><!--
+output_list = Array();
+
+/* level - 0:Summary; 1:Failed; 2:All */
+function showCase(level) {
+ trs = document.getElementsByTagName("tr");
+ for (var i = 0; i < trs.length; i++) {
+ tr = trs[i];
+ id = tr.id;
+ if (id.substr(0,2) == 'ft') {
+ if (level < 1) {
+ tr.className = 'hiddenRow';
+ }
+ else {
+ tr.className = '';
+ }
+ }
+ if (id.substr(0,2) == 'pt') {
+ if (level > 1) {
+ tr.className = '';
+ }
+ else {
+ tr.className = 'hiddenRow';
+ }
+ }
+ }
+}
+
+
+function showClassDetail(cid, count) {
+ var id_list = Array(count);
+ var toHide = 1;
+ for (var i = 0; i < count; i++) {
+ tid0 = 't' + cid.substr(1) + '.' + (i+1);
+ tid = 'f' + tid0;
+ tr = document.getElementById(tid);
+ if (!tr) {
+ tid = 'p' + tid0;
+ tr = document.getElementById(tid);
+ }
+ id_list[i] = tid;
+ if (tr.className) {
+ toHide = 0;
+ }
+ }
+ for (var i = 0; i < count; i++) {
+ tid = id_list[i];
+ if (toHide) {
+ document.getElementById('div_'+tid).style.display = 'none'
+ document.getElementById(tid).className = 'hiddenRow';
+ }
+ else {
+ document.getElementById(tid).className = '';
+ }
+ }
+}
+
+
+function showTestDetail(div_id){
+ var details_div = document.getElementById(div_id)
+ var displayState = details_div.style.display
+ // alert(displayState)
+ if (displayState != 'block' ) {
+ displayState = 'block'
+ details_div.style.display = 'block'
+ }
+ else {
+ details_div.style.display = 'none'
+ }
+}
+
+
+function html_escape(s) {
+ s = s.replace(/&/g,'&');
+ s = s.replace(/</g,'<');
+ s = s.replace(/>/g,'>');
+ return s;
+}
+
+/* obsoleted by detail in <div>
+function showOutput(id, name) {
+ var w = window.open("", //url
+ name,
+ "resizable,scrollbars,status,width=800,height=450");
+ d = w.document;
+ d.write("<pre>");
+ d.write(html_escape(output_list[id]));
+ d.write("\n");
+ d.write("<a href='javascript:window.close()'>close</a>\n");
+ d.write("</pre>\n");
+ d.close();
+}
+*/
+--></script>
+
+<div class='heading'>
+<h1>Unit Test Report</h1>
+<p class='attribute'><strong>Start Time:</strong> 2016-03-11 15:04:07</p>
+<p class='attribute'><strong>Duration:</strong> 0:01:32.373196</p>
+<p class='attribute'><strong>Status:</strong> Pass 1</p>
+
+<p class='description'></p>
+</div>
+
+
+
+<p id='show_detail_line'>Show
+<a href='javascript:showCase(0)'>Summary</a>
+<a href='javascript:showCase(1)'>Failed</a>
+<a href='javascript:showCase(2)'>All</a>
+</p>
+<table id='result_table'>
+<colgroup>
+<col align='left' />
+<col align='right' />
+<col align='right' />
+<col align='right' />
+<col align='right' />
+<col align='right' />
+</colgroup>
+<tr id='header_row'>
+ <td>Test Group/Test case</td>
+ <td>Count</td>
+ <td>Pass</td>
+ <td>Fail</td>
+ <td>Error</td>
+ <td>View</td>
+</tr>
+
+<tr class='passClass'>
+ <td>TestLog: Test of log command: launch of browser</td>
+ <td>1</td>
+ <td>1</td>
+ <td>0</td>
+ <td>0</td>
+ <td><a href="javascript:showClassDetail('c1',1)">Detail</a></td>
+</tr>
+
+<tr id='pt1.1' class='hiddenRow'>
+ <td class='none'><div class='testcase'>test_prepare_all: Test the prepare command with many ways to prepare</div></td>
+ <td colspan='5' align='center'>
+
+ <!--css div popup start-->
+ <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.1')" >
+ pass</a>
+
+ <div id='div_pt1.1' class="popup_window">
+ <div style='text-align: right; color:red;cursor:pointer'>
+ <a onfocus='this.blur();' onclick="document.getElementById('div_pt1.1').style.display = 'none' " >
+ [x]</a>
+ </div>
+ <pre>
+
+pt1.1: Get the sources of the desired modules
+Getting sources of the application appli-test
+ out_dir = /export/home/serioja/APPLI-TEST-MG05
+
+KERNEL: git:http://git.salome-platform.org/gitpub/modules/kernel.git tag:V7_7_1 ..... OK
+MODULE_ARCHIVE: arc:/data/tmpsalome/salome/prerequis/archives/tclx8.4.tar.bz2 ... OK
+MODULE_CVS: dev: /export/home/serioja/APPLI-TEST-MG05/SOURCES/MODULE_CVS ... OK source directory already exists
+MODULE_SVN: svn:https://www-svn-corpus.cea.fr/corpus/CORPUS ... OK
+MODULE_NATIVE: native (ignored) ...OK
+MODULE_DEFAULTVERSION: git:http://git.salome-platform.org/gitpub/modules/kernel.git tag:V7_7_1 ..... OK
+MODULE_FIXED: fixed (ignored) ...OK
+
+Getting sources of the application: OK (7 / 7)
+
+Apply the patches to the sources of the modules
+Patching sources of the application appli-test
+ out_dir = /export/home/serioja/APPLI-TEST-MG05
+
+KERNEL: No patch for the KERNEL module
+MODULE_ARCHIVE: Failed to apply patch /home/salome/salomeTools-4.3.7/data/compil_scripts/patches/scipy.patch
+ Apply patch /export/home/serioja/MODULE_ARCHIVE.patch
+MODULE_CVS: No patch for the MODULE_CVS module
+MODULE_SVN: No patch for the MODULE_SVN module
+MODULE_NATIVE: No patch for the MODULE_NATIVE module
+MODULE_DEFAULTVERSION: No patch for the MODULE_DEFAULTVERSION module
+MODULE_FIXED: No patch for the MODULE_FIXED module
+
+Patching sources of the application: KO (6 / 7)
+
+
+ </pre>
+ </div>
+ <!--css div popup end-->
+
+ </td>
+</tr>
+
+<tr id='total_row'>
+ <td>Total</td>
+ <td>1</td>
+ <td>1</td>
+ <td>0</td>
+ <td>0</td>
+ <td> </td>
+</tr>
+</table>
+
+<div id='ending'> </div>
+
+</body>
+</html>
--- /dev/null
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+# Copyright (C) 2010-2012 CEA/DEN
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import unittest
+import os
+import sys
+import io
+
+# get execution path
+testdir = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(testdir, '..', '..'))
+sys.path.append(os.path.join(testdir, '..', '_testTools'))
+sys.path.append(os.path.join(testdir, '..', '..','commands'))
+
+from salomeTools import Sat
+from tools import check_proc_existence_and_kill
+from tools import outRedirection
+import HTMLTestRunner
+import src.xmlManager
+
+sleep_time = 3
+
+class TestLog(unittest.TestCase):
+ '''Test of the prepare command
+ '''
+
+ def test_prepare_all(self):
+ '''Test the prepare command with many ways to prepare
+ '''
+
+ OK = "KO"
+
+ sat = Sat()
+
+ try:
+ sat.prepare('appli-test')
+ OK = "OK"
+ except:
+ pass
+
+
+ # pyunit method to compare 2 str
+ self.assertEqual(OK, "OK")
+
+
+# test launch
+if __name__ == '__main__':
+ HTMLTestRunner.main()
coverage run --source=../commands/config.py -a config/option_copy.py >> test_res.html
coverage run --source=../commands/config.py -a config/option_edit.py >> test_res.html
coverage run --source=../commands/config.py,../commands/log.py,../src/xmlManager.py,../src/logger.py -a log/launch_browser.py >> test_res.html
+coverage run --source=../commands/config.py,../commands/source.py,../commands/patch.py,../commands/prepare.py,../src/module.py -a prepare/test_prepare.py >> test_res.html
coverage html