pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/regress/infra-unittests



Module Name:    pkgsrc
Committed By:   rillig
Date:           Mon Jun 29 21:24:39 UTC 2020

Modified Files:
        pkgsrc/regress/infra-unittests: haskell.sh

Log Message:
regress/infra-unittests: clean up tests for haskell.mk


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/regress/infra-unittests/haskell.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/regress/infra-unittests/haskell.sh
diff -u pkgsrc/regress/infra-unittests/haskell.sh:1.4 pkgsrc/regress/infra-unittests/haskell.sh:1.5
--- pkgsrc/regress/infra-unittests/haskell.sh:1.4       Mon Jun 29 20:51:25 2020
+++ pkgsrc/regress/infra-unittests/haskell.sh   Mon Jun 29 21:24:39 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: haskell.sh,v 1.4 2020/06/29 20:51:25 rillig Exp $
+# $NetBSD: haskell.sh,v 1.5 2020/06/29 21:24:39 rillig Exp $
 #
 # Tests for mk/haskell.mk.
 #
@@ -325,15 +325,17 @@ if test_case_begin 'missing, update=no';
        create_file_lines "$destdir$prefix/share/doc/x86_64-netbsd-ghc-8.8.1/asn1-parse-0.9.5/html/synopsis.png" ''
        create_file_lines "$destdir$prefix/share/doc/x86_64-netbsd-ghc-8.8.1/asn1-parse-0.9.5/LICENSE" ''
 
+       # By default, the PLIST file is not updated.
        "$make" 'plist' 1> "$tmpdir/output" 2>&1 \
        && exitcode=0 || exitcode=$?
 
        assert_that "$tmpdir/output" --file-is-empty
 
-       "$make" 'print-PLIST' 1> "$tmpdir/output" 2>&1 \
+       # Manually generating the PLIST file works though.
+       "$make" 'print-PLIST' 1> "manual-PLIST" 2>&1 \
        && exitcode=0 || exitcode=$?
 
-       assert_that "$tmpdir/output" --file-is-lines \
+       assert_that "manual-PLIST" --file-is-lines \
                '@comment $''NetBSD$' \
                '${HS_INTF}/package-description' \
                '${HS_INTF}/package-id' \
@@ -358,54 +360,6 @@ if test_case_begin 'missing, update=no';
 fi
 
 
-if test_case_begin 'plain, update=yes'; then
-
-       # TODO
-
-       test_case_end
-fi
-
-
-if test_case_begin 'outdated, update=yes'; then
-
-       # TODO
-
-       test_case_end
-fi
-
-
-if test_case_begin 'lib-ok, update=yes'; then
-
-       # TODO
-
-       test_case_end
-fi
-
-
-if test_case_begin 'plain, update=no'; then
-
-       # TODO
-
-       test_case_end
-fi
-
-
-if test_case_begin 'outdated, update=no'; then
-
-       # TODO
-
-       test_case_end
-fi
-
-
-if test_case_begin 'lib-ok, update=no'; then
-
-       # TODO
-
-       test_case_end
-fi
-
-
 if test_case_begin 'neither package-id nor package-description'; then
 
        # example: textproc/hs-cgrep
@@ -464,7 +418,23 @@ if test_case_begin 'package-description,
 
        # example: devel/hs-fail
 
-       # TODO
+       create_file 'Makefile' <<-'EOF'
+               DISTNAME=       package-1.0
+
+               .include "../../main.mk"
+               .include "../../mk/haskell.mk"
+       EOF
+       create_file 'PLIST' <<-'EOF'
+               ${HS_INTF}/package-description
+               ${HS_INTF}/package-id
+               share/doc/x86_64-netbsd-ghc-8.8.1/fail-${PKGVERSION}/LICENSE
+       EOF
+
+       "$make" 'show-plist-status' 1> "$tmpdir/output" 2>&1 \
+       && exitcode=0 || exitcode=$?
+
+       assert_that "$tmpdir/output" --file-is-lines \
+               'PLIST status: lib-ok'
 
        test_case_end
 fi
@@ -474,7 +444,29 @@ if test_case_begin 'package-description 
 
        # example: security/hs-SHA
 
-       # TODO
+       create_file 'Makefile' <<-'EOF'
+               DISTFILE=       package-1.0
+               .include "../../main.mk"
+               .include "../../mk/haskell.mk"
+       EOF
+       create_file 'PLIST' <<-'EOF'
+               ${HS_INTF}/package-description
+               ${HS_INTF}/package-id
+               ${HS_IMPL}/Data/Digest/Pure/SHA.dyn_hi
+               ${HS_IMPL}/Data/Digest/Pure/SHA.hi
+               ${HS_IMPL}/Data/Digest/Pure/SHA.p_hi
+               ${HS_IMPL}/libHS${HS_PKGID}.a
+               ${HS_IMPL}/libHS${HS_PKGID}_p.a
+               lib/${HS_PLATFORM}/libHS${HS_PKGID}-${HS_VER}.so
+               ${HS_DOCS}/LICENSE
+               ${HS_DOCS}/html/Data-Digest-Pure-SHA.html
+       EOF
+
+       "$make" 'show-plist-status' 1> "$tmpdir/output" 2>&1 \
+       && exitcode=0 || exitcode=$?
+
+       assert_that "$tmpdir/output" --file-is-lines \
+               'PLIST status: lib-ok'
 
        test_case_end
 fi



Home | Main Index | Thread Index | Old Index