Blob Blame History Raw
#!/bin/csh

# Copyright (c) 1987-2012, The Open Group. All rights reserved.
#
# Motif
#
# These libraries and programs are free software; you can
# redistribute them and/or modify them under the terms of the GNU
# Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# These libraries and programs are distributed in the hope that
# they 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 these librararies and programs; if not, write
# to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA 02110-1301 USA

# This script runs all the automated QATS tests, as defined in the file
# ./tests/General/dirsAuto

unalias cd
unalias pushd
unalias popd

set dirs_file = ../tests/General/dirsAuto
set DIR_LIST = (`cat $dirs_file`)
set TESTS_HOME = $cwd

echo  $#DIR_LIST " directories of automated tests to be run..."

setenv LIBRARY_PATH /usr/X11R6/lib:$TESTS_HOME/Manual/lib/Common:$TESTS_HOME/../lib/Xm/.libs:$TESTS_HOME/Auto/lib/Common:$TESTS_HOME/Auto/lib/Create:$TESTS_HOME/Auto/lib/Script:$TESTS_HOME/Auto/lib/Synth:$TESTS_HOME/Auto/lib/Util:$TESTS_HOME/Auto/lib/Visual:
setenv LD_LIBRARY_PATH /usr/X11R6/lib:$TESTS_HOME/Manual/lib/Common:$TESTS_HOME/../lib/Xm/.libs:$TESTS_HOME/Auto/lib/Common:$TESTS_HOME/Auto/lib/Create:$TESTS_HOME/Auto/lib/Script:$TESTS_HOME/Auto/lib/Synth:$TESTS_HOME/Auto/lib/Util:$TESTS_HOME/Auto/lib/Visual:
setenv C_INCLUDE_PATH $TESTS_HOME/../lib
setenv C_PATH $TESTS_HOME/../lib
setenv MOTIF_HOME $TESTS_HOME/..

# Go to the Geberal dir nad change permision to execute
cd $TESTS_HOME/General/bin && chmod +x *
cd $TESTS_HOME/General && chmod +x RUN_template

# Go to the lib dir and build the Motif libraries local

if (-d environment) then
	cp -f -r environment ~/
endif


cd $TESTS_HOME/../lib
echo "I am in " $cwd

set DIR = $cwd:t
if (-e make.$DIR) then
	mv -f  make.$DIR make.$DIR.bak
endif
make -i >& make.$DIR

# Go to Auto and Manual directories and build libs
cd $TESTS_HOME && ./BUILD_libs

# Go to each automated test directory

foreach dir ($DIR_LIST)
        cd $TESTS_HOME/../$dir
	set DIR = $cwd:t
        echo "I am in " $cwd

# Make all the automated tests and supporting files in this directory

        if (-e make.$DIR) then
                mv -f  make.$DIR make.$DIR.bak
        endif
	imake -DUseInstalled -DAUTOMATION -I$TESTS_HOME/../config/cf -TMotif.tmpl -TImake.tmpl  -DTOPDIR=$TESTS_HOME/..
	make Makefiles
        make -i 
# Use the generated RUN script to run all of the tests

        if (-e RUN.$DIR) then
            if (-e RUN.$DIR.bak) then
                rm -f RUN.$DIR.bak
            endif
            mv -f RUN.$DIR RUN.$DIR.bak
        endif
	setenv PATH $PATH":"$cwd
        ./RUN -T -D 0 -genrep -Dir -d :0.0 >& RUN.$DIR

# Clean up the directory before leaving
        make clean

end