summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorcoderdreams <coderdreams@gmail.com>2021-05-30 12:15:20 -0300
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-22 18:54:40 +0430
commit6bc7f2204e32fb5ef824fc7ccb5ce28335c606f8 (patch)
treee5c91e2c913c2690fd384003b60dd2dbb38cdadc /Userland
parent9ffb3e7e3024a77a3b5688ee1d3c1b6e0d772958 (diff)
downloadserenity-6bc7f2204e32fb5ef824fc7ccb5ce28335c606f8.zip
Tests: Run each test in their respective directories
This is so they can find their associated resources and it's the same behavior as in Lagom. This also required changing some tests so that they could write their resources in a writable location.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Shell/Tests/heredocs.sh4
-rw-r--r--Userland/Shell/Tests/loop.sh6
2 files changed, 8 insertions, 2 deletions
diff --git a/Userland/Shell/Tests/heredocs.sh b/Userland/Shell/Tests/heredocs.sh
index c1c4c6b376..128c495562 100644
--- a/Userland/Shell/Tests/heredocs.sh
+++ b/Userland/Shell/Tests/heredocs.sh
@@ -1,6 +1,8 @@
#!/bin/sh
source $(dirname "$0")/test-commons.inc
+# go to a writable directory
+cd /tmp
# Simple usage, single doc
echo <<-test > sh.doc.test
@@ -71,4 +73,6 @@ test
test2
rm -f sh.doc.test
+# return to original directory
+cd -
pass
diff --git a/Userland/Shell/Tests/loop.sh b/Userland/Shell/Tests/loop.sh
index e040280ceb..f5a5602dbe 100644
--- a/Userland/Shell/Tests/loop.sh
+++ b/Userland/Shell/Tests/loop.sh
@@ -1,7 +1,8 @@
#!/bin/sh
source $(dirname "$0")/test-commons.inc
-
+# go to a writable directory
+cd /tmp
singlecommand_ok=yes
multicommand_ok=yes
inlineexec_ok=yes
@@ -95,5 +96,6 @@ if not test \
fail "Something failed :("
}
-
+# return to original directory
+cd -
echo PASS