Files
makeself/test/extracttest
Alexandr Reshetnikov a4f40a21ae move from bashunit to shunit2. refactoring tests. (#272)
* move from bashunit to shunit2

move run-tests.sh to test

simplify build.yml

* back shunit2 to submodule
2022-06-11 01:52:34 -07:00

64 lines
951 B
Bash

#!/bin/bash
set -eu
THIS="$(realpath "$0")"
THISDIR="$(dirname "${THIS}")"
SRCDIR="$(dirname "${THISDIR}")"
SUT="${SRCDIR}/makeself.sh"
setupTests() {
temp=`mktemp -d -t XXXXX`
cd "$temp"
mkdir archive
cp -a "$SRCDIR" archive/
$SUT $* archive makeself-test.run "Test $*" echo Testing --tar-extra="--exclude .git"
}
testQuiet()
{
setupTests
./makeself-test.run --quiet
assertEquals $? 0
}
testGzip()
{
setupTests --gzip
./makeself-test.run --check
assertEquals $? 0
}
testBzip2()
{
setupTests --bzip2
./makeself-test.run --check
assertEquals $? 0
}
testPBzip2()
{
# Skip if pbzip2 is not available
which pbzip2 || startSkipping
setupTests --pbzip2
./makeself-test.run --check
assertEquals $? 0
}
testZstd()
{
# Skip if zstd is not available
which zstd || startSkipping
setupTests --zstd
./makeself-test.run --check
assertEquals $? 0
}
# Load and run shUnit2.
source "./shunit2/shunit2"