Skip to content

Commit 5a78300

Browse files
committed
feat: do it
1 parent 5e85134 commit 5a78300

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ci/build/build-lib.sh

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env bash
2+
23
# This is a library which contains functions used inside ci/build
34
#
45
# We separated it into it's own file so that we could easily unit test
56
# these functions and helpers.
6-
set -euo pipefai
77

88
# On some CPU architectures (notably node/uname "armv7l", default on Raspberry Pis),
99
# different package managers have different labels for the same CPU (deb=armhf, rpm=armhfp).

test/scripts/build-lib.bats

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bats
2+
3+
SCRIPT_NAME="build-lib.sh"
4+
SCRIPT="$BATS_TEST_DIRNAME/../../ci/build/$SCRIPT_NAME"
5+
6+
source "$SCRIPT"
7+
8+
@test "get_nfpm_arch should return armhfp for rpm on armv7l" {
9+
PKG_FORMAT="rpm" ARCH="armv7l" run get_nfpm_arch
10+
[ "$output" = "armhfp" ]
11+
}
12+
13+
@test "get_nfpm_arch should return armhf for deb on armv7l" {
14+
PKG_FORMAT="deb" ARCH="armv7l" run get_nfpm_arch
15+
[ "$output" = "armhf" ]
16+
}
17+
18+
@test "get_nfpm_arch should return arch if no arch override exists " {
19+
PKG_FORMAT="deb" ARCH="i386" run get_nfpm_arch
20+
[ "$output" = "i386" ]
21+
}

0 commit comments

Comments
 (0)