<commit_before>#!/bin/bash
export OOC_LIBS=$(dirname `pwd`)
ARGS=""
FAILED=false
if [ -e rock_arguments.txt ]
	then
		ARGS=$(cat rock_arguments.txt)
fi
FLAGS=${@:2}
TESTS=$@
case "$1" in
	"nogpu")
		;&
	"")
		;&
	"all")
		TESTS="./test"
		;;
	*)
		TESTS="./test/$1"
		;;
esac
if [[ -d $TESTS ]]
then
	TESTS=$(find $TESTS -name "*Test.ooc")
else
	TESTS=$TESTS"Test.ooc"
fi
for TEST in $TESTS
do
	if [[ !( $1 == "nogpu" && $TEST == *"/gpu/"* ) ]]
	then
		OUTPUT=$(rock -q -lpthread --gc=off $ARGS $FLAGS $TEST 2>&1 )
		if [[ !( $? == 0 ) ]]
		then
			echo -e $OUTPUT
			echo "Compilation failed of test: $TEST"
			exit 2
		fi
		NAME=${TEST##*/}
		NAME=${NAME%.*}
		#echo $TEST
		./$NAME
		if [[ !( $? == 0 ) ]]
		then
			echo "Failed test: $TEST"
			FAILED=true
		fi
		rm -f $NAME
	fi
done
if [ "$FAILED" = true ]
then
	exit 1
else
	exit 0
fi<commit_msg>Updated test script to generate single test file and use file<commit_after>#!/bin/bash
export OOC_LIBS=$(dirname `pwd`)
ARGS=""
FAILED=false
TEST_DIRECTORY="./test"
SOURCE_DIRECTORY="./source"
TESTS_USE_FILE="tests_generated.use"
TESTS_SOURCE_FILE="tests_generated.ooc"
if [ -e rock_arguments.txt ]
	then
		ARGS=$(cat rock_arguments.txt)
fi
FLAGS=${@:2}
TESTS=$@
case "$1" in
	"nogpu")
		;&
	"")
		;&
	"all")
		TESTS="./test"
		;;
	*)
		TESTS="./test/$1"
		;;
esac
if [[ -d $TESTS ]]
then
	TESTS=$(find $TESTS -name "*Test.ooc")
else
	TESTS=$TESTS"Test.ooc"
fi
echo "SourcePath: ." > "$TESTS_USE_FILE"
echo "use ${TESTS_USE_FILE%.*}" > "$TESTS_SOURCE_FILE"
echo "main: func {" >> "$TESTS_SOURCE_FILE"
for TEST in $TESTS
do
	if [[ !( $1 == "nogpu" && $TEST == *"/gpu/"* ) ]]
	then
		echo "Imports: ${TEST%.*}" >> "$TESTS_USE_FILE"
		echo "    $(basename ${TEST%.*}) new() run()" >> "$TESTS_SOURCE_FILE"
	fi
done
echo "   exit(0)" >> "$TESTS_SOURCE_FILE"
echo "}" >> "$TESTS_SOURCE_FILE"
echo "Main: $TESTS_SOURCE_FILE" >> "$TESTS_USE_FILE"
rock -q -lpthread --gc=off -r $ARGS $FLAGS $TESTS_USE_FILE 2>&1
if [ "$FAILED" = true ]
then
	exit 1
else
	exit 0
fi
{'fraction_non_alphanumeric': 0.2127553562531141, 'fraction_numerical': 0.009965122072745391, 'mean_word_length': 3.6806526806526807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '688282', 'n_tokens_mistral': 902, 'n_tokens_neox': 862, 'n_words': 206}