1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:07:45 +00:00

Userland: Install shell tests on Serenity

Also make them runnable anywhere. Previously they required $PWD to be
the directory containing test-commons.inc, and for $PWD to be writable.
This commit is contained in:
Andrew Kaster 2021-01-24 21:42:30 -07:00 committed by Andreas Kling
parent e787738c24
commit 8fc862f710
13 changed files with 19 additions and 13 deletions

View file

@ -18,3 +18,9 @@ set(SOURCES
serenity_bin(Shell) serenity_bin(Shell)
target_link_libraries(Shell LibShell) target_link_libraries(Shell LibShell)
install(DIRECTORY Tests/ DESTINATION usr/Tests/Shell
PATTERN "Tests/*"
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ)

View file

@ -4,7 +4,7 @@ echo "Not running Shell-backgrounding as it has a high failure rate"
echo PASS echo PASS
exit 0 exit 0
source test-commons.inc source $(dirname "$0")/test-commons.inc
setopt --verbose setopt --verbose

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
setopt --verbose setopt --verbose

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
rm -rf shell-test rm -rf shell-test
mkdir -p shell-test mkdir -p shell-test

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
setopt --verbose setopt --verbose

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
# Syntax ok? # Syntax ok?
fn() { echo $* } fn() { echo $* }

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
setopt --verbose setopt --verbose

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
singlecommand_ok=yes singlecommand_ok=yes
multicommand_ok=yes multicommand_ok=yes

View file

@ -1,6 +1,6 @@
#!/bin/Shell #!/bin/Shell
source test-commons.inc source $(dirname "$0")/test-commons.inc
result=no result=no
match hello { match hello {

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
# `head -n 1` should close stdout of the `Shell -c` command, which means the # `head -n 1` should close stdout of the `Shell -c` command, which means the
# second echo should exit unsuccessfully and sigpipe.sh.out should not be # second echo should exit unsuccessfully and sigpipe.sh.out should not be

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
if not test "$*" = "" { fail "Argv list not empty" } if not test "$*" = "" { fail "Argv list not empty" }
if not test "$#" -eq 0 { fail "Argv list empty but count non-zero" } if not test "$#" -eq 0 { fail "Argv list empty but count non-zero" }

View file

@ -1,6 +1,6 @@
#/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
setopt --verbose setopt --verbose

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
source test-commons.inc source $(dirname "$0")/test-commons.inc
# Are comments ignored? # Are comments ignored?
# Sanity check: can we do && and || ? # Sanity check: can we do && and || ?