-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
[ -f testing.sh ] && . testing.sh | ||
|
||
#testing "name" "command" "result" "infile" "stdin" | ||
|
||
TOP="$(readlink -f .)" | ||
|
||
testcmd '' '.' "$TOP\n" '' '' | ||
testcmd '-z' '-z . | tr "\0" X' "${TOP}X" '' '' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
landley
Author
Owner
|
||
touch file | ||
testcmd 'file' 'file' "$TOP/file\n" '' '' | ||
mkdir -p one/two/three | ||
testcmd 'dir' 'one/two/three' "$TOP/one/two/three\n" '' '' | ||
testcmd '--relative-to' '. --relative-to=one/two/three' '../../..\n' '' '' | ||
testcmd '--relative-base' 'one one/two one/two/three --relative-base=one/two' \ | ||
"$TOP/one\n.\nthree\n" '' '' | ||
testcmd '--relative-base stomps --relative-to' \ | ||
'--relative-to=.. --relative-base=one/two one' "$TOP/one\n" '' '' | ||
testcmd 'missing defaults to -m' 'missing' "$TOP/missing\n" '' '' | ||
testcmd 'missing -e' '-e missing 2>/dev/null || echo ok' 'ok\n' '' '' | ||
|
||
# The -s tests use $PWD instead of $TOP because symlinks in path _to_ here | ||
# should not be resolved either. The shell exports $PWD: use it. | ||
ln -s ./one uno | ||
testcmd '-s' '-s uno/two' "$PWD/uno/two\n" '' '' | ||
ln -s one/two dos | ||
testcmd '-s link/..' '-es dos/three' "$PWD/dos/three\n" '' '' | ||
testcmd '-s .. eats symlink' '-s dos/..' "$PWD\n" '' '' | ||
# In toybox this test is consistent with the previous one | ||
toyonly testing '-s .. eats symlink in $PWD' \ | ||
'cd dos && realpath -s ..' "$PWD\n" '' '' | ||
# Logically -es means the _symlink_ should exist, but match behavior... | ||
ln -s missing dangling | ||
testcmd '-es dangling symlink' '-es dangling 2>/dev/null || echo ok' \ | ||
'ok\n' '' '' | ||
testcmd '-ms' '-ms dangling/../dos/../one/two' "$PWD/one/two\n" '' '' | ||
ln -s ../two/.. one/two/ichi | ||
testcmd '-es' '-es one/two/ichi/two/ichi/two' "$PWD/one/two/ichi/two/ichi/two\n" '' '' |
4 comments
on commit 9aa39ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm not blocked on it, just busy juggling other things and it was Friday so I didn't want to block you pulling in your own fixes I'd just merged. (Which seem to have broken my kernel build by the way: it's erroring about signal 0. Hoping to find time to track that down this weekend...)
"Tests running ahead of implementation" is tabsplosion style technical debt. It means I thought I'd finish this thing real quick and instead got nested interrupts 5 levels deep...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, toysh has a lot of aspirational tests (and more in a text file I haven't put in the test suite yet, and even more in blog entries I need to go back and collate), but that's still in pending. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm not blocked on it, just busy juggling other things and it was Friday so I didn't want to block you pulling in your own fixes I'd just merged. (Which seem to have broken my kernel build by the way: it's erroring about signal 0. Hoping to find time to track that down this weekend...)
"Tests running ahead of implementation" is tabsplosion style technical debt. It means I thought I'd finish this thing real quick and instead got nested interrupts 5 levels deep...
i see that the CI is broken too:
PASS: paste -d '私\0̴̗̞̠eq' - - - - - -
patch: xsignal 0: Invalid argument
FAIL: patch create file
echo -ne '
--- /dev/null
+++ bork
@@ -0,0 +1,3 @@
+one
+two
+three
' | patch >/dev/null && cat bork
--- expected 2021-08-27 13:44:45.685876590 +0000
+++ actual 2021-08-27 13:44:45.685876590 +0000
make: *** [Makefile:76: tests] Error 1
@@ -1,3 +0,0 @@
-one
-two
-three
Error: Process completed with exit code 2.
(i love that we have CI, but i wish i could "subscribe" to failures...)
anyway, yeah, that looks like my fault. one more change needed to support kill -0:
diff --git a/lib/portability.c b/lib/portability.c
index c95a7526..44259a34 100644
--- a/lib/portability.c
+++ b/lib/portability.c
@@ -467,7 +467,8 @@ void xsignal_all_killers(void *handler)
if (!handler) handler = SIG_DFL;
for (i = 0; signames[i].num != SIGCHLD; i++)
- if (signames[i].num != SIGKILL) xsignal(signames[i].num, handler);
+ if (signames[i].num && signames[i].num != SIGKILL)
+ xsignal(signames[i].num, handler);
}
// Convert a string like "9", "KILL", "SIGHUP", or "SIGRTMIN+2" to a number.
(i'll send that as a patch to the mailing list too for convenience.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I hit that here too (alas right after I committed and pushed it I noticed it broke the kernel build in mkroot). Haven't gotten much toybox dev time since then so I hadn't checked in and pushed my local fix. (Same "start at 1" you already did for list_signals.)
this broke CI because the checked-in toybox realpath doesn't have a -z option... (that's not the only problem, just the first one :-) )