Matt McCutchen's Web Site
/
mgear
/
mgear.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename Mage to mgear, a less common and thus less confusable name.
[mgear/mgear.git]
/
testsuite
diff --git
a/testsuite
b/testsuite
index
3329a66
..
210274e
100755
(executable)
--- a/
testsuite
+++ b/
testsuite
@@
-1,7
+1,7
@@
#!/bin/bash
#!/bin/bash
-# Test suite for
Mage
.
+# Test suite for
mgear
.
-echo "Test suite for
Mage
"
+echo "Test suite for
mgear
"
cd "$(dirname "$0")"
Z=test-zone
cd "$(dirname "$0")"
Z=test-zone
@@
-18,7
+18,7
@@
section=Initialization
trap 'echo; echo "TEST SUITE FAILED in section $section!" >&2' ERR
#set -x
trap 'echo; echo "TEST SUITE FAILED in section $section!" >&2' ERR
#set -x
-ln -s ../m
age.mk mage.mk
+ln -s ../m
gear.mk .
function fail {
false
function fail {
false
@@
-30,9
+30,9
@@
function start_section {
echo "SECTION: $1"
}
echo "SECTION: $1"
}
-function do_m
age
{
+function do_m
gear
{
echo "Running: make $*"
echo "Running: make $*"
- make "$@" 2>&1 | tee m
age
.log
+ make "$@" 2>&1 | tee m
gear
.log
}
function assert_contents {
}
function assert_contents {
@@
-46,20
+46,20
@@
function assert_contents {
# Options can be passed to grep: assert_saw -i override
function assert_saw {
# Options can be passed to grep: assert_saw -i override
function assert_saw {
- if grep -q "$@" m
age
.log; then
+ if grep -q "$@" m
gear
.log; then
echo "Good, saw '${@:$#}' in build log."
else
echo "Expected '${@:$#}' in build log but didn't see it! Log:"
echo "Good, saw '${@:$#}' in build log."
else
echo "Expected '${@:$#}' in build log but didn't see it! Log:"
- cat m
age
.log
+ cat m
gear
.log
fail
fi
}
function assert_not_saw {
fail
fi
}
function assert_not_saw {
- if ! grep -q "$@" m
age
.log; then
+ if ! grep -q "$@" m
gear
.log; then
echo "Good, saw '${@:$#}' in build log."
else
echo "Did not expect '${@:$#}' in build log but saw it! Log:"
echo "Good, saw '${@:$#}' in build log."
else
echo "Did not expect '${@:$#}' in build log but saw it! Log:"
- cat m
age
.log
+ cat m
gear
.log
fail
fi
}
fail
fi
}
@@
-105,7
+105,7
@@
function assert_not_touched {
# Tests an implicit rule and two competing explicit rules.
# Watch those dollar signs!
cat >Makefile <<'EOF'
# Tests an implicit rule and two competing explicit rules.
# Watch those dollar signs!
cat >Makefile <<'EOF'
-include m
age
.mk
+include m
gear
.mk
.SECONDARY:
include hc-rule.mk
$(call mg-define-rule,%,%.ssc,sleep 1 && grep 'warn' $$< && sed -e 's_//.*$$$$__' $$< >$$t)
.SECONDARY:
include hc-rule.mk
$(call mg-define-rule,%,%.ssc,sleep 1 && grep 'warn' $$< && sed -e 's_//.*$$$$__' $$< >$$t)
@@
-136,7
+136,7
@@
EOF
# Run and make sure the files were compiled correctly.
start_section "Initial full build"
# Run and make sure the files were compiled correctly.
start_section "Initial full build"
-do_m
age
foo bar index
+do_m
gear
foo bar index
assert_contents foo <<'EOF'
This is the foo file.
assert_contents foo <<'EOF'
This is the foo file.
@@
-166,7
+166,7
@@
assert_saw sort index.in >index.tmp
# to bar.g accidentally being too old.
start_section "Replay bar warning"
# to bar.g accidentally being too old.
start_section "Replay bar warning"
-do_m
age
foo bar index
+do_m
gear
foo bar index
assert_uptodate foo
assert_uptodate bar
assert_uptodate foo
assert_uptodate bar
@@
-179,7
+179,7
@@
assert_not_saw -i overrid
start_section "Override bar"
sleep 1 # No racy cleanliness
echo NEWCONTENT >bar
start_section "Override bar"
sleep 1 # No racy cleanliness
echo NEWCONTENT >bar
-do_m
age
bar
+do_m
gear
bar
assert_saw -i overrid
assert_contents bar <<<NEWCONTENT
assert_saw -i overrid
assert_contents bar <<<NEWCONTENT
@@
-189,7
+189,7
@@
assert_contents bar <<<NEWCONTENT
start_section "Change foo.hc"
sleep 1 # No racy cleanliness
echo 'look: # Last-minute addition.' >>foo.hc
start_section "Change foo.hc"
sleep 1 # No racy cleanliness
echo 'look: # Last-minute addition.' >>foo.hc
-do_m
age
index foo
+do_m
gear
index foo
assert_uptodate index
assert_generated foo
assert_uptodate index
assert_generated foo
@@
-208,7
+208,7
@@
start_section "Command change for % <- %.hc"
cat >hc-rule.mk <<'EOF'
$(call mg-define-rule,%,%.hc,sed -e 's_ *#.*$$$$__' $$< >$$t)
EOF
cat >hc-rule.mk <<'EOF'
$(call mg-define-rule,%,%.hc,sed -e 's_ *#.*$$$$__' $$< >$$t)
EOF
-do_m
age
foo
+do_m
gear
foo
assert_generated foo
assert_contents foo <<'EOF'
assert_generated foo
assert_contents foo <<'EOF'
@@
-226,7
+226,7
@@
start_section "Inconsequential change to foo.hc"
sleep 1 # No racy cleanliness
remember_mtime foo foo.g
sed -e '$s/look: /look:/' -i foo.hc
sleep 1 # No racy cleanliness
remember_mtime foo foo.g
sed -e '$s/look: /look:/' -i foo.hc
-do_m
age
foo
+do_m
gear
foo
assert_generated foo
assert_touched foo.g
assert_generated foo
assert_touched foo.g