Testing and QA

 
 
Picture of Jerry Lau
Re: Full featured/complete functional test cases before upgrade
 

Tim,

I was able to find those files but I want to print out the contents of those files with the .feature filename all into a file so it's easier "to read"

I found the files by using fine and grep

find /my/moodle/location/folder -type f -print | grep '.feature'

/my/moodle/location/folder/cohort/tests/behat/add_cohort.feature
/my/moodle/location/folder/cohort/tests/behat/upload_cohort_users.feature
/my/moodle/location/folder/course/tests/behat/rename_roles.feature
/my/moodle/location/folder/course/tests/behat/course_controls.feature
/my/moodle/location/folder/course/tests/behat/activities_group_icons.feature
/my/moodle/location/folder/course/tests/behat/max_number_sections.feature
......

......

How can I dump what is on each file for each filename instead of using "cat" on each file manually and coping and pasting and appending them into one big file.

Thanks

Jerry

 

 

 

 
Average of ratings: -
Picture of Lawrence Ng
Re: Full featured/complete functional test cases before upgrade
 

Jerry,

Put this as a script or run it through your command line... this will make it look prettier big grin

i=1
for file in `find /my/moodle/location/folder/ -type f -print | grep '.feature'`
do
 printf "%b\n"
 echo "======================================================================================"
 echo "File $((i++)) : $file"
 echo "======================================================================================"
 printf "%b\n"
 cat $file
 printf "%b\n"
done

 

 

 

 
Average of ratings:Useful (1)