< prev index next >

test/make/UtilsForTests.gmk

Print this page
rev 52919 : 8189861: Refactor CacheFind
Reviewed-by: sgehwolf
   1 #
   2 # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # This file contains utilities common for multiple test makefiles.
  27 
  28 # Assert two strings are equal
  29 # 1 - Tested value
  30 # 2 - Exepected value
  31 # 3 - Error message
  32 define assert-equals
  33   ifneq ($$(strip $1),$$(strip $2))
  34     $$(error $3 - Expected >$$(strip $2)< - Got >$$(strip $1)<)
  35   endif
  36 endef





  37 
  38 # On macosx, file system timestamps only have 1 second resultion so must add
  39 # sleeps to properly test dependencies.
  40 ifeq ($(OPENJDK_BUILD_OS), macosx)
  41   SLEEP_ON_MAC := sleep 1
  42 endif
   1 #
   2 # Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # This file contains utilities common for multiple test makefiles.
  27 
  28 # Assert two strings are equal
  29 # 1 - Tested value
  30 # 2 - Exepected value
  31 # 3 - Error message
  32 AssertEquals = \
  33     $(if $(call equals, $(strip $1), $(strip $2)), , \
  34       $(info FAILURE: $3) \
  35       $(info Expected: >$(strip $2)<) \
  36       $(info Actual:   >$(strip $1)<) \
  37       $(error $3) \
  38     )
  39 
  40 CreateFile = $(shell $(MKDIR) -p $(call ShellQuote, $(dir $1)) \
  41     && $(TOUCH) $(call ShellQuote, $1))
  42 
  43 # On macosx, file system timestamps only have 1 second resultion so must add
  44 # sleeps to properly test dependencies.
  45 ifeq ($(OPENJDK_BUILD_OS), macosx)
  46   SLEEP_ON_MAC := sleep 1
  47 endif
< prev index next >