mirror of
https://github.com/janet-lang/janet
synced 2024-11-24 17:27:18 +00:00
Distinguish between subprocess when testing.
This commit is contained in:
parent
676b233566
commit
fbb0711ae1
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -88,4 +88,4 @@ jobs:
|
|||||||
- name: Compile the project
|
- name: Compile the project
|
||||||
run: make RUN="qemu-arm -L /usr/arm-linux-gnueabi/" CC=arm-linux-gnueabi-gcc LD=arm-linux-gnueabi-gcc
|
run: make RUN="qemu-arm -L /usr/arm-linux-gnueabi/" CC=arm-linux-gnueabi-gcc LD=arm-linux-gnueabi-gcc
|
||||||
- name: Test the project
|
- name: Test the project
|
||||||
run: make RUN="qemu-arm -L /usr/arm-linux-gnueabi/" test
|
run: make RUN="qemu-arm -L /usr/arm-linux-gnueabi/" SUBRUN="qemu-arm -L /usr/arm-linux-gnueabi/" test
|
||||||
|
@ -357,9 +357,8 @@ SlotHeadPair *dohead_destructure(JanetCompiler *c, SlotHeadPair *into, JanetFopt
|
|||||||
|
|
||||||
if (has_drop && can_destructure_lhs && rhs_is_indexed) {
|
if (has_drop && can_destructure_lhs && rhs_is_indexed) {
|
||||||
/* Code is of the form (def [a b] [1 2]), avoid the allocation of two tuples */
|
/* Code is of the form (def [a b] [1 2]), avoid the allocation of two tuples */
|
||||||
JanetView view_lhs, view_rhs;
|
JanetView view_lhs = {0};
|
||||||
view_rhs.len = 0;
|
JanetView view_rhs = {0};
|
||||||
view_lhs.len = 0;
|
|
||||||
janet_indexed_view(lhs, &view_lhs.items, &view_lhs.len);
|
janet_indexed_view(lhs, &view_lhs.items, &view_lhs.len);
|
||||||
janet_indexed_view(rhs, &view_rhs.items, &view_rhs.len);
|
janet_indexed_view(rhs, &view_rhs.items, &view_rhs.len);
|
||||||
int found_amp = 0;
|
int found_amp = 0;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
(def janet (dyn :executable))
|
(def janet (dyn :executable))
|
||||||
|
|
||||||
# Subprocess should inherit the "RUN" parameter for fancy testing
|
# Subprocess should inherit the "RUN" parameter for fancy testing
|
||||||
(def run (filter next (string/split " " (os/getenv "RUN" ""))))
|
(def run (filter next (string/split " " (os/getenv "SUBRUN" ""))))
|
||||||
|
|
||||||
(repeat 10
|
(repeat 10
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
(import ./helper :prefix "" :exit true)
|
(import ./helper :prefix "" :exit true)
|
||||||
(start-suite)
|
(start-suite)
|
||||||
|
|
||||||
|
(def janet (dyn :executable))
|
||||||
|
(def run (filter next (string/split " " (os/getenv "SUBRUN" ""))))
|
||||||
|
|
||||||
# OS Date test
|
# OS Date test
|
||||||
# 719f7ba0c
|
# 719f7ba0c
|
||||||
(assert (deep= {:year-day 0
|
(assert (deep= {:year-day 0
|
||||||
@ -118,14 +121,14 @@
|
|||||||
|
|
||||||
# os/execute with environment variables
|
# os/execute with environment variables
|
||||||
# issue #636 - 7e2c433ab
|
# issue #636 - 7e2c433ab
|
||||||
(assert (= 0 (os/execute [(dyn :executable) "-e" "(+ 1 2 3)"] :pe
|
(assert (= 0 (os/execute [;run janet "-e" "(+ 1 2 3)"] :pe
|
||||||
(merge (os/environ) {"HELLO" "WORLD"})))
|
(merge (os/environ) {"HELLO" "WORLD"})))
|
||||||
"os/execute with env")
|
"os/execute with env")
|
||||||
|
|
||||||
# os/execute regressions
|
# os/execute regressions
|
||||||
# 427f7c362
|
# 427f7c362
|
||||||
(for i 0 10
|
(for i 0 10
|
||||||
(assert (= i (os/execute [(dyn :executable) "-e"
|
(assert (= i (os/execute [;run janet "-e"
|
||||||
(string/format "(os/exit %d)" i)] :p))
|
(string/format "(os/exit %d)" i)] :p))
|
||||||
(string "os/execute " i)))
|
(string "os/execute " i)))
|
||||||
|
|
||||||
@ -138,7 +141,7 @@
|
|||||||
"/dev/null"))
|
"/dev/null"))
|
||||||
(os/open path :w))
|
(os/open path :w))
|
||||||
(with [dn (devnull)]
|
(with [dn (devnull)]
|
||||||
(os/execute [(dyn :executable)
|
(os/execute [;run janet
|
||||||
"-e"
|
"-e"
|
||||||
"(print :foo) (eprint :bar)"]
|
"(print :foo) (eprint :bar)"]
|
||||||
:px
|
:px
|
||||||
|
Loading…
Reference in New Issue
Block a user