Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Commit 3fb1e57

Browse files
anurseanalogrelay
authored andcommitted
Integrated sh tests into build.sh
1 parent 00a2891 commit 3fb1e57

File tree

6 files changed

+36
-28
lines changed

6 files changed

+36
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Things related to tests
22
.pester/
33
testwork/
4+
.urchin*
45

56
# Ignore the folder created when pushing to Home - It should be cleaned up by the task, but sometimes isn't.
67
.pushkvm/

makefile.shade

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@ default KVM_DEPLOY_BRANCH="${Environment.GetEnvironmentVariable("KVM_DEPLOY_BRAN
3030
#run-ps1-tests target='test' if='!IsLinux'
3131
exec program='powershell' commandline='-ExecutionPolicy RemoteSigned -NoProfile -NoLogo -Command & "${Path.Combine(TEST_DIR, "ps1", "Run-Tests.ps1")} ${IsTeamCity?"-TeamCity":""}'
3232

33+
#run-sh-tests target='test' if='IsLinux'
34+
exec program='${Path.Combine(TEST_DIR, "sh", "run-tests") ${IsTeamCity?"-t ":""}-v'
35+
3336
#push-kvm-ps1 target='deploy' if='!String.IsNullOrEmpty(KVM_DEPLOY_REPO) && !String.IsNullOrEmpty(KVM_DEPLOY_BRANCH)'
3437
push-kvm repo="${KVM_DEPLOY_REPO}" branch="${KVM_DEPLOY_BRANCH}" files="kvm.cmd;kvm.ps1" baseMessage=":arrow_up: kvm.ps1, kvm.cmd"

test/sh/run-tests

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,35 @@ requires node
2121
requires npm
2222
requires curl
2323

24+
USAGE="usage: $0 [<options>] <test directory>"
25+
26+
runtests_help() {
27+
cat <<EOF
28+
29+
$USAGE
30+
31+
-t Writes TeamCity status messages to the output.
32+
-v Write stdout for tests that succeed.
33+
-h This help.
34+
35+
EOF
36+
}
37+
38+
# Read arguments
39+
while [ $# -gt 0 ]
40+
do
41+
case "$1" in
42+
-t) TEAMCITY=1;;
43+
-v) VERBOSE=1;;
44+
-h|--help) runtests_help
45+
exit 0;;
46+
-*) runtests_help >&2
47+
exit 1;;
48+
*) break;;
49+
esac
50+
shift
51+
done
52+
2453
verbose "Running in $SCRIPT_DIR"
2554

2655
# Set up a test environment

test/sh/tests/.urchin.log

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/sh/tests/install/Installing from a nupkg unpacks the nupkg into the packages dir.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/sh/urchin.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ recurse() {
101101
fi
102102
exit_code="$?"
103103

104-
# Write out teamcity status right away to get the most accurate timing possible
105-
[ $exit_code -ne 0 ] && teamcity "testFailed name='$TEST_NAME'"
106-
teamcity "testFinished name='$TEST_NAME'"
107-
108104
run_setup_teardown "teardown" "$stdout_file"
109105

110106
indent $indent_level
@@ -123,7 +119,10 @@ recurse() {
123119
printf '\033[31m' # Print output captured from failed test in red.
124120
cat "$stdout_file"
125121
printf '\033[0m'
122+
teamcity "testFailed name='$TEST_NAME'"
126123
fi
124+
125+
teamcity "testFinished name='$TEST_NAME'"
127126
fi
128127

129128

0 commit comments

Comments
 (0)