diff --git a/build_tools/git_version_gen.sh b/build_tools/git_version_gen.sh index 49a15c108..36f0c88bd 100755 --- a/build_tools/git_version_gen.sh +++ b/build_tools/git_version_gen.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh # Originally from the git sources (GIT-VERSION-GEN) # Presumably (C) Junio C Hamano # Reused under GPL v2.0 @@ -28,11 +28,11 @@ fi # Set the output directory as either the first param or cwd. test -n "$1" && OUTPUT_DIR=$1/ || OUTPUT_DIR= -FBVF=${OUTPUT_DIR}FISH-BUILD-VERSION-FILE +FBVF="${OUTPUT_DIR}FISH-BUILD-VERSION-FILE" -if test -r $FBVF +if test -r "$FBVF" then - VC=$(grep -v '^#' $FBVF | tr -d '"' | sed -e 's/^FISH_BUILD_VERSION=//') + VC=$(grep -v '^#' "$FBVF" | tr -d '"' | sed -e 's/^FISH_BUILD_VERSION=//') else VC="unset" fi @@ -41,7 +41,7 @@ fi # It looks like FISH_BUILD_VERSION="2.7.1-621-ga2f065e6" test "$VN" = "$VC" || { echo >&2 "FISH_BUILD_VERSION=$VN" - echo "FISH_BUILD_VERSION=\"$VN\"" >${FBVF} + echo "FISH_BUILD_VERSION=\"$VN\"" >"$FBVF" } # Output the fish-build-version-witness.txt diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index 509d5840e..5c28fdf2d 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -117,7 +117,7 @@ endfunction() add_custom_target(tests_buildroot_target # Make the directory in which to run tests: COMMAND ${CMAKE_COMMAND} -E make_directory ${TEST_INSTALL_DIR} - COMMAND DESTDIR=${TEST_INSTALL_DIR} ${CMAKE_COMMAND} + COMMAND env DESTDIR=${TEST_INSTALL_DIR} ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR} --target install # Put fish_test_helper there too: COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/fish_test_helper diff --git a/tests/test_driver.sh b/tests/test_driver.sh index 01c01dfdf..39bb6ce24 100644 --- a/tests/test_driver.sh +++ b/tests/test_driver.sh @@ -46,7 +46,7 @@ ln -s "$PWD/test_functions" "$XDG_CONFIG_HOME/fish/functions" || die "Failed to # Set the function path at startup, referencing the default fish functions and the test-specific # functions. -fish_init_cmd="set fish_function_path ${XDG_CONFIG_HOME}/fish/functions ${BUILD_ROOT}/share/functions" +fish_init_cmd="set fish_function_path '${XDG_CONFIG_HOME}/fish/functions' '${BUILD_ROOT}/share/functions'" __fish_is_running_tests="$homedir" export __fish_is_running_tests @@ -64,9 +64,8 @@ fish_init_cmd="${fish_init_cmd} && source ${TESTS_ROOT}/test_util.fish"; # Run the test script, but don't exec so we can clean up after it succeeds/fails. Each test is # launched directly within its TMPDIR, so that the fish tests themselves do not need to refer to # TMPDIR (to ensure their output as displayed in case of failure by littlecheck is reproducible). -(cd $TMPDIR; env HOME="$homedir" "${BUILD_ROOT}/test/root/bin/fish" \ - --init-command "${fish_init_cmd}" \ - "$fish_script" "$script_args") +(cd $TMPDIR && env HOME="$homedir" "${BUILD_ROOT}/test/root/bin/fish" \ + --init-command "${fish_init_cmd}" "$fish_script" "$script_args") test_status="$?" # CMake less than 3.9.0 "fully supports" setting an exit code to denote a skipped test, but then