@@ -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
3435test_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