File tree Expand file tree Collapse file tree 4 files changed +16
-10
lines changed
Expand file tree Collapse file tree 4 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ - Fix build issue with bashunit on NixOS
6+
37## [ 0.22.2] ( https://github.com/TypedDevs/bashunit/compare/0.22.1...0.22.2 ) - 2025-07-26
48
59- Fix broken core snapshot tests
Original file line number Diff line number Diff line change @@ -61,11 +61,11 @@ test/list:
6161 @echo $(TEST_SCRIPTS ) | tr ' ' ' \n'
6262
6363test : $(TEST_SCRIPTS )
64- @./bashunit $(TEST_SCRIPTS )
64+ @bash ./bashunit $(TEST_SCRIPTS )
6565
6666test/watch : $(TEST_SCRIPTS )
67- @./bashunit $(TEST_SCRIPTS )
68- @fswatch -m poll_monitor -or $(SRC_SCRIPTS_DIR ) $(TEST_SCRIPTS_DIR ) .env Makefile | xargs -n1 ./bashunit $(TEST_SCRIPTS )
67+ @bash ./bashunit $(TEST_SCRIPTS )
68+ @fswatch -m poll_monitor -or $(SRC_SCRIPTS_DIR ) $(TEST_SCRIPTS_DIR ) .env Makefile | xargs -n1 bash ./bashunit $(TEST_SCRIPTS )
6969
7070docker/alpine :
7171 @docker run --rm -it -v " $( shell pwd) " :/project -w /project alpine:latest \
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ function env::print_verbose() {
143143EXIT_CODE_STOP_ON_FAILURE=4
144144# Use a unique directory per run to avoid conflicts when bashunit is invoked
145145# recursively or multiple instances are executed in parallel.
146- TEMP_DIR_PARALLEL_TEST_SUITE=" /tmp/bashunit/parallel/${_OS:- Unknown} /$( random_str 8) "
146+ TEMP_DIR_PARALLEL_TEST_SUITE=" ${TMPDIR :- / tmp} /bashunit/parallel/${_OS:- Unknown} /$( random_str 8) "
147147TEMP_FILE_PARALLEL_STOP_ON_FAILURE=" $TEMP_DIR_PARALLEL_TEST_SUITE /.stop-on-failure"
148148TERMINAL_WIDTH=" $( env::find_terminal_width) "
149149FAILURES_OUTPUT_PATH=$( mktemp)
Original file line number Diff line number Diff line change @@ -39,30 +39,32 @@ function random_str() {
3939
4040function temp_file() {
4141 local prefix=${1:- bashunit}
42- mkdir -p /tmp/bashunit/tmp && chmod -R 777 /tmp/bashunit/tmp
42+ local base_dir=" ${TMPDIR:-/ tmp} /bashunit/tmp"
43+ mkdir -p " $base_dir " && chmod -R 777 " $base_dir "
4344 local test_prefix=" "
4445 if [[ -n " ${BASHUNIT_CURRENT_TEST_ID:- } " ]]; then
4546 test_prefix=" ${BASHUNIT_CURRENT_TEST_ID} _"
4647 fi
47- mktemp /tmp/bashunit/tmp/ " $ {test_prefix}${prefix}" .XXXXXXX
48+ mktemp " $base_dir / $ {test_prefix}${prefix} .XXXXXXX"
4849}
4950
5051function temp_dir() {
5152 local prefix=${1:- bashunit}
52- mkdir -p /tmp/bashunit/tmp && chmod -R 777 /tmp/bashunit/tmp
53+ local base_dir=" ${TMPDIR:-/ tmp} /bashunit/tmp"
54+ mkdir -p " $base_dir " && chmod -R 777 " $base_dir "
5355 local test_prefix=" "
5456 if [[ -n " ${BASHUNIT_CURRENT_TEST_ID:- } " ]]; then
5557 test_prefix=" ${BASHUNIT_CURRENT_TEST_ID} _"
5658 fi
57- mktemp -d /tmp/bashunit/tmp/ " $ {test_prefix}${prefix}" .XXXXXXX
59+ mktemp -d " $base_dir / $ {test_prefix}${prefix} .XXXXXXX"
5860}
5961
6062function cleanup_temp_files() {
6163 internal_log " cleanup_temp_files"
6264 if [[ -n " ${BASHUNIT_CURRENT_TEST_ID:- } " ]]; then
63- rm -rf /tmp/bashunit/tmp/" ${BASHUNIT_CURRENT_TEST_ID} " _*
65+ rm -rf " ${TMPDIR :- / tmp} /bashunit/tmp/${BASHUNIT_CURRENT_TEST_ID} " _*
6466 else
65- rm -rf /tmp/bashunit/tmp/*
67+ rm -rf " ${TMPDIR :- / tmp} /bashunit/tmp" /*
6668 fi
6769}
6870
You can’t perform that action at this time.
0 commit comments