diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-30 20:55:55 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-09-05 16:33:50 +0300 |
commit | a6bf026d143b559ac0358dfd4b89f317901fd02e (patch) | |
tree | 77d47f219e97c222a641749af0ad1d3f0e366b53 /tests | |
parent | ad801af7a975a5400f798c77d3d9cdaf3ed5121a (diff) |
Make version revision optional
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manifest/testscript | 1166 | ||||
-rw-r--r-- | tests/package-version/driver.cxx | 23 |
2 files changed, 598 insertions, 591 deletions
diff --git a/tests/manifest/testscript b/tests/manifest/testscript index 9406a2a..2af195d 100644 --- a/tests/manifest/testscript +++ b/tests/manifest/testscript @@ -2,294 +2,385 @@ # copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -: packages +: package : { + test.options += -p + : name : { : valid : - $* -pp <<EOF >>EOF + $* <<EOF >>EOF : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : name: libfoo.c++-2 version: 2.0.0 summary: Modern C++ parser license: LGPLv2 url: http://www.example.org/projects/libfoo/ email: libfoo-users@example.org - location: libfoo.c++-2-2.0.0.tar.bz2 - sha256sum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EOF - : invalid + : short : - { - : short - : - $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: length is less than two characters' != 0 - : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: b - EOI + $* <<EOI 2>'stdin:2:7: error: invalid package name: length is less than two characters' != 0 + : 1 + name: b + EOI - : illegal - : - $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal name' != 0 - : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: com3 - EOI + : illegal + : + $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal name' != 0 + : 1 + name: com3 + EOI + + : illegal-first-char + : + $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal first character (must be alphabetic)' != 0 + : 1 + name: 2b + EOI + + : illegal-last-char + : + $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal last character (must be alphabetic, digit, or plus)' != 0 + : 1 + name: foo_ + EOI + + : illegal-char + : + $* <<EOI 2>'stdin:2:7: error: invalid package name: illegal character' != 0 + : 1 + name: foo'bar + EOI + } + + : upstream-version + : + { + : valid + : + $* <<EOF >>EOF + : 1 + name: libfoo + version: 2.0.0 + upstream-version: 0.28.0.abc.15 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + EOF + + : duplicate + : + $* <<EOI 2>>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + upstream-version: 0.28.0.abc.15 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + upstream-version: 0.28.0.abc.15 + EOI + stdin:8:1: error: upstream package version redefinition + EOE + + : stub + : + $* <<EOI 2>>EOE != 0 + : 1 + name: libfoo + version: 0+1 + upstream-version: 0.28.0.abc.15 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + EOI + stdin:4:1: error: upstream package version specified for a stub + EOE + } + + : topics + : + { + : valid + : + $* <<EOF >>EOF + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + topics: c++ library, foo library, libfoo + EOF + + : too-many + : + $* <<EOI 2>>EOE != 0 + : 1 + topics: c++, library, lib, foo, libfoo, libbar + EOI + stdin:2:9: error: up to five topics allowed + EOE + } + + : keywords + : + { + : valid + : + $* <<EOF >>EOF + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + keywords: c++ library lib foo libfoo + EOF + + : redefinition + : + $* <<EOI 2>>EOE != 0 + : 1 + keywords: c++ library lib foo libfoo + keywords: c++ library lib foo libfoo + EOI + stdin:3:1: error: package keywords redefinition + EOE + + : too-many + : + $* <<EOI 2>>EOE != 0 + : 1 + keywords: c++ library lib foo libfoo libbar + EOI + stdin:2:11: error: up to five keywords allowed + EOE + + : empty + : + $* <<EOI 2>>EOE != 0 + : 1 + keywords: + EOI + stdin:2:10: error: empty package keywords specification + EOE + } + + : tags + : + { + : truncate + : + $* <<EOI >>EOO + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + tags: c++, library, lib, foo, libfoo, libbar + EOI + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + keywords: c++ library lib foo libfoo + EOO + + : with-space + : + $* <<EOI 2>>EOE != 0 + : 1 + tags: c++ library, lib, foo, libfoo + EOI + stdin:2:7: error: only single-word tags allowed + EOE + } - : first-char + : description-file + : + { + : absolute-path + : + $* <<EOI 2>>~%EOE% != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description-file: /README + EOI + %( + stdin:6:19: error: package description-file path is absolute + %| + stdin:6:19: error: invalid package description file: invalid filesystem path + %) + EOE + } + + : description-type + : + { + : absent + : + $* <<EOF >>EOF + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + EOF + + : not-text + : + $* <<EOI 2>>EOE != 0 + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + description-type: image/gif + EOI + stdin:7:19: error: invalid package description type: text type expected + EOE + + : deducing + : + { + : fail : - $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal first character (must be alphabetic)' != 0 + $* <<EOI 2>>EOE != 0 : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: 2b + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description-file: README.rtf EOI + stdin:6:19: error: invalid package description file: unknown text type + EOE - : last-char + : ignore-unknown : - $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal last character (must be alphabetic, digit, or plus)' != 0 + $* -i <<EOF >>EOF : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: foo_ - EOI + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description-file: README.rtf + EOF + } - : char + : unknown + : + { + : fail : - $* -pp <<EOI 2>'stdin:4:7: error: invalid package name: illegal character' != 0 + $* <<EOI 2>>EOE != 0 : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: foo'bar + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + description-type: text/markdowns EOI + stdin:7:19: error: invalid package description type: unknown text type + EOE - : dependency + : ignore : - $* -pp <<EOI 2>'stdin:8:10: error: invalid prerequisite package name: length is less than two characters' != 0 + $* -i <<EOF >>EOF : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: foo + name: libfoo version: 2.0.0 summary: Modern C++ parser license: LGPLv2 - depends: b - EOI + description: libfoo is a very modern C++ XML parser. + description-type: text/markdowns + EOF + } - : dependency-constraint + : plain + : + { + : valid : - $* -pp <<EOI 2>'stdin:8:10: error: $ not allowed' != 0 + $* <<EOF >>EOF : 1 - sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - : - name: foo + name: libfoo version: 2.0.0 summary: Modern C++ parser license: LGPLv2 - depends: bar == $ - EOI + description: libfoo is a very modern C++ XML parser. + description-type: text/plain + EOF - : dependency-constraint-version + : invalid : - $* -p -c <<EOI 2>'stdin:6:10: error: invalid dependency constraint: min version is greater than max version' != 0 + $* <<EOI 2>>EOE != 0 : 1 - name: foo + name: libfoo version: 2.0.0 summary: Modern C++ parser license: LGPLv2 - depends: bar [$ 1.0.0] + description: libfoo is a very modern C++ XML parser. + description-type: text/plain; EOI + stdin:7:19: error: invalid package description type: missing '=' + EOE } - } - : pkg - : - { - : manifest + : markdown : { - test.options += -p - - : invalid + : default : - { - : description-file - : - $* <<EOI 2>>~%EOE% != 0 - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description-file: /README - EOI - %( - stdin:6:19: error: package description-file path is absolute - %| - stdin:6:19: error: invalid package description file: invalid filesystem path - %) - EOE - - : url - : - { - : no-scheme - : - $* <<EOI 2>>EOE != 0 - : 1 - src-url: libfoo - EOI - stdin:2:10: error: invalid src url: no scheme - EOE - - : rootless - : - $* <<EOI 2>>EOE != 0 - : 1 - src-url: pkcs11:libfoo - EOI - stdin:2:10: error: invalid src url: rootless URL - EOE - - : local - : - $* <<EOI 2>>EOE != 0 - : 1 - src-url: file:/libfoo/bar - EOI - stdin:2:10: error: invalid src url: local URL - EOE - - : authority-absent - : - $* <<EOI 2>>EOE != 0 - : 1 - src-url: http:/libfoo/bar - EOI - stdin:2:10: error: invalid src url: no authority - EOE - - : authority-empty - : - $* <<EOI 2>>EOE != 0 - : 1 - src-url: http:///libfoo/bar - EOI - stdin:2:10: error: invalid src url: no authority - EOE - } - } + $* <<EOF >>EOF + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + description-type: text/markdown + EOF - : complete + : gfm : - { - test.options += -c - - : final - : - $* <<EOI >>EOO - : 1 - name: foo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) - EOI - : 1 - name: foo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - depends: bar == 2.0.0 | libbaz ~2.0.0 | libbox ^2.0.0 | libfox [1.0 2.0.0) - EOO - - : non-standard - : - $* <<EOI >>EOO - : 1 - name: foo - version: 2.0.0-x - summary: Modern C++ parser - license: LGPLv2 - depends: bar == $ | libfox [1.0 $) - EOI - : 1 - name: foo - version: 2.0.0-x - summary: Modern C++ parser - license: LGPLv2 - depends: bar == 2.0.0-x | libfox [1.0 2.0.0-x) - EOO - - : non-standard-shortcut - : - $* <<EOI 2>>EOE != 0 - : 1 - name: foo - version: 2.0.0-x - summary: Modern C++ parser - license: LGPLv2 - depends: bar ~$ - EOI - stdin:6:10: error: invalid dependency constraint: dependent version is not standard - EOE - - : latest-snapshot - : - $* <<EOI >>EOO - : 1 - name: foo - version: 2.0.0-a.0.z - summary: Modern C++ parser - license: LGPLv2 - depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) - EOI - : 1 - name: foo - version: 2.0.0-a.0.123 - summary: Modern C++ parser - license: LGPLv2 - depends: bar == 2.0.0-a.0.123 | libbaz [2.0.0-a.0.1 2.0.0-a.1) | libbox\ - [2.0.0-a.0.1 2.0.0-a.1) | libfox [1.0 2.0.0-a.0.123) - EOO - - } + $* <<EOF >>EOF + : 1 + name: libfoo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + description: libfoo is a very modern C++ XML parser. + description-type: text/markdown; variant=GFM + EOF - : incomplete + : common-mark : $* <<EOF >>EOF : 1 - name: foo + name: libfoo version: 2.0.0 summary: Modern C++ parser license: LGPLv2 - depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) + description: libfoo is a very modern C++ XML parser. + description-type: text/markdown; variant=CommonMark EOF - : description-type + : invalid-variant : { - : absent - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - EOF - - : not-text + : fail : $* <<EOI 2>>EOE != 0 : 1 @@ -298,364 +389,251 @@ summary: Modern C++ parser license: LGPLv2 description: libfoo is a very modern C++ XML parser. - description-type: image/gif + description-type: text/markdown; variant=Original EOI - stdin:7:19: error: invalid package description type: text type expected + stdin:7:19: error: invalid package description type: unknown text type EOE - : deducing - : - { - : fail - : - $* <<EOI 2>>EOE != 0 - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description-file: README.rtf - EOI - stdin:6:19: error: invalid package description file: unknown text type - EOE - - : ignore-unknown - : - $* -i <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description-file: README.rtf - EOF - } - - : unknown - : - { - : fail - : - $* <<EOI 2>>EOE != 0 - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdowns - EOI - stdin:7:19: error: invalid package description type: unknown text type - EOE - - : ignore - : - $* -i <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdowns - EOF - } - - : plain + : ignore : - { - : valid - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/plain - EOF - - : invalid - : - $* <<EOI 2>>EOE != 0 - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/plain; - EOI - stdin:7:19: error: invalid package description type: missing '=' - EOE - } - - : markdown - : - { - : default - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown - EOF - - : gfm - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown; variant=GFM - EOF - - : common-mark - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown; variant=CommonMark - EOF - - : invalid-variant - : - { - : fail - : - $* <<EOI 2>>EOE != 0 - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown; variant=Original - EOI - stdin:7:19: error: invalid package description type: unknown text type - EOE - - : ignore - : - $* -i <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown; variant=Original - EOF - } - - : invalid-parameter - : - { - : fail - : - $* <<EOI 2>>EOE != 0 - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown; variants=GFM - EOI - stdin:7:19: error: invalid package description type: unknown text type - EOE - - : ignore - : - $* -i <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - description: libfoo is a very modern C++ XML parser. - description-type: text/markdown; variants=GFM - EOF - } - } - } - - : builds - : - { - : invalid - : - { - : empty - : - $* <<EOI 2>"stdin:2:9: error: invalid package builds: class expression separator ':' expected" != 0 - : 1 - builds: default -gcc - EOI - } - } - - : upstream-version - : - { - : valid - : - $* <<EOF >>EOF + $* -i <<EOF >>EOF : 1 name: libfoo version: 2.0.0 - upstream-version: 0.28.0.abc.15 summary: Modern C++ parser license: LGPLv2 description: libfoo is a very modern C++ XML parser. + description-type: text/markdown; variant=Original EOF + } - : duplicate + : invalid-parameter + : + { + : fail : $* <<EOI 2>>EOE != 0 : 1 name: libfoo version: 2.0.0 - upstream-version: 0.28.0.abc.15 summary: Modern C++ parser license: LGPLv2 description: libfoo is a very modern C++ XML parser. - upstream-version: 0.28.0.abc.15 + description-type: text/markdown; variants=GFM EOI - stdin:8:1: error: upstream package version redefinition + stdin:7:19: error: invalid package description type: unknown text type EOE - : stub + : ignore : - $* <<EOI 2>>EOE != 0 + $* -i <<EOF >>EOF : 1 name: libfoo - version: 0+1 - upstream-version: 0.28.0.abc.15 + version: 2.0.0 summary: Modern C++ parser license: LGPLv2 description: libfoo is a very modern C++ XML parser. - EOI - stdin:4:1: error: upstream package version specified for a stub - EOE + description-type: text/markdown; variants=GFM + EOF } + } + } - : keywords - : - { - : valid - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - keywords: c++ library lib foo libfoo - EOF + : src-url + : + { + : no-scheme + : + $* <<EOI 2>>EOE != 0 + : 1 + src-url: libfoo + EOI + stdin:2:10: error: invalid src url: no scheme + EOE - : redefinition - : - $* <<EOI 2>>EOE != 0 - : 1 - keywords: c++ library lib foo libfoo - keywords: c++ library lib foo libfoo - EOI - stdin:3:1: error: package keywords redefinition - EOE + : rootless + : + $* <<EOI 2>>EOE != 0 + : 1 + src-url: pkcs11:libfoo + EOI + stdin:2:10: error: invalid src url: rootless URL + EOE - : too-many - : - $* <<EOI 2>>EOE != 0 - : 1 - keywords: c++ library lib foo libfoo libbar - EOI - stdin:2:11: error: up to five keywords allowed - EOE + : local + : + $* <<EOI 2>>EOE != 0 + : 1 + src-url: file:/libfoo/bar + EOI + stdin:2:10: error: invalid src url: local URL + EOE - : empty - : - $* <<EOI 2>>EOE != 0 - : 1 - keywords: - EOI - stdin:2:10: error: empty package keywords specification - EOE - } + : authority-absent + : + $* <<EOI 2>>EOE != 0 + : 1 + src-url: http:/libfoo/bar + EOI + stdin:2:10: error: invalid src url: no authority + EOE - : tags + : authority-empty + : + $* <<EOI 2>>EOE != 0 + : 1 + src-url: http:///libfoo/bar + EOI + stdin:2:10: error: invalid src url: no authority + EOE + } + + : builds + : + { + : empty + : + $* <<EOI 2>"stdin:2:9: error: invalid package builds: class expression separator ':' expected" != 0 + : 1 + builds: default -gcc + EOI + } + + : dependency + : + { + : short-name + : + $* <<EOI 2>'stdin:6:10: error: invalid prerequisite package name: length is less than two characters' != 0 + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: b + EOI + + : invalid-version-range + : + $* -c <<EOI 2>'stdin:6:10: error: invalid dependency constraint: min version is greater than max version' != 0 + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: bar [$ 1.0.0] + EOI + + : corner-case + : + $* <<EOF >>EOF + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: bar [1.0.0+2 1.0.0] + EOF + + : complete + : + { + test.options += -c + + : final : - { - : truncate - : - $* <<EOI >>EOO - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - tags: c++, library, lib, foo, libfoo, libbar - EOI - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - keywords: c++ library lib foo libfoo - EOO + $* <<EOI >>EOO + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) + EOI + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: bar == 2.0.0 | libbaz ~2.0.0 | libbox ^2.0.0 | libfox [1.0 2.0.0) + EOO - : with-space - : - $* <<EOI 2>>EOE != 0 - : 1 - tags: c++ library, lib, foo, libfoo - EOI - stdin:2:7: error: only single-word tags allowed - EOE - } + : non-standard + : + $* <<EOI >>EOO + : 1 + name: foo + version: 2.0.0-x + summary: Modern C++ parser + license: LGPLv2 + depends: bar == $ | libfox [1.0 $) + EOI + : 1 + name: foo + version: 2.0.0-x + summary: Modern C++ parser + license: LGPLv2 + depends: bar == 2.0.0-x | libfox [1.0 2.0.0-x) + EOO - : topics + : non-standard-shortcut : - { - : valid - : - $* <<EOF >>EOF - : 1 - name: libfoo - version: 2.0.0 - summary: Modern C++ parser - license: LGPLv2 - topics: c++ library, foo library, libfoo - EOF + $* <<EOI 2>>EOE != 0 + : 1 + name: foo + version: 2.0.0-x + summary: Modern C++ parser + license: LGPLv2 + depends: bar ~$ + EOI + stdin:6:10: error: invalid dependency constraint: dependent version is not standard + EOE + + : latest-snapshot + : + $* <<EOI >>EOO + : 1 + name: foo + version: 2.0.0-a.0.z + summary: Modern C++ parser + license: LGPLv2 + depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) + EOI + : 1 + name: foo + version: 2.0.0-a.0.123 + summary: Modern C++ parser + license: LGPLv2 + depends: bar == 2.0.0-a.0.123 | libbaz [2.0.0-a.0.1 2.0.0-a.1) | libbox\ + [2.0.0-a.0.1 2.0.0-a.1) | libfox [1.0 2.0.0-a.0.123) + EOO - : too-many - : - $* <<EOI 2>>EOE != 0 - : 1 - topics: c++, library, lib, foo, libfoo, libbar - EOI - stdin:2:9: error: up to five topics allowed - EOE - } } - : manifest-list + : incomplete : - : Roundtrip the pkg package manifest list. + $* <<EOF >>EOF + : 1 + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: bar == $ | libbaz ~$ | libbox ^$ | libfox [1.0 $) + EOF + } +} + +: package-list +: +{ + : pkg + : + { + test.options += -pp + + : roundtrip : - $* -pp <<EOF >>EOF + $* <<EOF >>EOF : 1 sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 : @@ -725,22 +703,37 @@ location: libbaz/libbaz-+2-3.4A.5+3.tar.gz sha256sum: b5b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EOF + + : dependency + : + { + : incomplete + : + $* <<EOI 2>'stdin:8:10: error: $ not allowed' != 0 + : 1 + sha256sum: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + : + name: foo + version: 2.0.0 + summary: Modern C++ parser + license: LGPLv2 + depends: bar == $ + EOI + } } : dir : { + test.options += -dp + : empty : - : Roundtrip an empty dir package manifest list. - : - $* -gp <"" >:"" + $* <"" >:"" : non-empty : - : Roundtrip the dir package manifest list. - : - $* -gp <<EOF >>EOF + $* <<EOF >>EOF : 1 location: hello/ : @@ -749,7 +742,7 @@ : duplicate : - $* -gp <<EOI 2>'stdin:5:1: error: duplicate package manifest' != 0 + $* <<EOI 2>'stdin:5:1: error: duplicate package manifest' != 0 : 1 location: hello/ : @@ -762,9 +755,11 @@ : git : { + test.options += -gp + : fragment : - $* -gp <<EOF >>EOF + $* <<EOF >>EOF : 1 location: hello/ fragment: ca602c2d46b0dca7a9ebc856871767b0ba6b74f3 @@ -775,39 +770,17 @@ } } -: repositories +: repository-list : { - : base-manifest-redefinition - : - $* -pr <<EOI 2>'stdin:3:1: error: base repository manifest redefinition' != 0 - : 1 - url: http://cppget.org - : - url: http://cppget.org - EOI - - : no-base - : - $* -pr <<EOO >>EOO - : 1 - location: http://pkg.example.org/1/math - type: pkg - role: prerequisite - : - location: ../stable - type: pkg - role: complement - EOO - : pkg : { - : manifest - : - : Roundtrip the pkg repository manifest list. + test.options += -pr + + : roundtrip : - $* -pr <<EOF >>EOF + $* <<EOF >>EOF : 1 location: http://pkg.example.org/1/math type: pkg @@ -858,7 +831,7 @@ : prerequisite-type : - $* -pr <<EOI >>EOO + $* <<EOI >>EOO : 1 url: http://cppget.org : @@ -904,16 +877,38 @@ trust: 37:CE:2C:A5:1D:CF:93:81:D7:07:46:AD:66:B3:C3:90:83:B8:96:9E:34:F0:E7:B\ 3:A2:B0:6C:EF:66:A4:BE:65 EOO + + : no-base + : + $* <<EOO >>EOO + : 1 + location: http://pkg.example.org/1/math + type: pkg + role: prerequisite + : + location: ../stable + type: pkg + role: complement + EOO + + : base-manifest-redefinition + : + $* <<EOI 2>'stdin:3:1: error: base repository manifest redefinition' != 0 + : 1 + url: http://cppget.org + : + url: http://cppget.org + EOI } : git : { - : manifest - : - : Roundtrip the git repository manifest list. + test.options += -gr + + : roundtrip : - $* -gr <<EOF >>EOF + $* <<EOF >>EOF : 1 location: http://example.org/math.git#master type: git @@ -936,7 +931,7 @@ : fragment : - $* -gr <<EOF >>EOF + $* <<EOF >>EOF : 1 location: http://example.org/math.git#master type: git @@ -972,7 +967,7 @@ : prerequisite-type : - $* -gr <<EOI >>EOO + $* <<EOI >>EOO : 1 location: http://example.org/math.git#master role: prerequisite @@ -1013,11 +1008,11 @@ : dir : { - : manifest - : - : Roundtrip the dir repository manifest list. + test.options += -dr + + : roundtrip : - $* -dr <<EOF >>EOF + $* <<EOF >>EOF : 1 location: ../stable type: dir @@ -1027,7 +1022,7 @@ : prerequisite-with-fragment : - $* -dr <<EOI 2>>EOE != 0 + $* <<EOI 2>>EOE != 0 : 1 location: ../stable.git#stable type: dir @@ -1039,13 +1034,10 @@ } } - : signature : -: Roundtrip the signature manifest. -: { - : manifest + : roundtrip : $* -s <<EOF >>EOF : 1 diff --git a/tests/package-version/driver.cxx b/tests/package-version/driver.cxx index e81115a..5cf7e09 100644 --- a/tests/package-version/driver.cxx +++ b/tests/package-version/driver.cxx @@ -123,6 +123,7 @@ namespace bpkg assert (bad_version ("1-a.00000000000000000")); // Same. assert (bad_version (0, "1", "", 1)); // Revision for empty release. + assert (bad_version (0, "1", "", 0)); // Same. assert (bad_version (1, "+1-1.1", "", 2)); // Epoch in upstream. assert (bad_version (1, "1.1-1", "", 2)); // Release in upstream. assert (bad_version (1, "1.1+1", "", 2)); // Revision in upstream. @@ -133,6 +134,7 @@ namespace bpkg assert (bad_version (1, "", "", 0)); // Unexpected epoch. assert (bad_version (0, "", "1", 0)); // Unexpected release. assert (bad_version (0, "", "", 1)); // Unexpected revision. + assert (bad_version (0, "", "", 0)); // Same. assert (bad_version (0, "", "", 0, 1)); // Unexpected iteration. { @@ -243,12 +245,24 @@ namespace bpkg assert (test_constructor (v)); } { + version v ("+10-B"); + assert (v.string () == "+10-B"); + assert (v.canonical_upstream == "b"); + assert (test_constructor (v)); + } + { version v ("+10-B+0"); assert (v.string () == "+10-B"); assert (v.canonical_upstream == "b"); assert (test_constructor (v)); } { + version v ("+10-B+0", false /* fold_zero_revision */); + assert (v.string () == "+10-B+0"); + assert (v.canonical_upstream == "b"); + assert (test_constructor (v)); + } + { version v ("+3-1A.31.0.4.0+7"); assert (v.string () == "+3-1A.31.0.4.0+7"); assert (v.canonical_upstream == @@ -298,7 +312,7 @@ namespace bpkg assert (test_constructor (v)); } { - version v (2, "1", string (), 0, 0); + version v (2, "1", string (), nullopt, 0); assert (v.string () == "+2-1-"); assert (v.release && v.release->empty ()); assert (v.canonical_release.empty ()); @@ -311,7 +325,8 @@ namespace bpkg assert (v.string (true, false) == "+3-2.0"); assert (v.string (false, true) == "+3-2.0+3"); - assert (version (3, "2.0", nullopt, 0, 1).string () == "+3-2.0#1"); + assert (version (3, "2.0", nullopt, nullopt, 1).string () == "+3-2.0#1"); + assert (version (3, "2.0", nullopt, 0, 1).string () == "+3-2.0+0#1"); assert (version (3, "2.0", nullopt, 1, 0).string () == "+3-2.0+1"); } @@ -363,8 +378,8 @@ namespace bpkg assert (version ("1.1.1a+1") < version ("1.1.1b")); assert (version (1, "2.0", nullopt, 3, 0) == version ("+1-2+3")); - assert (version (1, "2.0", string (), 0, 0) == version ("+1-2-")); - assert (version (0, "", string (), 0, 0) == version ()); + assert (version (1, "2.0", string (), nullopt, 0) == version ("+1-2-")); + assert (version (0, "", string (), nullopt, 0) == version ()); assert (version (1, "2.0", nullopt, 3, 4).compare ( version (1, "2.0", nullopt, 3, 4)) == 0); |