testing #96
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
joke
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Blocks
#93 peek(1)
bonsai/harakit
#102 Replace str(1) with stris(1)
bonsai/harakit
#103 eep(1)
bonsai/harakit
#127 WIP: scroll(1)
bonsai/harakit
#146 Replace scrut(1) with fileis(1)
bonsai/harakit
Reference: bonsai/harakit#96
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "testing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have some questions and concerns.
@ -0,0 +10,4 @@
. tests/bonsai/test_env
! false
! false -h
GNU false(1), a notoriously POSIX non-compliant implementation, would pass here, as (if I recall) it returns
EXIT_FAILURE
for improper usage. It shouldn't pass, though, because it prints a usage text to the standard output when usage help or version information are queried.I think another good test would be
false --help | wc -c | xargs test 0 =
, though you should double check the exit statuses here before adding it.Why would we test for GNU extensions in our implementation of
true(1)
?It's testing for bloat. It drives home the fact that we will not compromise on making good, simple tools. If we did our tests would fail us.
But if we changed our minds, we could just change our test, and if someone made a PR with changes like that, they would just change the test too.
That's true. I suppose such a test isn't necessary.
@ -0,0 +1,13 @@
#!/bin/sh
Why is this separate from
tests/posix-compat/true.sh
?This is
true(1)
from Bonsai and the one inposix-compat/true.sh
istrue(1p)
Our true(1) and false(1) implementations are POSIX without extensions and shouldn't be extended. Maybe it would be better to only have them in the POSIX compatibility section.
It makes sense to have them in both because the true(1p) test script leverages our script; however, I have just realized that I have implemented the POSIX test suite in a different way than I originally imagined and will make more changes before we can continue this conversation.
@ -0,0 +17,4 @@
exit 1
fi
printf "Starting Bonsai testing.\n\n"
This seems ineligant. Programmatically print the test suite name at
tests/$suite/Name
, falling back to the folder name itself.@ -0,0 +28,4 @@
printf '\n'
done
if ! ls Makefile >/dev/null 2>&1
This should go before the previous
for
loop as it will crash faster on incorrect invocation.Goodness, I just saw the
WIP:
. Sorry for prematurely reviewing. It makes sense then that it seemed that this was unfinished. I really like where this is headed though.I requested it.
No pull requests containing new utilities will be merged until this PR is merged.
#93 #102 #103 #127
All utilities now have tests. Some are better than others, but the foundation is there.
WIP: testingto testingJust some notes regarding inconsistencies.
@ -0,0 +4,4 @@
.
├── bonsai
│ ├── test_env
│ ├── dj.sh
This needs to be updated.
@ -0,0 +7,4 @@
NAME = hru
TARGET = $(NAME)_tests
BINARY = $(BIN)/$(NAME)
Are these variables necessary? Should we use this pattern everywhere?
No, they’re a holdover from a previous draft.
@ -0,0 +28,4 @@
.PHONY: hru_regressions
hru_regressions: $(BIN)/hru
n=1; \
while true; \
Could this be
while printf '%s\n' "$$n" | $(BIN)/hru; do n=$$(($$n * 10))"; done;
?Seems not to work for me.
The current
Makefile
just builds and tests true(1) for me. The following change seems to fix this:but I haven't committed it because this may be a poor solution (Emma, what do you think?).
I edited the
fop_functionality
test to print the actual result versus the expected:but I don't know if you approve of this style. Note the tee(1p) though.
I've edited this comment to remove a report of a fop(1) test failure that's fixed when using fop(1) from the
main
branch.I cannot reproduce this behavior with either
pdpmake(1)
or OpenBSDmake(1)
.OpenBSD/7.5 arm64 make(1):
pdpmake(1) compiled on OpenBSD:
The default target for a Makefile (
make
run with no arguments) is the first target that appears in the Makefile. The first target that appears in the Makefile here is, apparently,default
, a.PHONY
that depends onall
andtest
. Thatdefault
target is the intended behavior of themake
invocation.However before
default
there's aninclude tests/tests.mk
. That file includes all the test files found intests/
. It makes sense that those targets would be considered, as a part of dependency resolution, beforedefault
. This deviation from intended behavior makes logical sense and is being demonstrated by thesemake
invocations shown above. My fix based on this understanding works conceptually and in practice.I'm not sure why your system is behaving differently. Could you
git status
to see if the repository is any different?Merged.
Pull request closed