aboutsummaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorRyan S. Arnold <ryan.arnold@linaro.org>2013-12-11 14:08:51 -0600
committerRyan S. Arnold <ryan.arnold@linaro.org>2013-12-11 14:08:51 -0600
commit2a4ec7fa0b7c48e0c6e05a7549f64e3336022f45 (patch)
tree639734f50e18499db6969fdab3dfb8a65708eddb /test.sh
parentc9ec21200260bdb26d9fe9b26d7ce390579a0ca2 (diff)
cbuild2.sh: Added check_directive() to unify bounds checking.
Also added accompanying top-level test.sh fragments to test check_directive. Change-Id: Ia42a4b241a5ca62d41dccf1d8e023980ad0a04d0
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh53
1 files changed, 50 insertions, 3 deletions
diff --git a/test.sh b/test.sh
index 3d77c0c0..eb05e1bb 100755
--- a/test.sh
+++ b/test.sh
@@ -224,14 +224,41 @@ cb_commands="--build=all"
match="A space is expected"
test_failure "${cb_commands}" "${match}"
+cb_commands="--dryrun --build --foobar"
+match="found the next"
+test_failure "${cb_commands}" "${match}"
+
+cb_commands="--dryrun --build"
+match="requires a directive"
+test_failure "${cb_commands}" "${match}"
+
+cb_commands="--checkout"
+match="requires a directive"
+test_failure "${cb_commands}" "${match}"
+
cb_commands="--checkout=all"
match="A space is expected"
test_failure "${cb_commands}" "${match}"
+cb_commands="--checkout --all"
+match="found the next"
+test_failure "${cb_commands}" "${match}"
+
cb_commands="--checkout --foo"
-match="requires a directive"
+match="found the next"
test_failure "${cb_commands}" "${match}"
+cb_commands="--dryrun --checkout all"
+match=''
+test_pass "${cb_commands}" "${match}"
+
+cb_commands="--dryrun --checkout gcc.git"
+match=''
+test_pass "${cb_commands}" "${match}"
+
+
+
+
cb_commands="--dryrun --target arm-none-linux-gnueabihf --checkout glibc.git"
match=''
test_pass "${cb_commands}" "${match}"
@@ -300,8 +327,8 @@ cb_commands="--snapshots"
match='requires a directive'
test_failure "${cb_commands}" "${match}"
-cb_commands="--snapshots=foo/bar --build all"
-match="A space is expected"
+cb_commands="--snapshots --sooboo"
+match='found the next'
test_failure "${cb_commands}" "${match}"
cb_commands="--snapshots=foo/bar --build all"
@@ -312,6 +339,26 @@ cb_commands="--dryrun --snapshots ${local_snapshots} --build all"
match=''
test_pass "${cb_commands}" "${match}"
+cb_commands="--dryrun --build gcc.git"
+match=''
+test_pass "${cb_commands}" "${match}"
+
+cb_commands="--dryrun --build asdflkajsdflkajsfdlasfdlaksfdlkaj.git"
+match="Couldn't find the source for"
+test_failure "${cb_commands}" "${match}"
+
+cb_commands="--set"
+match='requires a directive'
+test_failure "${cb_commands}" "${match}"
+
+cb_commands="--set --foobar"
+match='found the next'
+test_failure "${cb_commands}" "${match}"
+
+cb_commands="--set=libc=glibc"
+match="A space is expected"
+test_failure "${cb_commands}" "${match}"
+
cb_commands="--set gcc=meh"
match="'gcc' is not a supported package"
test_failure "${cb_commands}" "${match}"