sbsv2/raptor/test/smoke_suite/test_resources/retry/retry_test.flm
author lorewang
Wed, 01 Dec 2010 16:05:36 +0800
changeset 715 e0739b8406dd
parent 591 22486c9c7b15
permissions -rw-r--r--
Specify extenal tool with path


# This FLM is for testing the retry mechanism in our rules.
# It will fail on the first FAILURES invocations and then succeed.

MY_COUNTER:=$(EPOCROOT)/epoc32/build/$(COUNTER)

define retry_test
ALL::
	$(call startrule,retry_test) \
	(TRY=1; \
	while (( $$$$TRY <= $(FAILURES) )); do \
		if [ ! -f $(MY_COUNTER).$$$$TRY ]; then \
			touch $(MY_COUNTER).$$$$TRY; \
			echo DELIBERATE FAILURE $$$$TRY for $(COUNTER); \
			exit 1; \
		fi; \
		(( TRY=$$$$TRY + 1 )); \
	done) && \
	echo SUCCESS for $(COUNTER) && \
	touch $(MY_COUNTER).ok \
	$(call endrule,retry_test)
endef
$(eval $(retry_test))