From: Junio C Hamano Date: Tue, 23 May 2017 04:46:08 +0000 (+0900) Subject: Merge branch 'ab/fix-poison-tests' X-Git-Tag: v2.14.0-rc0~174 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6a0bc7cf0efbefa5a949d958947e68e29534f04d?ds=inline;hp=-c Merge branch 'ab/fix-poison-tests' Update tests to pass under GETTEXT_POISON (a mechanism to ensure that output strings that should not be translated are not translated by mistake), and tell TravisCI to run them. * ab/fix-poison-tests: travis-ci: add job to run tests with GETTEXT_POISON travis-ci: setup "prove cache" in "script" step tests: fix tests broken under GETTEXT_POISON=YesPlease --- 6a0bc7cf0efbefa5a949d958947e68e29534f04d diff --combined .travis.yml index 48cb00a581,6dd73d1f02..278943d14a --- a/.travis.yml +++ b/.travis.yml @@@ -39,6 -39,11 +39,11 @@@ env matrix: include: + - env: GETTEXT_POISON=YesPlease + os: linux + compiler: + addons: + before_install: - env: Windows os: linux compiler: @@@ -52,7 -57,6 +57,7 @@@ after_failure: - env: Linux32 os: linux + compiler: services: - docker before_install: @@@ -87,14 -91,14 +92,14 @@@ after_failure: - env: Documentation os: linux - compiler: clang + compiler: addons: apt: packages: - asciidoc - xmlto before_install: - before_script: + before_script: gem install asciidoctor script: ci/test-documentation.sh after_failure: @@@ -135,12 -139,14 +140,14 @@@ before_install p4 -V | grep Rev.; echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)"; git-lfs version; - mkdir -p $HOME/travis-cache; - ln -s $HOME/travis-cache/.prove t/.prove; before_script: make --jobs=2 - script: make --quiet test + script: + - > + mkdir -p $HOME/travis-cache; + ln -s $HOME/travis-cache/.prove t/.prove; + make --quiet test; after_failure: - > diff --combined t/t0027-auto-crlf.sh index effc3db0d5,81609af7bb..deb3ae7813 --- a/t/t0027-auto-crlf.sh +++ b/t/t0027-auto-crlf.sh @@@ -4,6 -4,12 +4,6 @@@ test_description='CRLF conversion all c . ./test-lib.sh -if ! test_have_prereq EXPENSIVE -then - skip_all="EXPENSIVE not set" - test_done -fi - compare_files () { tr '\015\000' QN <"$1" >"$1".expect && tr '\015\000' QN <"$2" | tr -d 'Z' >"$2".actual && @@@ -69,7 -75,7 +69,7 @@@ check_warning () *) echo >&2 "Illegal 1": "$1" ; return false ;; esac grep "will be replaced by" "$2" | sed -e "s/\(.*\) in [^ ]*$/\1/" | uniq >"$2".actual - test_cmp "$2".expect "$2".actual + test_i18ncmp "$2".expect "$2".actual } commit_check_warn () { diff --combined t/t7508-status.sh index 567c4d4bab,5edcc6edfe..79427840a4 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@@ -32,17 -32,6 +32,17 @@@ test_expect_success 'commit -h in broke test_i18ngrep "[Uu]sage" broken/usage ' +test_expect_success 'create upstream branch' ' + git checkout -b upstream && + test_commit upstream1 && + test_commit upstream2 && + # leave the first commit on master as root because several + # tests depend on this case; for our upstream we only + # care about commit counts anyway, so a totally divergent + # history is OK + git checkout --orphan master +' + test_expect_success 'setup' ' : >tracked && : >modified && @@@ -64,9 -53,7 +64,9 @@@ echo 1 >dir1/modified && echo 2 >dir2/modified && echo 3 >dir2/added && - git add dir2/added + git add dir2/added && + + git branch --set-upstream-to=upstream ' test_expect_success 'status (1)' ' @@@ -88,10 -75,6 +88,10 @@@ EO test_expect_success 'status --column' ' cat >expect <<\EOF && # On branch master +# Your branch and '\''upstream'\'' have diverged, +# and have 1 and 2 different commits each, respectively. +# (use "git pull" to merge the remote branch into yours) +# # Changes to be committed: # (use "git reset HEAD ..." to unstage) # @@@ -122,10 -105,6 +122,10 @@@ test_expect_success 'status --column st cat >expect <<\EOF # On branch master +# Your branch and 'upstream' have diverged, +# and have 1 and 2 different commits each, respectively. +# (use "git pull" to merge the remote branch into yours) +# # Changes to be committed: # (use "git reset HEAD ..." to unstage) # @@@ -199,9 -178,6 +199,9 @@@ test_expect_success 'commit ignores sta cat >expect <<\EOF On branch master +Your branch and 'upstream' have diverged, +and have 1 and 2 different commits each, respectively. + Changes to be committed: new file: dir2/added @@@ -272,10 -248,6 +272,10 @@@ test_expect_success 'status with gitign cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -341,10 -313,6 +341,10 @@@ test_expect_success 'status with gitign cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -380,7 -348,7 +380,7 @@@ output EOF cat >expect <<\EOF -## master +## master...upstream [ahead 1, behind 2] M dir1/modified A dir2/added ?? dir1/untracked @@@ -392,7 -360,7 +392,7 @@@ EO test_expect_success 'status -s -b' ' git status -s -b >output && - test_cmp expect output + test_i18ncmp expect output ' @@@ -402,7 -370,7 +402,7 @@@ test_expect_success 'status -s -z -b' git status -s -z -b >output && nul_to_q output.q && mv output.q output && - test_cmp expect output + test_i18ncmp expect output ' test_expect_success 'setup dir3' ' @@@ -414,10 -382,6 +414,10 @@@ test_expect_success 'status -uno' ' cat >expect <..." to unstage) @@@ -444,9 -408,6 +444,9 @@@ test_expect_success 'status (status.sho test_expect_success 'status -uno (advice.statusHints false)' ' cat >expect <expect <..." to unstage) @@@ -536,10 -493,6 +536,10 @@@ test_expect_success 'status -s (status. test_expect_success 'status -uall' ' cat >expect <..." to unstage) @@@ -599,10 -552,6 +599,10 @@@ test_expect_success 'status -s (status. test_expect_success 'status with relative paths' ' cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -661,19 -610,13 +661,19 @@@ test_expect_success 'status --porcelai test_expect_success 'setup unique colors' ' git config status.color.untracked blue && - git config status.color.branch green + git config status.color.branch green && + git config status.color.localBranch yellow && + git config status.color.remoteBranch cyan ' test_expect_success 'status with color.ui' ' cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -732,7 -675,7 +732,7 @@@ test_expect_success 'status -s with col ' cat >expect <<\EOF -## master +## master...upstream [ahead 1, behind 2] M dir1/modified A dir2/added ?? dir1/untracked @@@ -744,7 -687,7 +744,7 @@@ EO test_expect_success 'status -s -b with color.status' ' git status -s -b | test_decode_color >output && - test_cmp expect output + test_i18ncmp expect output ' @@@ -783,7 -726,7 +783,7 @@@ test_expect_success 'status --porcelai git status --porcelain -b >output && { - echo "## master" && + echo "## master...upstream [ahead 1, behind 2]" && cat expect } >tmp && mv tmp expect && @@@ -796,10 -739,6 +796,10 @@@ test_expect_success 'status without relative paths' ' cat >expect <<\EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 1 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -846,10 -785,6 +846,10 @@@ test_expect_success 'status -s without test_expect_success 'dry-run of partial commit excluding new file in index' ' cat >expect <..." to unstage) @@@ -890,10 -825,6 +890,10 @@@ test_expect_success 'setup status submo test_expect_success 'status submodule summary is disabled by default' ' cat >expect <..." to unstage) @@@ -950,10 -881,6 +950,10 @@@ head=$(cd sm && git rev-parse --short= test_expect_success 'status submodule summary' ' cat >expect <..." to unstage) @@@ -1012,10 -939,6 +1012,10 @@@ test_expect_success 'status -s submodul test_expect_success 'status submodule summary (clean submodule): commit' ' cat >expect <..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) @@@ -1062,10 -985,6 +1062,10 @@@ test_expect_success 'status -z implies test_expect_success 'commit --dry-run submodule summary (--amend)' ' cat >expect <..." to unstage) @@@ -1119,10 -1038,6 +1119,10 @@@ touch .gitmodule test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1231,10 -1146,6 +1231,10 @@@ test_expect_success '.git/config ignore test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1291,10 -1202,6 +1291,10 @@@ head2=$(cd sm && git commit -q -m "2nd test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1375,10 -1282,6 +1375,10 @@@ test_expect_success ".git/config ignore cat > expect << EOF ; On branch master +; Your branch and 'upstream' have diverged, +; and have 2 and 2 different commits each, respectively. +; (use "git pull" to merge the remote branch into yours) +; ; Changes to be committed: ; (use "git reset HEAD ..." to unstage) ; @@@ -1426,10 -1329,6 +1426,10 @@@ test_expect_success "status (core.comme test_expect_success "--ignore-submodules=all suppresses submodule summary" ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) @@@ -1454,10 -1353,6 +1454,10 @@@ EO test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' ' cat > expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage) @@@ -1577,10 -1472,6 +1577,10 @@@ test_expect_success 'git commit --dry-r git add sm && cat >expect << EOF && On branch master +Your branch and '\''upstream'\'' have diverged, +and have 2 and 2 different commits each, respectively. + (use "git pull" to merge the remote branch into yours) + Changes to be committed: (use "git reset HEAD ..." to unstage)