Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tommy Webb
Tor Browser
Commits
cce533a6
Commit
cce533a6
authored
12 years ago
by
Joey Armstrong
Browse files
Options
Downloads
Patches
Plain Diff
Bug 735638 - replace functions that were removed by errant b-s merge - r=khuey
parent
108ddb2e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/makefiles/makeutils.mk
+14
-0
14 additions, 0 deletions
config/makefiles/makeutils.mk
config/makefiles/test/Makefile.in
+34
-0
34 additions, 0 deletions
config/makefiles/test/Makefile.in
with
48 additions
and
0 deletions
config/makefiles/makeutils.mk
+
14
−
0
View file @
cce533a6
...
...
@@ -34,3 +34,17 @@ argv +=)
## $(call banner,ref) ; ref=foo bar tans
## getarglist() would be a more accurate name but is longer to type
getargv
=
$(
if
$(
call isvar,
$(
1
))
,
$($(
1
))
,
$(
argv
))
## http://www.gnu.org/software/make/manual/make.html#Call-Function
## Usage: o = $(call map,origin,o map $(MAKE))
map
=
$(
foreach val,
$(
2
)
,
$(
call
$(
1
)
,
$(
val
)))
# Usage: $(call checkIfEmpty,[error|warning] foo NULL bar)
checkIfEmpty
=
$(
foreach var,
$(
wordlist 2,100,
$(
getargv
))
,
$(
if
$(
strip
$($(
var
)))
,
$(
NOP
)
,
$(
call
$(
1
)
,Variable
$(
var
)
does not contain a value
)))
# Usage: $(call errorIfEmpty,foo NULL bar)
errorIfEmpty
=
$(
call checkIfEmpty,error
$(
getargv
))
warnIfEmpty
=
$(
call checkIfEmpty,warning
$(
getargv
))
This diff is collapsed.
Click to expand it.
config/makefiles/test/Makefile.in
+
34
−
0
View file @
cce533a6
...
...
@@ -36,6 +36,14 @@ $(info =========================================================================
$(info Running test
:
$(MAKECMDGOALS): pwd=$(CURDIR))
$(info
===========================================================================)
ifdef
VERBOSE
$(info
)
$(info
===========================================================================)
$(info Running test
:
istype
,
getargv)
$(info
===========================================================================)
endif
## Silent errors are oh so much fun
ifndef
istype
$(
error
makeutils.mk was not included
)
...
...
@@ -90,6 +98,32 @@ 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
endif
# check in MAKECMDGOALS
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment