Skip to content

Commit 9fb218a

Browse files
authored
Update promote target to use the one machinery (oxcaml#28)
1 parent b5ea912 commit 9fb218a

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

testsuite/Makefile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ default:
101101
@echo " one TEST=f launch just this single test"
102102
@echo " one DIR=p launch the tests located in path p"
103103
@echo " one LIST=f launch the tests listed in f (one per line)"
104-
@echo " promote DIR=p promote the reference files for the tests in p"
104+
@echo " promote TEST=f promote the output for this single test"
105+
@echo " promote DIR=p promote the output for the tests located in path p"
106+
@echo " promote LIST=f promote the output for the tests listed in f (one \
107+
per line)"
105108
@echo " lib build library modules"
106109
@echo " tools build test tools"
107110
@echo " clean delete generated files"
@@ -220,7 +223,7 @@ one: lib tools
220223
@case "$(words $(DIR) $(LIST) $(TEST))" in \
221224
0) echo 'No value set for variable DIR, LIST or TEST'>&2; exit 1;; \
222225
1) exit 0;; \
223-
*) echo 'Please specify just one of DIR, LIST or TEST'>&2; exit 1;; \
226+
*) echo 'Please specify exactly one of DIR, LIST or TEST'>&2; exit 1;; \
224227
esac
225228
@if [ -n '$(DIR)' ] && [ ! -d '$(DIR)' ]; then \
226229
echo "Directory '$(DIR)' does not exist."; exit 1; \
@@ -280,22 +283,8 @@ clean-one:
280283
fi
281284

282285
.PHONY: promote
283-
promote:
284-
@if [ -z "$(DIR)" ]; then \
285-
echo "No value set for variable 'DIR'."; \
286-
exit 1; \
287-
fi
288-
@if [ ! -d $(DIR) ]; then \
289-
echo "Directory '$(DIR)' does not exist."; \
290-
exit 1; \
291-
fi
292-
@if $(ocamltest) -list-tests $(DIR) >/dev/null 2>&1; then \
293-
$(MAKE) exec-ocamltest DIR=$(DIR) \
294-
OCAMLTESTENV="OCAMLTESTDIR=$(OCAMLTESTDIR_CYGPATH)" \
295-
PROMOTE="true"; \
296-
else \
297-
cd $(DIR) && $(MAKE) TERM=dumb BASEDIR=$(BASEDIR) promote; \
298-
fi
286+
promote: lib tools
287+
@$(MAKE) one PROMOTE=true
299288

300289
.PHONY: lib
301290
lib:

0 commit comments

Comments
 (0)