From 572ecb49ee367e0bbe237431f190127b408db723 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 23 Apr 2019 12:23:04 -0400 Subject: tests/aux/common.sh: Add is() Copied from opkbuild. --- (limited to 'tests/aux') diff --git a/tests/aux/common.sh b/tests/aux/common.sh index 27db133..3082ab0 100644 --- a/tests/aux/common.sh +++ b/tests/aux/common.sh @@ -1,6 +1,6 @@ # Common testsuite functions # -# Copyright (C) 2019 Patrick McDermott +# Copyright (C) 2018, 2019 Patrick McDermott # # This file is part of the ProteanOS Development Kit. # @@ -21,6 +21,23 @@ LF=' ' +is() +{ + local description="${1}" + local got="${2}" + local expected="${3}" + shift 3 + + if [ "x${got}" = "x${expected}" ]; then + ok_ -- "${description}" + else + not_ok_ -- "${description}" + diag_ " Failed test '${description}'" + diag_ " got: '${got}'" + diag_ " expected: '${expected}'" + fi +} + # is_diff() is based on cmd_is() from opkbuild 4.0.2, with test results passed # by argument and context added to the diagnostic output. is_diff() -- cgit v0.9.1