-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run ww_activate script on linux workspace activation
On Linux, this script was already being created for this purpose, but it was not being executed. On Windows it was working correctly.
- Loading branch information
1 parent
f62eec8
commit 2858fcf
Showing
3 changed files
with
92 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
test() { | ||
local test_function=$1 | ||
|
||
echo -n "Testing ${test_function} ... " | ||
|
||
setup | ||
|
||
# run test function | ||
output=$($test_function) | ||
failed=$? | ||
|
||
tier_down | ||
|
||
if [ $failed != 0 ]; then | ||
printRed "Failed" | ||
echo "" | ||
echo "------------ Test Output ------------" | ||
echo "$test_function:" | ||
echo "$output" | ||
exit 1 | ||
fi | ||
|
||
printGreen "Success" | ||
} | ||
|
||
setup() { | ||
test_dir=$(pwd) | ||
|
||
rm -rf temp-ww-workdir | ||
mkdir $test_dir/temp-ww-workdir | ||
export WW_DEFAULT_PATH=$test_dir/temp-ww-workdir | ||
} | ||
|
||
tier_down() { | ||
cd $test_dir | ||
rm -rf temp-ww-workdir | ||
} | ||
|
||
assert_equal() { | ||
if [ $1 != $2 ]; then | ||
testErrorOut "Assertion failed: $1 is not equal to $2'" | ||
fi | ||
} | ||
|
||
testErrorOut() { | ||
printRed "ERROR: $@" | ||
exit 1 | ||
} | ||
|
||
printGreen() { | ||
green=`tput setaf 2` | ||
reset=`tput sgr0` | ||
echo "${green}$1${reset}" | ||
} | ||
|
||
printRed() { | ||
red=`tput setaf 1` | ||
reset=`tput sgr0` | ||
echo "${red}$1${reset}" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters