public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH cygport 1/2] Add test which compares hints with expected
Date: Sat, 08 Feb 2020 13:47:00 -0000	[thread overview]
Message-ID: <20200208134634.58200-2-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20200208134634.58200-1-jon.turney@dronecode.org.uk>

Extend test-driver so it can compare hints with expected
Add a test of hints for a cygport which creates a single package
Add a test of hints for a cygport which creates multiple packages
---
 testsuite/hints/meson.build                   |  1 +
 .../libmultiple-devel-3.14-1.hint             |  6 ++++
 .../libmultiple1/libmultiple1-3.14-1.hint     |  6 ++++
 .../dist/multiple/multiple-3.14-1.hint        |  6 ++++
 testsuite/hints/multiple/multiple.cygport     | 33 +++++++++++++++++++
 testsuite/hints/multiple/multiple.list        |  1 +
 .../obsoleted-by-single-2.3.4-1.hint          |  8 +++++
 .../dist/single/single-2.3.4-1.hint           |  6 ++++
 testsuite/hints/single/single.cygport         | 23 +++++++++++++
 testsuite/hints/single/single.list            |  1 +
 testsuite/meson.build                         |  2 ++
 testsuite/test-driver                         | 17 +++++++++-
 12 files changed, 109 insertions(+), 1 deletion(-)
 create mode 100644 testsuite/hints/meson.build
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
 create mode 100644 testsuite/hints/multiple/multiple.cygport
 create mode 100644 testsuite/hints/multiple/multiple.list
 create mode 100644 testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
 create mode 100644 testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
 create mode 100644 testsuite/hints/single/single.cygport
 create mode 100644 testsuite/hints/single/single.list

diff --git a/testsuite/hints/meson.build b/testsuite/hints/meson.build
new file mode 100644
index 0000000..f905486
--- /dev/null
+++ b/testsuite/hints/meson.build
@@ -0,0 +1 @@
+tests += [['hints/single'], ['hints/multiple']]
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
new file mode 100644
index 0000000..3bb7ad8
--- /dev/null
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple-devel/libmultiple-devel-3.14-1.hint
@@ -0,0 +1,6 @@
+category: libmultiple1
+requires:  
+sdesc: "Summary of hints for multiple package test"
+ldesc: "Description of hints for multiple package test"
+external-source: multiple
+
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
new file mode 100644
index 0000000..989bfb1
--- /dev/null
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/libmultiple1/libmultiple1-3.14-1.hint
@@ -0,0 +1,6 @@
+category: Base
+requires:  cygwin
+sdesc: "Summary of hints for multiple package test"
+ldesc: "Description of hints for multiple package test"
+external-source: multiple
+
diff --git a/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
new file mode 100644
index 0000000..3820e4e
--- /dev/null
+++ b/testsuite/hints/multiple/hints/multiple-3.14-1.x86_64/dist/multiple/multiple-3.14-1.hint
@@ -0,0 +1,6 @@
+category: Base
+requires:
+sdesc: "Summary of hints for multiple package test (source)"
+ldesc: "Description of hints for multiple package test (source)"
+skip:
+
diff --git a/testsuite/hints/multiple/multiple.cygport b/testsuite/hints/multiple/multiple.cygport
new file mode 100644
index 0000000..b269ff5
--- /dev/null
+++ b/testsuite/hints/multiple/multiple.cygport
@@ -0,0 +1,33 @@
+NAME="multiple"
+VERSION=3.14
+RELEASE=1
+SUMMARY="Summary of hints for multiple package test"
+DESCRIPTION="Description of hints for multiple package test"
+
+PKG_NAMES="libmultiple1 libmultiple-devel"
+
+multiple_SUMMARY="Summary of hints for multiple package test (source)"
+multiple_DESCRIPTION="Description of hints for multiple package test (source)"
+multiple_CATEGORY="Base"
+
+libmultiple1_CONTENTS=""
+libmultiple1_CATEGORY="Base"
+libmultiple1_REQUIRES="cygwin"
+
+libmultiple_devel_CONTENTS="usr/include"
+libmultiple_devel_CATEGORY="Devel"
+libmultiple_devel_CATEGORY="libmultiple1"
+
+src_compile() {
+  :
+}
+
+src_install() {
+  cd ${D}
+  mkdir -p usr/include
+  touch usr/include/.keep
+}
+
+src_test() {
+  :
+}
diff --git a/testsuite/hints/multiple/multiple.list b/testsuite/hints/multiple/multiple.list
new file mode 100644
index 0000000..3fa47fd
--- /dev/null
+++ b/testsuite/hints/multiple/multiple.list
@@ -0,0 +1 @@
+/usr/include/.keep
diff --git a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
new file mode 100644
index 0000000..bb7644a
--- /dev/null
+++ b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/obsoleted-by-single/obsoleted-by-single-2.3.4-1.hint
@@ -0,0 +1,8 @@
+category: _obsolete
+requires: single
+sdesc: "Obsoleted by single"
+ldesc: "The obsoleted-by-single package is obsolete.  Selecting this package for
+installation will cause the single package, which replaces this
+one, to be installed instead."
+external-source: single
+
diff --git a/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
new file mode 100644
index 0000000..aa534a0
--- /dev/null
+++ b/testsuite/hints/single/hints/single-2.3.4-1.x86_64/dist/single/single-2.3.4-1.hint
@@ -0,0 +1,6 @@
+category: Base
+requires:  cygwin
+sdesc: "Summary of hints for single package test"
+ldesc: "Description of hints for single package test"
+obsoletes: obsoleted-by-single
+
diff --git a/testsuite/hints/single/single.cygport b/testsuite/hints/single/single.cygport
new file mode 100644
index 0000000..fca0706
--- /dev/null
+++ b/testsuite/hints/single/single.cygport
@@ -0,0 +1,23 @@
+NAME="single"
+VERSION=2.3.4
+RELEASE=1
+SUMMARY="Summary of hints for single package test"
+DESCRIPTION="Description of hints for single package test"
+
+CATEGORY="Base"
+REQUIRES="cygwin"
+OBSOLETES="obsoleted-by-single"
+
+src_compile() {
+  :
+}
+
+src_install() {
+  cd ${D}
+  mkdir usr
+  touch usr/.keep
+}
+
+src_test() {
+  :
+}
diff --git a/testsuite/hints/single/single.list b/testsuite/hints/single/single.list
new file mode 100644
index 0000000..1b1ac0b
--- /dev/null
+++ b/testsuite/hints/single/single.list
@@ -0,0 +1 @@
+/usr/.keep
diff --git a/testsuite/meson.build b/testsuite/meson.build
index ae2d435..cd43e41 100644
--- a/testsuite/meson.build
+++ b/testsuite/meson.build
@@ -15,6 +15,8 @@ python2 = find_program('python2', required: false)
 tests = []
 
 subdir('download')
+subdir('hints')
+
 subdir('aspell')
 subdir('autotools')
 subdir('cmake')
diff --git a/testsuite/test-driver b/testsuite/test-driver
index 00cfbda..30893c4 100755
--- a/testsuite/test-driver
+++ b/testsuite/test-driver
@@ -1,6 +1,7 @@
 #!/bin/bash
 
 set -e
+shopt -s extglob
 
 test=$1
 
@@ -12,8 +13,22 @@ esac
 test -d ${top_builddir}/testsuite/$test || mkdir -p ${top_builddir}/testsuite/$test
 cd ${top_builddir}/testsuite/$test
 
-cp -f ${top_srcdir}/testsuite/$test/* .
+cp -f ${top_srcdir}/testsuite/$test/!(hints) .
 
 DISTDIR=${DISTDIR} ${top_builddir}/bin/cygport-inplace *.cygport clean get all
 
+# compare hints
+for hint in $(find -name \*.hint)
+do
+    if [ -a ${top_srcdir}/testsuite/$test/hints/$hint ];
+    then
+        diff -u ${top_srcdir}/testsuite/$test/hints/$hint $hint
+# uncomment to create the expected hint file for use in future testing
+#    else
+#        mkdir -p $(dirname ${top_srcdir}/testsuite/$test/hints/$hint)
+#        cp $hint ${top_srcdir}/testsuite/$test/hints/$hint
+    fi
+done
+
+# compare filelist
 cmp ${top_srcdir}/testsuite/$test/*.list <(${top_builddir}/bin/cygport-inplace *.cygport list)
-- 
2.21.0

  parent reply	other threads:[~2020-02-08 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 13:47 [PATCH cygport 0/2] Add provides: and conflicts: Jon Turney
2020-02-08 13:47 ` [PATCH cygport 2/2] Add provides: and conflicts: hints Jon Turney
2020-02-08 13:47 ` Jon Turney [this message]
2020-02-22 14:48 ` [PATCH cygport] Generate a separate .hint for the source package Jon Turney
2020-02-22 14:48 ` [PATCH cygport 3/2] " Jon Turney
2020-03-24  3:07 ` [PATCH cygport 0/2] Add provides: and conflicts: Yaakov Selkowitz
2020-04-05 14:17   ` Jon Turney
2020-04-06 23:11     ` Yaakov Selkowitz
2020-04-06 23:11     ` Yaakov Selkowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200208134634.58200-2-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).