3 # DROPS (Dresden Realtime OPerating System) Component
5 # Makefile-Template to run tests with Fiasco-UX
7 # install.inc is used, see there for further documentation
9 ifeq ($(origin _L4DIR_MK_RUNUX_MK),undefined)
13 .general.d: $(L4DIR)/mk/runux.mk
15 # set a mode, so binary.inc is satisfied
18 # include all Makeconf.locals, define common rules/variables
19 include $(L4DIR)/mk/Makeconf
20 include $(L4DIR)/mk/binary.inc
22 # if we have a system set, build
28 # This is a preliminary test to allow l4check to run Fiasco-UX tests for
29 # multiple SYSTEMS. This currently only works for x86.
31 $(error "$(ROLE) currently does not support $(ARCH).")
34 # now check if the current API has a FIASCOUX variable set and if so use it
35 # XXX could be overloaded by $(OSYSTEM) == $(ARCH)-$(L4API) or $(SYSTEM)
36 ifneq ($(FIASCOUX_$(L4API)),)
37 FIASCOUX = $(FIASCOUX_$(L4API))
39 $(warning "Using generic(?) Fiasco UX "$(FIASCOUX)" to test $(L4API).")
43 # test if variables are set
44 ifeq ($(TEST_SERVER),)
49 # TEST_CLIENT might be empty. Testing server stand-alone
50 ifneq ($(TEST_CLIENT),)
51 TEST_CLIENT_PARAM = $(addprefix -c ,$(TEST_CLIENT))
53 ifneq ($(BASE_SERVERS),)
54 $(warning $(BASE_SERVERS))
55 BASESERVERS = $(foreach server, $(BASE_SERVERS), -b $(server) $(BASE_SERVERS_PARAM_$(server)))
58 # expected output and what to do on mismatch
59 EXPECTED_OUT ?= expected.txt
62 TMP_OUT ?= tmp_out.txt
64 # specify files to delete when doing 'make clean'
65 DEL_ON_CLEAN = $(TMP_OUT) core
67 ifneq ($(DEBUG_PERL),0)
74 MEMORY_ = -m $(MEMORY)
77 ifneq ($(FIASCOUX_PARAM),)
78 FIASCOUX_PARAM_ = -p $(FIASCOUX_PARAM)
81 # allow failure of test
83 # If EXPECT_FAIL is set, the test if the output matches must fail, otherwise
84 # ptest will return an error.
85 ifeq ($(EXPECT_FAIL),1)
86 EXPECT_FAIL_ = --expectfail
93 # if FILTER_KEEP_ALL is set, the Fiasco UX output is only filtered for escape
94 # sequences. All other output is printed into temporary file
95 ifeq ($(FILTER_KEEP_ALL),1)
96 FILTER_KEEP_ = --filterlevel=0
101 # no framebuffer device
103 # If NO_FBUF_DEV is set, Fiasco UX will not open an X window to display
104 # graphical output. This is useful for testing graphical applications.
105 ifeq ($(NO_FBUF_DEV),1)
106 NO_FBUF_DEV_ = --nofb
111 # enable symbols and lines per default
115 ifeq ($(USE_SYMBOLS),y)
116 USE_SYMBOLS_ = --symbols
120 ifeq ($(USE_LINES),y)
128 # install.inc eventually defines rules for every target
129 include $(L4DIR)/mk/install.inc
132 @echo "No test defined, skipping"
134 ptest:: $(EXPECTED_OUT) $(BID_OBJ_Makefile).inc
135 $(VERBOSE)echo "Running Fiasco UX to test $(TEST_SERVER)"
136 $(VERBOSE)EXPECTED_OUT=$(EXPECTED_OUT) PKGNAME=$(PKGNAME) \
137 L4DIR=$(L4DIR) OBJ_BASE=$(OBJ_BASE) TMP_OUT=$(TMP_OUT) \
138 COMPARE_CMD=$(COMPARE_CMD) \
139 $(L4DIR)/mk/ptest -s $(TEST_SERVER) $(TEST_CLIENT_PARAM) \
140 -f $(FIASCOUX) $(FIASCOUX_PARAM_) -t $(TIMEOUT) \
142 $(BASESERVERS) $(DEBUG_PERL_) $(MEMORY_) $(EXPECT_FAIL_) \
143 $(FILTER_KEEP_) $(NO_FBUF_DEV_) $(USE_SYMBOLS_) $(USE_LINES_)
145 genexp:: $(EXPECTED_OUT) $(BID_OBJ_Makefile).inc
148 $(VERBOSE)echo "Running Fiasco UX to generate expected output"
149 $(VERBOSE)EXPECTED_OUT=$(EXPECTED_OUT) PKGNAME=$(PKGNAME) \
150 L4DIR=$(L4DIR) OBJ_BASE=$(OBJ_BASE) TMP_OUT=$(TMP_OUT) \
151 COMPARE=$(COMPARE_CMD) \
152 $(L4DIR)/mk/ptest -s $(TEST_SERVER) $(TEST_CLIENT_PARAM) \
153 -f $(FIASCOUX) $(FIASCOUX_PARAM_) -t $(TIMEOUT) \
155 $(BASESERVERS) $(DEBUG_PERL_) $(MEMORY_) $(EXPECT_FAIL_) \
156 $(FILTER_KEEP_) $(NO_FBUF_DEV_) $(USE_SYMBOLS_) $(USE_LINES_) \
158 $(VERBOSE)touch .expect-autogenerated
160 plainrun:: $(BID_OBJ_Makefile).inc
161 $(VERBOSE)echo "Starting Fiasco UX"
162 $(VERBOSE)EXPECTED_OUT=$(EXPECTED_OUT) PKGNAME=$(PKGNAME) \
163 L4DIR=$(L4DIR) OBJ_BASE=$(OBJ_BASE) TMP_OUT=$(TMP_OUT) \
164 COMPARE_CMD=$(COMPARE_CMD) \
165 $(L4DIR)/mk/ptest -s $(TEST_SERVER) $(TEST_CLIENT_PARAM) \
166 -f $(FIASCOUX) $(FIASCOUX_PARAM_) -t $(TIMEOUT) \
168 $(BASESERVERS) $(DEBUG_PERL_) $(MEMORY_) $(FILTER_KEEP_) \
169 $(NO_FBUF_DEV_) $(USE_SYMBOLS_) $(USE_LINES_) --plainrun
171 endif # system defined
173 ptest genexp plainrun:: $(foreach arch,$(TARGET_SYSTEMS),\
174 $(OBJ_DIR)/OBJ-$(arch)/$(BID_OBJ_Makefile))
175 $(if $(TARGET_SYSTEMS), $(VERBOSE)set -e ; \
176 for d in $(TARGET_SYSTEMS) ; do \
177 PWD=$(OBJ_DIR)/OBJ-$$d $(MAKE) -C $(OBJ_DIR)/OBJ-$$d -f $(BID_OBJ_Makefile) \
180 .PHONY: all ptest genexp plainrun clean cleanall help no_ptest
184 @echo "Specify a target:"
185 @echo "all - run test"
186 @echo "test - run test"
187 @echo "genexp - generate file with expected output"
188 @echo "plainrun - just run binaries (no filter, no comparison)"
189 @echo "clean - delete generated intermediate files"
190 @echo "cleanall - delete all generated files (include genexp target)"
191 @echo "help - this help"
194 endif # _L4DIR_MK_RUNUX_MK undefined