Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 59cbb35

Browse files
committed
Merge pull request #3 from peter-b/tests/detect-headless
[[ Tests ]] Only run LCS tests in -ui mode by default on headless Linux.
2 parents decc516 + c2064ea commit 59cbb35

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/lcs/Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@ guess_platform_script := \
1919
esac
2020
guess_platform := $(shell $(guess_platform_script))
2121

22+
# When running on headless Linux, run tests in -ui mode.
23+
guess_flags_script := \
24+
if echo $(guess_platform) | grep "^linux" &>/dev/null && \
25+
! xset -q &>/dev/null; then \
26+
echo "-ui"; \
27+
fi
28+
guess_flags := $(shell $(guess_flags_script))
29+
2230
bin_dir ?= $(top_srcdir)/$(guess_platform)-bin
2331

2432
ENGINE ?= $(bin_dir)/standalone-community
25-
ENGINE_FLAGS ?= -ui
33+
34+
ENGINE_FLAGS ?= $(guess_flags)
2635

2736
################################################################
2837

@@ -42,4 +51,4 @@ TEST_RUNNER_SCRIPT = _testrunner.livecodescript
4251

4352
livecodescript-check: $(ENGINE)
4453
@rm -f $(TEST_LOG)
45-
@$(ENGINE) $(ENGINE_FLAGS) $(TEST_RUNNER_SCRIPT) run
54+
$(ENGINE) $(ENGINE_FLAGS) $(TEST_RUNNER_SCRIPT) run

0 commit comments

Comments
 (0)