[512f85] | 1 | ### 3. (un)select all atoms inside sphere
|
---|
| 2 |
|
---|
| 3 | AT_SETUP([Selection - All atoms inside sphere])
|
---|
| 4 | AT_KEYWORDS([selection,sphere])
|
---|
| 5 | file=allatomsoutsidesphere.xyz
|
---|
[b9bfa6] | 6 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz $file], 0)
|
---|
[512f85] | 7 | AT_CHECK([../../molecuilder -i $file -v 5 --select-atoms-inside-sphere 10 --position "10,10,10" -r], 0, [stdout], [stderr])
|
---|
[b9bfa6] | 8 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/post/$file], 0, [ignore], [ignore])
|
---|
| 9 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz $file], 0)
|
---|
[512f85] | 10 | AT_CHECK([../../molecuilder -i $file -v 5 --select-atoms-inside-sphere 10 --position "10,10,10" --undo -r], 0, [stdout], [stderr])
|
---|
[b9bfa6] | 11 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz], 0, [ignore], [ignore])
|
---|
| 12 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz $file], 0)
|
---|
[512f85] | 13 | AT_CHECK([../../molecuilder -i $file -v 5 --select-atoms-inside-sphere 10 --position "10,10,10" --undo --redo -r], 0, [stdout], [stderr])
|
---|
[b9bfa6] | 14 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/post/$file], 0, [ignore], [ignore])
|
---|
[512f85] | 15 | # check size of sphere
|
---|
| 16 | AT_SKIP_IF([! awk '' < /dev/null]) # check whether awk is there
|
---|
| 17 | AT_SKIP_IF([! cat >/dev/null < /dev/null]) # check whether cat is there
|
---|
| 18 | AT_SKIP_IF([! wc -l /dev/null]) # check whether wc is there
|
---|
| 19 | AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) > 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
|
---|
| 20 | AT_CHECK([fgrep "507" stdout], 0, [ignore], [ignore])
|
---|
| 21 | AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) < 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
|
---|
| 22 | AT_CHECK([fgrep "0" stdout], 0, [ignore], [ignore])
|
---|
| 23 | AT_CLEANUP
|
---|
| 24 |
|
---|
| 25 | AT_SETUP([Unselection - All atoms inside sphere])
|
---|
| 26 | AT_KEYWORDS([selection,sphere])
|
---|
| 27 | file=allatomsinsidesphere.xyz
|
---|
[b9bfa6] | 28 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz $file], 0)
|
---|
[512f85] | 29 | AT_CHECK([../../molecuilder -i $file -v 5 --select-all-atoms --unselect-atoms-inside-sphere 10 --position "10,10,10" -r], 0, [stdout], [stderr])
|
---|
[b9bfa6] | 30 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/post/$file], 0, [ignore], [ignore])
|
---|
| 31 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz $file], 0)
|
---|
[512f85] | 32 | AT_CHECK([../../molecuilder -i $file -v 5 --select-all-atoms --unselect-atoms-inside-sphere 10 --position "10,10,10" --undo -r], 0, [stdout], [stderr])
|
---|
[b9bfa6] | 33 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/post/empty.xyz], 0, [ignore], [ignore])
|
---|
| 34 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/pre/box.xyz $file], 0)
|
---|
[512f85] | 35 | AT_CHECK([../../molecuilder -i $file -v 5 --select-all-atoms --unselect-atoms-inside-sphere 10 --position "10,10,10" --undo --redo -r], 0, [stdout], [stderr])
|
---|
[b9bfa6] | 36 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/${AUTOTEST_PATH}/Selection/Atoms/AtomsInsideSphere/post/$file], 0, [ignore], [ignore])
|
---|
[512f85] | 37 | # check size of sphere
|
---|
| 38 | AT_SKIP_IF([! awk '' < /dev/null]) # check whether cat is there
|
---|
| 39 | AT_SKIP_IF([! cat >/dev/null < /dev/null]) # check whether awk is there
|
---|
| 40 | AT_SKIP_IF([! wc -l /dev/null]) # check whether wc is there
|
---|
| 41 | AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) > 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
|
---|
| 42 | AT_CHECK([fgrep "2" stdout], 0, [ignore], [ignore])
|
---|
| 43 | AT_CHECK([cat < $file | awk -F" " '{ if (($2-10)*($2-10)+($3-10)*($3-10)+($4-10)*($4-10) < 100) print $1,$2,$3,$4;}' | wc -l], 0, [stdout], [ignore])
|
---|
| 44 | AT_CHECK([fgrep "524" stdout], 0, [ignore], [ignore])
|
---|
| 45 | AT_CLEANUP
|
---|
| 46 |
|
---|