edburns%acm.org 256c970b1c Automated test cases.
git-svn-id: svn://10.0.0.236/trunk@84595 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 21:27:40 +00:00

123 lines
4.0 KiB
Makefile

#!nmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Sun Microsystems,
# Inc. Portions created by Sun are
# Copyright (C) 1999 Sun Microsystems, Inc. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..\..
BUILD_DIR=$(DEPTH)\build
SRC_DIR=$(DEPTH)\src
UTIL_DIR=$(DEPTH)\utils
COMMON_PROPERTIES=$(DEPTH)\config\CommonProperties
TEST_DIRS_SRC=$(SRC_DIR)\test\basic
TEST_DIRS_BUILD=$(BUILD_DIR)\test\basic
PERL=perl
TESTS_SUFFIX=test\basic
!include $(COMMON_PROPERTIES)
!if defined(SECTION)
DIRS= \
!include .$(SECTION).dirs.in
!endif
SECTIONS = api \
mixed \
stress \
$(NULL)
all: tests
!if defined(DIRS)
test_dirs: $(DIRS)
$(DIRS)::
!if defined(BUILD_TESTS)
@echo Proceed all in $(TEST_DIRS_SRC)\$(SECTION)\$@ ...
@$(PERL) $(UTIL_DIR)\configurator.pl $(COMMON_PROPERTIES) \
$(TEST_DIRS_BUILD)\$(SECTION)\$@\TestProperties \
$(TEST_DIRS_SRC)\$(SECTION)\$@\TestProperties
@if exist $(TEST_DIRS_SRC)\$(SECTION)\$@\Test.lst \
$(PERL) $(UTIL_DIR)\configurator.pl $(COMMON_PROPERTIES) \
$(TEST_DIRS_BUILD)\$(SECTION)\$@\Test.lst \
$(TEST_DIRS_SRC)\$(SECTION)\$@\Test.lst
@if not exist $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)\$(SECTION)\$@ \
mkdir $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)\$(SECTION)\$@
@if exist $(TEST_DIRS_SRC)\$(SECTION)\$@\*.html \
copy $(TEST_DIRS_SRC)\$(SECTION)\$@\*.html $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)\$(SECTION)\$@
@if not exist $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)\$(SECTION)\$@ \
mkdir $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)\$(SECTION)\$@
@if exist $(TEST_DIRS_SRC)\$(SECTION)\$@\*.cgi \
copy $(TEST_DIRS_SRC)\$(SECTION)\$@\*.cgi $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)\$(SECTION)\$@
!else
@echo Make clobber in $(TEST_DIRS_BUILD)\$(SECTION)\$@
@-del /Q $(TEST_DIRS_BUILD)\$(SECTION)\$@\*
!endif
!endif
$(SECTIONS)::
!if defined(BUILD_TESTS)
@echo Copy HTML files from $(TEST_DIRS_SRC)\$@
@if not exist $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)\$@ \
mkdir $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)\$@
@if exist $(TEST_DIRS_SRC)\$@\*.html \
copy $(TEST_DIRS_SRC)\$@\*.html $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)\$@
@if not exist $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)\$@ \
mkdir $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)\$@
@if exist $(TEST_DIRS_SRC)\$@\*.cgi \
copy $(TEST_DIRS_SRC)\$@\*.cgi $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)\$@
@echo Generate list of $@ tests
@$(PERL) $(UTIL_DIR)\dirGen.pl $(TEST_DIRS_SRC)\$@ .$@.dirs
@if exist .$@.dirs.in \
del .$@.dirs.in
@for /F "delims=" %%i IN (.$@.dirs) DO @echo %%i \>>.$@.dirs.in
@echo $$(NULL)>>.$@.dirs.in
@$(MAKE) /NOLOGO /f Makefile.win test_dirs SECTION=$@ BUILD_TESTS=1
@$(PERL) $(UTIL_DIR)\lstGen.pl $(BUILD_DIR)\$(TESTS_SUFFIX)\$@ $(BUILD_DIR)\run\$@.lst
!else
@$(MAKE) /NOLOGO /f Makefile.win test_dirs SECTION=$@
!endif
tests:
@if not exist $(BUILD_DIR)\run \
mkdir $(BUILD_DIR)\run
@copy $(SRC_DIR)\run\autorun.pl $(BUILD_DIR)\run
@copy $(SRC_DIR)\run\BWTest.lst $(BUILD_DIR)\run
@copy $(SRC_DIR)\run\BWMixedTest.lst $(BUILD_DIR)\run
@if not exist $(HTML_ROOT_DIR)\$(TESTS_SUFFIX) \
mkdir $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)
@if exist $(TEST_DIRS_SRC)\*.html \
copy $(TEST_DIRS_SRC)\*.html $(HTML_ROOT_DIR)\$(TESTS_SUFFIX)
@if not exist $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX) \
mkdir $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)
@if exist $(TEST_DIRS_SRC)\*.cgi \
copy $(TEST_DIRS_SRC)\*.cgi $(CGI_BIN_ROOT_DIR)\$(TESTS_SUFFIX)
@$(MAKE) /NOLOGO /f Makefile.win $(SECTIONS) BUILD_TESTS=1
clobber:
@echo Remove all from test dirs
@$(MAKE) /NOLOGO /f Makefile.win $(SECTIONS)