mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 1412906 - Remove config/makefiles/test/ r=nalexander DONTBUILD
This commit is contained in:
parent
7559e0d07a
commit
a7801a1404
@ -1,98 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
STANDALONE_MAKEFILE := 1
|
||||
USE_AUTOTARGETS_MK = 1
|
||||
MAKEUTILS_UNIT_TEST = 1
|
||||
include $(topsrcdir)/config/makefiles/makeutils.mk
|
||||
|
||||
dir-ts = .deps/test
|
||||
check-arglist = $(dir-ts)/arglist.ts
|
||||
check-autotargets = $(dir-ts)/autotargets_mk.ts
|
||||
check-XinY = $(dir-ts)/check_XinY_mk.ts
|
||||
check-tests =\
|
||||
$(check-arglist) \
|
||||
$(check-autotargets) \
|
||||
$(check-XinY) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
##------------------_##
|
||||
##---] TARGETS [---##
|
||||
##------------------_##
|
||||
all::
|
||||
|
||||
clean:
|
||||
$(RM) $(check-tests)
|
||||
|
||||
###########################################################################
|
||||
## Logic processed at compile time so be selective about when to test
|
||||
## $(MAKE) check VERBOSE=1
|
||||
ifneq ($(NULL),$(findstring check,$(MAKECMDGOALS))) #
|
||||
|
||||
check-preqs =\
|
||||
$(call mkdir_deps,$(dir-ts)) \
|
||||
$(check-tests) \
|
||||
$(NULL)
|
||||
|
||||
check:: $(check-preqs)
|
||||
@true
|
||||
|
||||
|
||||
ifdef VERBOSE #{ gmake check VERBOSE=1
|
||||
$(info ===========================================================================)
|
||||
$(info Running test: $(MAKECMDGOALS): pwd=$(CURDIR))
|
||||
$(info ===========================================================================)
|
||||
endif #}
|
||||
|
||||
ifndef requiredfunction
|
||||
$(error requiredfunction is not defined)
|
||||
endif
|
||||
|
||||
|
||||
##################
|
||||
check-XinY-preqs=\
|
||||
$(call mkdir_deps,$(dir-ts)) \
|
||||
$(topsrcdir)/config/makefiles/makeutils.mk \
|
||||
$(srcdir)/check_XinY.mk \
|
||||
$(eval include $(srcdir)/check_XinY.mk) \
|
||||
$(NULL)
|
||||
|
||||
$(check-XinY): $(check-XinY-preqs)
|
||||
@$(TOUCH) $@
|
||||
# </check-XinY.mk>
|
||||
|
||||
|
||||
###########################################################################
|
||||
## check-arglist.mk always invoked as a compile time test
|
||||
## maintain real file dependencies for use later on.
|
||||
check-arglist-preqs=\
|
||||
$(call mkdir_deps,$(dir-ts)) \
|
||||
$(topsrcdir)/config/makefiles/makeutils.mk \
|
||||
$(srcdir)/check-arglist.mk \
|
||||
$(eval include $(srcdir)/check-arglist.mk) \
|
||||
$(NULL)
|
||||
|
||||
$(check-arglist): $(check-arglist-preqs)
|
||||
@$(TOUCH) $@
|
||||
# </check-arglist.mk>
|
||||
|
||||
|
||||
###########################################################################
|
||||
# <CHECK: autotargets.mk>
|
||||
check-autotargets-preqs=\
|
||||
$(call mkdir_deps,$(dir-ts)) \
|
||||
$(topsrcdir)/config/makefiles/makeutils.mk \
|
||||
$(topsrcdir)/config/makefiles/autotargets.mk \
|
||||
$(srcdir)/check-autotargets.mk \
|
||||
$(eval include $(srcdir)/check-autotargets.mk) \
|
||||
$(NULL)
|
||||
|
||||
$(check-autotargets): $(check-autotargets-preqs)
|
||||
@$(TOUCH) $@
|
||||
# </CHECK: autotargets.mk>
|
||||
|
||||
endif #} findstring MAKECMDGOAL
|
@ -1,100 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
ifdef VERBOSE
|
||||
$(warning loading test)
|
||||
endif
|
||||
|
||||
|
||||
$(call requiredfunction,getargv)
|
||||
$(call requiredfunction,subargv)
|
||||
$(call requiredfunction,istype isval isvar)
|
||||
|
||||
# arg_scalar = [scalar|literal]
|
||||
arg_list = foo bar
|
||||
arg_ref = arg_list
|
||||
|
||||
## Identify type of function argument(s)
|
||||
########################################
|
||||
ifneq (scalar,$(call istype,arg_scalar))
|
||||
$(error istype(arg_scalar)=scalar, found [$(call istype,arg_scalar)])
|
||||
endif
|
||||
ifneq (list,$(call istype,arg_list))
|
||||
$(error istype(arg_list)=list, found [$(call istype,arg_list)])
|
||||
endif
|
||||
ifneq (list,$(call istype,arg_ref))
|
||||
$(error istype(arg_ref)=list, found [$(call istype,arg_ref)])
|
||||
endif
|
||||
|
||||
## Type == scalar or a list of values
|
||||
#####################################
|
||||
ifneq (true,$(call isval,scalar))
|
||||
$(error isval(scalar)=true, found [$(call isval,scalar)])
|
||||
endif
|
||||
ifneq ($(NULL),$(call isval,arg_list))
|
||||
$(error isval(arg_list)=null, found [$(call isval,arg_list)])
|
||||
endif
|
||||
|
||||
## type == reference: macro=>macro => $($(1))
|
||||
#############################################
|
||||
ifneq ($(NULL),$(call isvar,scalar))
|
||||
$(error isvar(scalar)=$(NULL), found [$(call isvar,scalar)])
|
||||
endif
|
||||
ifneq (true,$(call isvar,arg_list))
|
||||
$(error isvar(arg_list)=true, found [$(call isvar,arg_list)])
|
||||
endif
|
||||
ifneq (true,$(call isvar,arg_ref))
|
||||
$(error isvar(arg_ref)=true, found [$(call isvar,arg_ref)])
|
||||
endif
|
||||
|
||||
# Verify getargv expansion
|
||||
##########################
|
||||
ifneq (scalar,$(call getargv,scalar))
|
||||
$(error getargv(scalar)=scalar, found [$(call getargv,scalar)])
|
||||
endif
|
||||
ifneq ($(arg_list),$(call getargv,arg_list))
|
||||
$(error getargv(arg_list)=list, found [$(call getargv,arg_list)])
|
||||
endif
|
||||
ifneq (arg_list,$(call getargv,arg_ref))
|
||||
$(error getargv(arg_ref)=list, found [$(call getargv,arg_ref)])
|
||||
endif
|
||||
|
||||
###########################################################################
|
||||
##
|
||||
###########################################################################
|
||||
ifdef MANUAL_TEST #{
|
||||
# For automated testing a callback is needed that can set an external status
|
||||
# variable that can be tested. Syntax is tricky to get correct functionality.
|
||||
ifdef VERBOSE
|
||||
$(info )
|
||||
$(info ===========================================================================)
|
||||
$(info Running test: checkIfEmpty)
|
||||
$(info ===========================================================================)
|
||||
endif
|
||||
|
||||
#status =
|
||||
#setTRUE =status=true
|
||||
#setFALSE =status=$(NULL)
|
||||
#$(call checkIfEmpty,setFALSE NULL)
|
||||
#$(if $(status),$(error checkIfEmpty(xyz) failed))
|
||||
#$(call checkIfEmpty,setTRUE xyz)
|
||||
#$(if $(status),$(error checkIfEmpty(xyz) failed))
|
||||
xyz=abc
|
||||
$(info STATUS: warnIfEmpty - two vars)
|
||||
$(call warnIfEmpty,foo xyz bar)
|
||||
$(info STATUS: errorIfEmpty - on first var)
|
||||
$(call errorIfEmpty,foo xyz bar)
|
||||
$(error TEST FAILED: processing should not reach this point)
|
||||
endif #}
|
||||
|
||||
# Verify subargv expansion
|
||||
##########################
|
||||
subargs=foo bar tans fans
|
||||
subargs_exp=tans fans
|
||||
subargs_found=$(call subargv,4,$(subargs))
|
||||
ifneq ($(subargs_exp),$(subargs_found))
|
||||
$(error subargv(4,$(subargs)): expected [$(subargs_exp)] found [$(subargs_found)])
|
||||
endif
|
@ -1,84 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
ifdef VERBOSE
|
||||
$(warning loading test)
|
||||
endif
|
||||
|
||||
space=$(null) $(null)
|
||||
GENERATED_DIRS = bogus # test data
|
||||
|
||||
undefine USE_AUTOTARGETS_MK
|
||||
undefine INCLUDED_AUTOTARGETS_MK
|
||||
include $(topsrcdir)/config/makefiles/autotargets.mk
|
||||
|
||||
ifndef INCLUDED_AUTOTARGETS_MK
|
||||
$(error autotargets.mk was not included
|
||||
endif
|
||||
|
||||
$(call requiredfunction,mkdir_deps)
|
||||
|
||||
|
||||
# Verify test data populated makefile vars correctly
|
||||
vars = AUTO_DEPS GARBAGE_DIRS GENERATED_DIRS_DEPS
|
||||
$(foreach var,$(vars),$(call errorIfEmpty,$(var)))
|
||||
|
||||
# Data should also be valid
|
||||
ifneq (bogus,$(findstring bogus,$(AUTO_DEPS)))
|
||||
$(error AUTO_DEPS=[$(AUTO_DEPS)] is not set correctly)
|
||||
endif
|
||||
|
||||
|
||||
# relpath
|
||||
path := foo/bar.c
|
||||
exp := foo/.mkdir.done
|
||||
found := $(call mkdir_deps,$(dir $(path)))
|
||||
ifneq ($(exp),$(found))
|
||||
$(error mkdir_deps($(path))=$(exp) not set correctly [$(found)])
|
||||
endif
|
||||
|
||||
# abspath
|
||||
path := /foo//bar/
|
||||
exp := /foo/bar/.mkdir.done
|
||||
found := $(call mkdir_deps,$(path))
|
||||
ifneq ($(exp),$(found))
|
||||
$(error mkdir_deps($(path))=$(exp) not set correctly [$(found)])
|
||||
endif
|
||||
|
||||
|
||||
## verify strip_slash
|
||||
#####################
|
||||
|
||||
path := a/b//c///d////e/////
|
||||
exp := a/b/c/d/e/.mkdir.done
|
||||
found := $(call mkdir_deps,$(path))
|
||||
ifneq ($(exp),$(found))
|
||||
$(error mkdir_deps($(path))=$(exp) not set correctly [$(found)])
|
||||
endif
|
||||
|
||||
|
||||
## verify mkdir_stem()
|
||||
######################
|
||||
path := verify/mkdir_stem
|
||||
pathD = $(call mkdir_deps,$(path))
|
||||
pathS = $(call mkdir_stem,$(pathD))
|
||||
exp := $(path)
|
||||
|
||||
ifeq ($(pathD),$(pathS))
|
||||
$(error mkdir_deps and mkdir_stem should not match [$(pathD)])
|
||||
endif
|
||||
ifneq ($(pathS),$(exp))
|
||||
$(error mkdir_stem=[$(pathS)] != exp=[$(exp)])
|
||||
endif
|
||||
|
||||
|
||||
## Verify embedded whitespace has been protected
|
||||
path := a/b$(space)c//d
|
||||
exp := a/b$(space)c/d
|
||||
found := $(call slash_strip,$(path))
|
||||
ifneq ($(exp),$(found))
|
||||
$(error slash_strip($(path))=$(exp) not set correctly [$(found)])
|
||||
endif
|
@ -1,70 +0,0 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# Verify dependencies are available
|
||||
$(call requiredfunction,getargv subargv is_XinY errorifneq)
|
||||
|
||||
ifdef VERBOSE
|
||||
$(warning loading test)
|
||||
endif
|
||||
|
||||
zero := 0
|
||||
one := 1
|
||||
|
||||
# Verify 'invalid' is not matched
|
||||
val := invalid
|
||||
$(call errorifneq,$(zero),$(words $(call is_XinY,foo,$(val))))
|
||||
$(call errorifneq,$(zero),$(words $(call is_XinY,clean,$(val))))
|
||||
$(call errorifneq,$(zero),$(words $(call is_XinY,clean%,$(val))))
|
||||
|
||||
# verify strcmp('clean')
|
||||
val := clean
|
||||
$(call errorifneq,$(zero),$(words $(call is_XinY,foo,$(val))))
|
||||
$(call errorifneq,$(one),$(words $(call is_XinY,clean,$(val))))
|
||||
$(call errorifneq,$(one),$(words $(call is_XinY,clean%,$(val))))
|
||||
$(call errorifneq,$(one),$(words $(call is_XinY,%clean,$(val))))
|
||||
|
||||
# List match for 'clean'
|
||||
val := blah clean distclean FcleanG clean-level-1
|
||||
wanted := clean distclean clean-level-1
|
||||
$(call errorifneq,$(zero),$(words $(call is_XinY_debug,foo,$(val))))
|
||||
$(call errorifneq,$(one),$(words $(call is_XinY,clean,$(val))))
|
||||
$(call errorifneq,$(one),$(words $(call is_XinY,distclean,$(val))))
|
||||
|
||||
# pattern match 'clean'
|
||||
# match: clean, distclean, clean-level-1
|
||||
# exclude: FcleanG
|
||||
TEST_MAKECMDGOALS := $(val)
|
||||
$(call errorifneq,3,$(words $(call isTargetStemClean)))
|
||||
|
||||
TEST_MAKECMDGOALS := invalid
|
||||
$(call errorifneq,$(zero),$(words $(call isTargetStemClean)))
|
||||
|
||||
|
||||
#############################
|
||||
ifdef VERBOSE
|
||||
$(call banner,Unit test: isTargetStem)
|
||||
endif
|
||||
|
||||
# Verify list argument processing
|
||||
TEST_MAKECMDGOALS := echo
|
||||
$(call errorifneq,$(one),$(words $(call isTargetStem,echo,show)))
|
||||
|
||||
TEST_MAKECMDGOALS := echo-123
|
||||
$(call errorifneq,$(one),$(words $(call isTargetStem,echo,show)))
|
||||
|
||||
TEST_MAKECMDGOALS := show
|
||||
$(call errorifneq,$(one),$(words $(call isTargetStem,echo,show)))
|
||||
|
||||
TEST_MAKECMDGOALS := show-123
|
||||
$(call errorifneq,$(one),$(words $(call isTargetStem,echo,show)))
|
||||
|
||||
TEST_MAKECMDGOALS := show-123-echo
|
||||
$(call errorifneq,$(one),$(words $(call isTargetStem,echo,show)))
|
||||
|
||||
TEST_MAKECMDGOALS := invalid
|
||||
$(call errorifneq,$(zero),$(words $(call isTargetStem,echo,show)))
|
||||
|
@ -1,6 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
@ -16,7 +16,6 @@ DIST_INSTALL = False
|
||||
NoVisibilityFlags()
|
||||
|
||||
CONFIGURE_SUBST_FILES += [
|
||||
'makefiles/test/Makefile',
|
||||
'tests/src-simple/Makefile',
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user