Skip to content

Commit

Permalink
test: Add primary testing and usage message
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Venriès <thomas.venries@gmail.com>
  • Loading branch information
Thomas Venriès committed Nov 5, 2017
1 parent 8dc0f24 commit 6fb558e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
9 changes: 6 additions & 3 deletions test/test-args.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/sh

# Caution: Required three monitors

[ "$#" -ne 3 ] && { echo 'Three monitor ids are required.'; exit 2; }
if [ "$#" -ne 3 ]; then
echo 'Usage: test-args.sh MON_ID1 MON_ID2 MON_ID3'
echo
echo 'Three monitor ids are required. Ids are given by `mons`.'
exit 1
fi

echo 'TEST: Bad Arguments'
echo '#=========================#'
Expand Down
48 changes: 33 additions & 15 deletions test/test-common.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
#!/bin/sh

echo 'TEST: Common Modes'
echo '#=========================#'
./mons
echo '#=========================#'
if [ "$#" -ne 2 ]; then
echo 'Usage: test-common.sh CURR_MON_NAME MON_NAME'
echo
echo 'Monitor names are required. Names are given by "mons".
CURR_MON_NAME is your current monitor and the second one is reserved
for primary test.'
exit 1
fi

./mons -o ; echo "test: primary" ; sleep 8
./mons -s ; echo "test: second" ; sleep 8
./mons -e left ; echo "test: extend left" ; sleep 8
./mons -d ; echo "test: duplicate" ; sleep 8
./mons -m ; echo "test: mirror" ; sleep 8
./mons -e right ; echo "test: extend right" ; sleep 8
./mons -e top ; echo "test: extend top" ; sleep 8
./mons -e bottom ; echo "test: extend bottom" ; sleep 8
./mons -o ; echo "test: primary" ; sleep 8
./mons -s ; echo "test: second" ; sleep 8
./mons -o ; echo "test: primary"
Test_Common () {
echo 'TEST: Common Modes'
echo '#=========================#'
./mons
echo '#=========================#'

./mons -o ; echo "test: primary" ; sleep 8
./mons -s ; echo "test: second" ; sleep 8
./mons -e left ; echo "test: extend left" ; sleep 8
./mons -d ; echo "test: duplicate" ; sleep 8
./mons -m ; echo "test: mirror" ; sleep 8
./mons -e right ; echo "test: extend right" ; sleep 8
./mons -e top ; echo "test: extend top" ; sleep 8
./mons -e bottom ; echo "test: extend bottom" ; sleep 8
./mons -o ; echo "test: primary" ; sleep 8
./mons -s ; echo "test: second" ; sleep 8
./mons -o ; echo "test: primary"
}

./mons -o --primary "$1"
Test_Common
./mons -o --primary "$2"
echo "[ Primary has been set: $1 ]"
Test_Common
./mons -o --primary "$1"
7 changes: 6 additions & 1 deletion test/test-select.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

[ "$#" -ne 3 ] && { echo 'Three monitor ids are required.'; exit 2; }
if [ "$#" -ne 3 ]; then
echo 'Usage: test-select.sh MON_ID1 MON_ID2 MON_ID3'
echo
echo 'Three monitor ids are required. Ids are given by `mons`.'
exit 1
fi

echo 'TEST: Selections'
echo '#=========================#'
Expand Down

0 comments on commit 6fb558e

Please sign in to comment.