+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,20 @@ jobs:

lib64-install:
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install in lib64
run: sudo ./install.sh /usr/ lib64
- name: Run from env
run: time bats test --print-output-on-failure --report-formatter junit --output test-results
shell: 'script -q -e -c "bash {0}"' # work around tty issues
env:
TERM: linux # fix tput for tty issue work around
run: |
mkdir test-results/
time bats test --print-output-on-failure --report-formatter junit --output test-results
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The format is based on [Keep a Changelog][kac] and this project adheres to

* unbreak test suites with multiple files loading common constants (#904), introduced in v1.11.0
* docker image won't crash if a file or directory named 'bats' exists (#920)
* use $BATS_LIBDIR instead of hardcoded lib in 'bats-gather-tests' (#985)
* use $BATS_LIBDIR instead of hardcoded lib in 'bats-gather-tests' (#985, #990)

### Changed

Expand Down
3 changes: 2 additions & 1 deletion test/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ setup() {
}

@test "install.sh creates a valid installation, and uninstall.sh undos it" {
run "$PATH_TO_INSTALL_SHELL" "$INSTALL_DIR"
run "$PATH_TO_INSTALL_SHELL" "$INSTALL_DIR" "$BATS_LIBDIR"
[ "$status" -eq 0 ]
[ "$output" == "Installed Bats to $INSTALL_DIR/bin/bats" ]
ls -lr "$INSTALL_DIR"
[ -x "$INSTALL_DIR/bin/bats" ]
[ -x "$INSTALL_DIR/$BATS_LIBDIR/bats-core/formatter.bash" ]
[ -x "$INSTALL_DIR/$BATS_LIBDIR/bats-core/preprocessing.bash" ]
Expand Down
3 changes: 2 additions & 1 deletion test/root.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ setup() {
# give each test their own tmpdir to allow for parallelization without interference
# shellcheck disable=SC2103,SC2164
cd "$BATS_TEST_TMPDIR"
PATH_TO_INSTALL_SHELL="${BATS_TEST_DIRNAME%/*}/install.sh"
mkdir -p {usr/bin,opt/bats-core}
ls -lR .
"$BATS_ROOT/install.sh" "opt/bats-core"
"$PATH_TO_INSTALL_SHELL" "opt/bats-core"

ln -s "usr/bin" "bin"

Expand Down
6 changes: 3 additions & 3 deletions test/warnings.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ setup() {
[ "${lines[1]}" == "ok 1 Trigger BW01" ]
[ "${lines[2]}" == "The following warnings were encountered during tests:" ]
[ "${lines[3]}" == "BW01: \`run\`'s command \`=0 actually-intended-command with some args\` exited with code 127, indicating 'Command not found'. Use run's return code checks, e.g. \`run -127\`, to fix this message." ]
[[ "${lines[4]}" == " (from function \`run' in file ${RELATIVE_BATS_ROOT}lib/bats-core/test_functions.bash, line"* ]]
[[ "${lines[4]}" == " (from function \`run' in file ${RELATIVE_BATS_ROOT}${BATS_LIBDIR}/bats-core/test_functions.bash, line"* ]]
[ "${lines[5]}" == " in test file $RELATIVE_FIXTURE_ROOT/BW01.bats, line 3)" ]
}

Expand All @@ -43,8 +43,8 @@ setup() {
[ "${lines[1]}" == "ok 1 Trigger BW02" ]
[ "${lines[2]}" == "The following warnings were encountered during tests:" ]
[ "${lines[3]}" == "BW02: Using flags on \`run\` requires at least BATS_VERSION=1.5.0. Use \`bats_require_minimum_version 1.5.0\` to fix this message." ]
[[ "${lines[4]}" == " (from function \`bats_warn_minimum_guaranteed_version' in file ${RELATIVE_BATS_ROOT}lib/bats-core/warnings.bash, line "* ]]
[[ "${lines[5]}" == " from function \`run' in file ${RELATIVE_BATS_ROOT}lib/bats-core/test_functions.bash, line"* ]]
[[ "${lines[4]}" == " (from function \`bats_warn_minimum_guaranteed_version' in file ${RELATIVE_BATS_ROOT}${BATS_LIBDIR}/bats-core/warnings.bash, line "* ]]
[[ "${lines[5]}" == " from function \`run' in file ${RELATIVE_BATS_ROOT}${BATS_LIBDIR}/bats-core/test_functions.bash, line"* ]]
[ "${lines[6]}" == " in test file $RELATIVE_FIXTURE_ROOT/BW02.bats, line 2)" ]
}

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载