#! /bin/sh # -*- mode: bash; tab-width: 4; -*- # vi:ts=4 noexpandtab autoindent . ./helper_functions.sh cd .. make_project set_stat_size_string stat_size #reusable variables passed=1 counter=0 fileName="test" echo_and_run "./testfile_maker" pass_fail "-e $fileName" rm -f fileName echo Name Tests fileName=testfilename echo_and_run "./testfile_maker $fileName" pass_fail "-e $fileName0" rm -f "$fileName" echo Count Tests fileCount=10 echo_and_run "./testfile_maker -c $fileCount" while [ "$counter" -lt "$fileCount" ] do fileName="test$counter" if [ ! -e $fileName ] then passed=0 fi counter=$(expr $counter + 1) done pass_fail $passed rm -f test[0-9] echo Extension Tests fileName="test.txt" echo_and_run "./testfile_maker -e txt" pass_fail "-e $fileName" rm -f $fileName echo_and_run "./testfile_maker -e .txt" pass_fail "-e $fileName" rm -f $fileName echo Help printf "./testfile_maker -h: " output="$(eval ./testfile_maker -h | cut -c16- | sed -e 's/\[/\\\[/g' -e 's/]/\\]/g')" readme="$(sed -n -e '/\[file name]/p' README.md | cut -c7- | sed -e 's/\[/\\\[/g' -e 's/]/\\]/g')" stringEqual= if [ "$output" = "$readme" ] then stringEqual=1 fi pass_fail "$stringEqual" echo Separate Lines fileName="test" fileSize=5 echo_and_run "./testfile_maker -s $fileSize -l" passed=0 if [ $(wc -l < $fileName) -eq $(expr $fileSize / 2) ] && [ $($stat_size $fileName) -eq $fileSize ] then passed=1; fi pass_fail "$passed -ne 0" rm -f $fileName echo_and_run "./testfile_maker -l" pass_fail "$(wc -l < $fileName) -eq 5" rm -f $fileName fileSize=100 echo_and_run "./testfile_maker -s $fileSize -l" passed=0 if [ $(wc -l < $fileName) -eq $(expr $fileSize / 2) ] && [ $($stat_size $fileName) -eq $fileSize ] then passed=1; fi pass_fail "$passed -ne 0" rm -f $fileName echo Size Tests fileName="test" fileSize=5 echo_and_run "./testfile_maker -s $fileSize" pass_fail "$($stat_size $fileName) -eq $fileSize" rm -f $fileName echo_and_run "./testfile_maker" pass_fail "$($stat_size $fileName) -eq 10" rm -f $fileName fileSize=100 echo_and_run "./testfile_maker -s $fileSize" pass_fail "$($stat_size $fileName) -eq $fileSize" rm -f $fileName print_pass_fail_stats
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 21817 | mbirky |
Removing comment from sanity test script that is no longer relevent. Adding the directory arugement explanation to the readme. |
||
#2 | 21816 | mbirky |
Adding in the directory argument. This allows the tool to better integrate with P4v as a custom tool. Fixed a small cleanup issue with the sanity test script. |
||
#1 | 18325 | mbirky | Changing the folder locations to fix issues with workshop naming convention. | ||
//guest/mbirky/testfile_maker/main/test_scripts/sanity.sh | |||||
#1 | 18324 | mbirky |
Changing the folders to have a main. Should fix some issues intorduced by adding a branch in the workshop |
||
//guest/mbirky/testfile_maker/test_scripts/sanity.sh | |||||
#3 | 15289 | mbirky | Updating the sanity test script to see the changes to the README.md file. | ||
#2 | 12429 | mbirky |
Adding the feature that if only one file is made there is no trailing 0. @mwittenberg |
||
#1 | 11713 | mbirky | Moving the test scripts from the folder test to the folder test_scripts. | ||
//guest/mbirky/testfile_maker/test/sanity.sh | |||||
#5 | 11689 | mbirky |
Adding in the ability to specify the size measured in k, m, or g. @mwittenberg |
||
#4 | 11571 | mbirky |
Adding in the stat_size string. This is set at the start of the script to allow for the differences between Linux and Darwin with the stat command. Updated to use '\c' instead of the -n with the echo because on a mac the -n is printed. @mwittenberg |
||
#3 | 11479 | mbirky | Adding in the option for writing each character on a new line @mittenberg | ||
#2 | 11420 | mbirky |
Updating the test script and adding in a test for the -h option @mwittenberg - it would have helped if you had been a little more explicit about which compare was the problem, but I figured it out. :-) |
||
#1 | 11101 | mbirky |
Adding a sanity test script. @mwittenberg |