Skip to content

Commit

Permalink
Fix travis integration
Browse files Browse the repository at this point in the history
  • Loading branch information
lyze committed Mar 29, 2019
1 parent aa4ad9a commit 78ba61e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ TMP=tmp
PS_VERSION=6.1.0
POSH_GIT_VERSION=v1.0.0-beta3

.PHONY: clean test
.PHONY: clean clean-test test

test: $(TMP)/powershell/pwsh $(TMP)/posh-git/README.md
./git-prompt-test.sh

clean:
rm -rf $(TMP)

clean-test:
rm -rf $(TMP)/test-scratch

$(TMP):
mkdir -p $@

Expand Down
23 changes: 18 additions & 5 deletions git-prompt-test.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#!/usr/bin/env bash

readonly PS=$(realpath tmp/powershell/pwsh)
readonly SRC_DIR=$(realpath .)
readonly POSH_GIT_DIR=$(realpath tmp/posh-git)
readonly TEST_SCRATCH_DIR=$(realpath tmp/test-scratch)
set -e

readonly PS=$(readlink -f tmp/powershell/pwsh)
readonly SRC_DIR=$(readlink -f .)
readonly POSH_GIT_DIR=$(readlink -f tmp/posh-git)
readonly TEST_SCRATCH_DIR=$(readlink -f tmp/test-scratch)

DIFF_FLAGS=
case "$-i" in
*i*) if [ -z "$TRAVIS" ]; then
DIFF_FLAGS=--color=auto
fi ;;
*) ;;
esac
readonly DIFF_FLAGS

mkdir -p $TEST_SCRATCH_DIR

set +e

# Captures the posh command prompt for posh-git-sh and posh-git.
#
# Input:
Expand Down Expand Up @@ -70,7 +83,7 @@ test_poshes_ignoring_color() {
local actual_out=$actual-nocolor
strip_ansi_colors "$expected" > "$expected_out"
strip_ansi_colors "$actual" > "$actual_out"
diff -u --color=always --label="$expected_out" "$expected_out" --label="$actual_out" "$actual_out"
diff -u --label="$expected_out" "$expected_out" --label="$actual_out" "$actual_out" $DIFF_FLAGS
}

PASSING=0
Expand Down

0 comments on commit 78ba61e

Please sign in to comment.