Skip to content

Commit c70983b

Browse files
committed
use source file
1 parent 31cede5 commit c70983b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ $DIFF"
3030

3131
}
3232

33-
# $1 is the Source test file which uses the test framework
33+
# $1 is the source file to be tested
34+
# $2 is the Source test file which uses the test framework
3435
test_source_framework() {
3536
# run concatenation of test framework and test file
36-
RESULTS=$($JS_SLANG -e --chapter=4 "$(cat $TEST_FRAMEWORK $1)")
37+
RESULTS=$($JS_SLANG -e --chapter=4 "$(cat $TEST_FRAMEWORK $1 $2)")
3738

3839
# retrieve names for tests that passed
3940
while read test_name
4041
do
4142
passed=$(($passed+1))
42-
echo "${green}PASS $1 $test_name"
43+
echo "${green}PASS $2 $test_name"
4344
done < <(echo ${RESULTS} | grep -o '\w* PASSED' | awk -F 'PASSED' '{print $1}')
4445

4546
# retrieve names and error messages for tests that failed
@@ -48,7 +49,7 @@ test_source_framework() {
4849
failed=$(($failed+1))
4950
echo $test_info | awk -F 'FAILED:' '{ print $1 ":" $2 }' | awk -F '"' '{ print $1 $2 }' |
5051
while read test_name test_error
51-
do echo "${red}FAIL $1 $test_name $test_error";
52+
do echo "${red}FAIL $2 $test_name $test_error";
5253
done
5354
done < <(echo ${RESULTS} | grep -o '\w* FAILED:[^"]*')
5455

@@ -71,7 +72,7 @@ main() {
7172
TEST_PATH="$DIR/__tests__/$TEST_FRAMEWORK_FILE"
7273
if [ -e $TEST_PATH ]
7374
then
74-
test_source_framework $TEST_PATH
75+
test_source_framework $s $TEST_PATH
7576
fi
7677
fi
7778

0 commit comments

Comments
 (0)