Skip to content

Commit 3f5242e

Browse files
committedJan 23, 2025
Skip test_dir test if atomvm:posix_opendir/1 is not available
Could happen with CI for s390x https://github.com/atomvm/AtomVM/actions/runs/12923981002/job/36043219011?pr=1486#step:7:755 Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 0d6a00e commit 3f5242e

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
 

‎libs/etest/src/etest.erl

+8-2
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,15 @@ do_run_test(Test) ->
188188
false ->
189189
ok
190190
end,
191+
Char = case Result of
192+
ok -> "+";
193+
skipped -> "s"
194+
end,
191195
case erlang:system_info(machine) of
192196
"BEAM" ->
193-
io:format("+");
197+
io:format(Char);
194198
_ ->
195-
console:puts("+"),
199+
console:puts(Char),
196200
console:flush()
197201
end,
198202
Result
@@ -213,5 +217,7 @@ check_results([]) ->
213217
ok;
214218
check_results([{_Test, ok} | T]) ->
215219
check_results(T);
220+
check_results([{_Test, skipped} | T]) ->
221+
check_results(T);
216222
check_results([Failure | _T]) ->
217223
{fail, Failure}.

‎tests/libs/eavmlib/test_dir.erl

+7-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@
2525
-include("etest.hrl").
2626

2727
test() ->
28-
{ok, Dir} = atomvm:posix_opendir("."),
29-
[eof | _Entries] = all_dir_entries(Dir, []),
30-
ok = atomvm:posix_closedir(Dir).
28+
case catch (atomvm:posix_opendir(".")) of
29+
{ok, Dir} ->
30+
[eof | _Entries] = all_dir_entries(Dir, []),
31+
ok = atomvm:posix_closedir(Dir);
32+
{'EXIT', _} ->
33+
skipped
34+
end.
3135

3236
all_dir_entries(Dir, Acc) ->
3337
case atomvm:posix_readdir(Dir) of

0 commit comments

Comments
 (0)