1
0
mirror of git://projects.qi-hardware.com/wernermisc.git synced 2024-11-15 09:30:37 +02:00

qpkg: regression test for version preference

- test/verpref: test version preference (higher wins if there's a choice)
- TODO: updated for above change
This commit is contained in:
Werner Almesberger 2010-11-21 23:02:10 -03:00
parent c05e6d5dbb
commit b181db5b9e
2 changed files with 98 additions and 2 deletions

View File

@ -7,8 +7,6 @@ Still left to do
- handle Provides: - handle Provides:
- if there are multiple choices, try to prefer more recent versions
- sort prerequisites such that they can be installed in the specified order - sort prerequisites such that they can be installed in the specified order
- consider Architecture: - consider Architecture:
@ -50,3 +48,5 @@ Done
Update: after merging the two lookups per new node into one, we're at Update: after merging the two lookups per new node into one, we're at
1172642 calls to comp_id, or 102% of the predicted "good case". 1172642 calls to comp_id, or 102% of the predicted "good case".
- if there are multiple choices, try to prefer more recent versions

96
qpkg/test/verpref Executable file
View File

@ -0,0 +1,96 @@
#!/bin/sh
. ./Common
###############################################################################
qpkg "prefer later version (1)" prereq foo <<EOF
Package: bar
Version: 0
Architecture: test
Filename: bar_0
Package: bar
Version: 1
Architecture: test
Filename: bar_1
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo
EOF
expect <<EOF
bar_1
EOF
###############################################################################
qpkg "prefer later version (2)" prereq foo <<EOF
Package: bar
Version: 1
Architecture: test
Filename: bar_1
Package: bar
Version: 0
Architecture: test
Filename: bar_0
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo
EOF
expect <<EOF
bar_1
EOF
###############################################################################
qpkg "dependency trumps preference (1)" prereq foo <<EOF
Package: bar
Version: 0
Architecture: test
Filename: bar_0
Package: bar
Version: 1
Architecture: test
Depends: bad
Filename: bar_1
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo
EOF
expect <<EOF
bar_0
EOF
###############################################################################
qpkg "dependency trumps preference (2)" prereq foo <<EOF
Package: bar
Version: 1
Architecture: test
Depends: bad
Filename: bar_1
Package: bar
Version: 0
Architecture: test
Filename: bar_0
Package: foo
Version: 0
Architecture: test
Depends: bar
Filename: foo
EOF
expect <<EOF
bar_0
EOF