Commit 995b5612 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

removed getTemplateForTest from brnach

parent 2003f5f0
Loading
Loading
Loading
Loading
+0 −60
Original line number Diff line number Diff line
#*******************************************************************************
# PPPPPPPP
#
# "@(#) $Id: Makefile,v 1.4 2010-08-13 06:32:24 bartolini Exp $"
#
# Makefile of ........
#
# who        when      what
# --------   --------  ----------------------------------------------
# bartolini  23/01/14  created
#
#
# Python stuff (public and local)
# ----------------------------
PY_SCRIPTS         = getTemplateForTest
PY_MODULES         = gettemplatefortest

SCRIPTS_L          = install_gmock

#
#>>>>> END OF standard rules

#
# INCLUDE STANDARDS
# -----------------

MAKEDIRTMP := $(shell searchFile include/acsMakefile)
ifneq ($(MAKEDIRTMP),\#error\#)
   MAKEDIR := $(MAKEDIRTMP)/include
   include $(MAKEDIR)/acsMakefile
endif

#
# TARGETS
# -------
all:	do_all
	@echo " . . . 'all' done" 

clean_templates:
	rm -rf $(INTROOT)/templates/test
	@echo " . . . templates removed from introot"

clean : clean_all clean_templates
	@echo " . . . clean done"

clean_dist : clean_all clean_dist_all clean_templates
	@echo " . . . clean_dist done"

man   : do_man 
	@echo " . . . man page(s) done"

install_templates:
	cp -r ../templates/test $(INTROOT)/templates
	@echo " . . . templates installed"

install : install_all install_templates
	@echo " . . . installation done"


#___oOo___
+0 −29
Original line number Diff line number Diff line
#!/usr/bin/env python

#
#
#    Copyright (C) 2012  Marco Bartolini, bartolini@ira.inaf.it
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program 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 General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
import sys
import gettemplatefortest

args = sys.argv[1:]
try:
    gettemplatefortest.command_line_util(args)
except Exception, e:
    print e.message
    sys.exit(1)
+0 −44
Original line number Diff line number Diff line
import sys
import os
import shutil

usage = """
getTmplateForTest - create a test directory containing the necessary code templates
                    used for component automated testing.
                    This command should be run from within a Component directory at
                    the first level of depth, creating a 'test' directory at the same level 
                    of 'src, objects' ecc...
"""                    

def get_introot():
    introot = os.getenv("INTROOT")
    if not introot:
        msg = "ERROR: INTROOT environment variable is not defined"
        raise Exception(msg)
    return introot

def get_template_dir_name():
    introot = get_introot()
    return os.path.join(introot, "templates/test")

def get_template_dir():
    template_dir = get_template_dir_name()
    if not os.path.exists(template_dir):
        msg = "ERROR: template directory does not exist"
        raise Exception(msg)
    return template_dir

def command_line_util(args):
    try:
        help = args[0] == "--help" or args[0] == "-h"
    except:
        help = False
    if help:
        print usage
        sys.exit(0)
    if os.path.exists("test"):
        msg = "ERROR: test directory already exists."
        raise Exception(msg)
    template_dir = get_template_dir()
    shutil.copytree(template_dir, "test")
+0 −32
Original line number Diff line number Diff line
#!/bin/bash
if [[ $(id -u) -ne 0 ]] ; then echo "Script must be run as root" ; exit 1 ; fi
GMOCK=gmock-1.7.0
GMOCK_BASE_URL=https://googlemock.googlecode.com/files
BUILDDIR=build
PWD=`pwd`
TMPDIR=`mktemp -d`
cd $TMPDIR
wget $GMOCK_BASE_URL/$GMOCK.zip
unzip $GMOCK.zip
cd $GMOCK
export GMOCK_HOME=`pwd`
mkdir $BUILDDIR
cd $BUILDDIR
cmake ..
make
chmod a+x *.a
cp *.a /usr/local/lib
cd $GMOCK_HOME/include
cp -r gmock /usr/local/include
cd $GMOCK_HOME/gtest
mkdir $BUILDDIR
cd $BUILDDIR
cmake ..
make
chmod a+x *.a
cp *.a /usr/local/lib
cd $GMOCK_HOME/gtest/include
cp -r gtest /usr/local/include
cd $PWD
rm -rf $TMPDIR