Skip to content
Snippets Groups Projects
Commit 93dbc482 authored by Basile Desloges's avatar Basile Desloges
Browse files

[eacsl:tests] Allow the use of `PTESTS_OPTS` to change the test configuration

- The makefile updates `PTESTS_OPTS` instead of `PLUGIN_PTESTS_OPTS` so
  that modifications of `PTESTS_OPTS` by the user are taken into
  account.
- All the test config files are generated at the same time.
- The test dependencies of E-ACSL are added to the target
  `plugins_ptests_config` to be generated along with the main target.
  This in turn allow the user to directly use `ptests.opt` to launch
  tests after compiling the plugin.
parent bfa4eb3d
No related branches found
No related tags found
No related merge requests found
......@@ -167,20 +167,27 @@ PLUGIN_TESTS_DIRS := \
PLUGIN_TESTS_LIB := $(EACSL_PLUGIN_DIR)/tests/print.ml
DEV=
DEV?=
ifeq ("$(DEV)","yes")
EACSL_TEST_CONFIG=dev
EACSL_TEST_CONFIG:=dev
else
EACSL_TEST_CONFIG:=ci
endif
PLUGIN_PTESTS_OPTS:=-config $(EACSL_TEST_CONFIG)
# Prepend PTESTS_OPTS with the test config to use. If the user-provided
# PTESTS_OPTS variable contains another -config instruction, then it will be
# prioritized over the one selected by the Makefile.
E_ACSL_TESTS E_ACSL_DEFAULT_TESTS: override PTESTS_OPTS:=-config $(EACSL_TEST_CONFIG) $(PTESTS_OPTS)
TEST_DEPENDENCIES:= \
$(EACSL_PLUGIN_DIR)/tests/ptests_config \
$(EACSL_PLUGIN_DIR)/tests/test_config_$(EACSL_TEST_CONFIG) \
$(EACSL_PLUGIN_DIR)/tests/test_config_ci \
$(EACSL_PLUGIN_DIR)/tests/test_config_dev \
$(EACSL_PLUGIN_DIR)/tests/print.cmxs \
$(EACSL_PLUGIN_DIR)/tests/print.cmo
# Add the test dependencies to the test targets, but also to
# `plugins_ptests_config` so that they are built along with the main target.
plugins_ptests_config: $(TEST_DEPENDENCIES)
E_ACSL_TESTS E_ACSL_DEFAULT_TESTS: $(TEST_DEPENDENCIES)
tests:: $(TEST_DEPENDENCIES)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment