abuild/tests/abuild.bats

58 lines
1.0 KiB
Plaintext
Raw Normal View History

2019-11-07 11:01:18 +00:00
setup() {
2020-10-29 12:04:27 +00:00
export ABUILD="$PWD/../abuild"
export ABUILD_SHAREDIR="$PWD/.."
export ABUILD_CONF=/dev/null
2020-10-29 12:04:27 +00:00
export REPODEST="$BATS_TMPDIR"/packages
2019-11-07 11:01:18 +00:00
}
teardown() {
rm -rf "$REPODEST"
}
@test "abuild: help text" {
2019-11-07 11:01:18 +00:00
$ABUILD -h
}
@test "abuild: version string" {
2019-11-07 11:01:18 +00:00
$ABUILD -V
}
2020-10-29 12:04:27 +00:00
@test "abuild: build simple package without deps" {
cd testrepo/pkg1
$ABUILD
}
2020-10-29 12:32:28 +00:00
@test "abuild: build failure" {
cd testrepo/buildfail
2020-10-29 13:49:24 +00:00
run $ABUILD cleanpkg all
2020-10-29 12:32:28 +00:00
[ $status -ne 0 ]
}
2020-10-29 13:49:24 +00:00
@test "abuild: test check for /usr/lib64" {
cd testrepo/lib64test
run $ABUILD cleanpkg all
[ $status -ne 0 ]
}
@test "abuild: test options=lib64" {
cd testrepo/lib64test
options=lib64 $ABUILD
$ABUILD cleanpkg
}
2020-10-29 14:44:52 +00:00
@test "abuild: verify that packages are reproducible built" {
cd testrepo/pkg1
arch=$($ABUILD -A)
pkgs=$($ABUILD listpkg)
2020-10-29 15:02:23 +00:00
$ABUILD
checksums=$(cd "$REPODEST"/testrepo/$arch && md5sum $pkgs)
2020-10-29 14:44:52 +00:00
echo "$checksums"
2020-10-29 15:02:23 +00:00
2020-10-29 14:44:52 +00:00
$ABUILD cleanpkg all
checksums2=$(cd "$REPODEST"/testrepo/$arch && md5sum $pkgs)
echo "$checksums2"
2020-10-29 15:02:23 +00:00
[ "$checksums" = "$checksums2" ]
2020-10-29 14:44:52 +00:00
}