clojure-lsp: update to 2024.08.05.
[void-pkg.git] / common / xbps-src / libexec / xbps-src-docheck.sh
blobcac0d48f774ec77a9d79532822bf8cbcc8b2351c
1 #!/bin/bash
3 # vim: set ts=4 sw=4 et:
5 # Passed arguments:
6 # $1 - pkgname to build [REQUIRED]
7 # $2 - cross target [OPTIONAL]
9 if [ $# -lt 1 -o $# -gt 2 ]; then
10 echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
11 exit 1
14 PKGNAME="$1"
15 XBPS_CROSS_BUILD="$2"
17 for f in $XBPS_SHUTILSDIR/*.sh; do
18 . $f
19 done
21 setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
23 if [ -n "$disable_parallel_check" ]; then
24 XBPS_MAKEJOBS=1
25 else
26 XBPS_MAKEJOBS="$XBPS_ORIG_MAKEJOBS"
28 makejobs="-j$XBPS_MAKEJOBS"
30 XBPS_CHECK_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_check_done"
32 if [ -n "$XBPS_CROSS_BUILD" ]; then
33 msg_normal "${pkgname}-${version}_${revision}: skipping check (cross build for $XBPS_CROSS_BUILD) ...\n"
34 exit 0
37 if [ -z "$XBPS_CHECK_PKGS" ]; then
38 msg_normal "${pkgname}-${version}_${revision}: skipping check (XBPS_CHECK_PKGS is disabled) ...\n"
39 exit 0
42 if [ "$make_check" = no ]; then
43 msg_normal "${pkgname}-${version}_${revision}: skipping check (make_check=no) ...\n"
44 exit 0
47 if [ "$make_check" = extended -a "$XBPS_CHECK_PKGS" != full ]; then
48 msg_normal \
49 "${pkgname}-${version}_${revision}: skipping check (make_check=extended and XBPS_CHECK_PKGS is not 'full') ...\n"
50 exit 0
53 if [ "$make_check" = ci-skip ] && [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
54 msg_warn \
55 "${pkgname}-${version}_${revision}: skipping here because of make_check=ci-skip. Tests should be run locally.\n"
56 exit 0
59 for f in $XBPS_COMMONDIR/environment/check/*.sh; do
60 source_file "$f"
61 done
63 run_step check optional
65 touch -f $XBPS_CHECK_DONE
67 exit 0