mirror of
https://github.com/void-linux/void-packages.git
synced 2025-07-27 07:52:55 +02:00
bc: add tests.
This commit is contained in:
parent
2be11cc30d
commit
b10941efd6
1 changed files with 19 additions and 0 deletions
|
@ -25,3 +25,22 @@ fi
|
||||||
do_build() {
|
do_build() {
|
||||||
make ${makejobs} LEX="flex -I"
|
make ${makejobs} LEX="flex -I"
|
||||||
}
|
}
|
||||||
|
do_check() {
|
||||||
|
# LFS tells us that there are 10 know failures
|
||||||
|
# What happens here
|
||||||
|
# 1. echo "quit" so bc will quit after running Test/checklib.b
|
||||||
|
# 2. tee to /dev/tty so the Maintainer will see the output of the tests
|
||||||
|
# 3. grep the Total failures for any number between 1 and 199
|
||||||
|
# 4. cut Total failures: from the numbers
|
||||||
|
# 5. use awk to sum the numbers
|
||||||
|
failures="$(echo "quit" | ./bc/bc -l Test/checklib.b | tee /dev/tty | grep 'Total failures: [1-9]\|1[0-9]\|1[0-9][0-9]' | cut -d: -f2 | awk '{s+=$1} END {print s}' )"
|
||||||
|
|
||||||
|
# 6. Check if there are more than then 10 Know test failures as pointed by LFS
|
||||||
|
# http://www.linuxfromscratch.org/lfs/view/development/chapter06/bc.html
|
||||||
|
if [ "$failures" -gt 10 ]; then
|
||||||
|
echo "THERE ARE MORE THAN THE 10 KNOW FAILURES"
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
echo "TESTS PASSED"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue