@@ -12,6 +12,8 @@ make build # compile and link
12
12
make clean # remove build artifacts
13
13
ALL=1 # remove entire artifacts directory
14
14
make test # run tests
15
+ TEST=test # run only test `test` with Redis output
16
+ TEST_ARGS=args # add extra RLTest `args`
15
17
make pack # create installation packages
16
18
PACK_DEPS=0 # do not pack dependencies
17
19
INTO=dir # place artifacts in `dir`
@@ -136,25 +138,37 @@ TEST_REPORT_DIR ?= $(PWD)
136
138
137
139
ifeq ($(TEST ) ,)
138
140
TEST =basic_tests.py
141
+ PYDEBUG =
142
+ else
143
+ TEST_ARGS += -s
144
+ PYDEBUG =1
139
145
endif
140
146
147
+ TEST_PREFIX =set -e; cd $(ROOT ) /test
148
+ TEST_CMD =\
149
+ DEVICE=$(DEVICE ) PYDEBUG=$(PYDEBUG ) \
150
+ python3 -m RLTest $(TEST_ARGS ) --test $(TEST ) --module $(INSTALL_DIR ) /redisai.so
151
+
152
+ GEN ?= 1
153
+ SLAVES ?= 1
154
+ AOF ?= 1
155
+
141
156
test :
142
157
ifneq ($(NO_LFS ) ,1)
143
158
$(SHOW)if [ "$(git lfs env > /dev/null 2>&1 ; echo $?)" != "0" ]; then cd $(ROOT); git lfs install; fi
144
159
$(SHOW)cd $(ROOT); git lfs pull
145
160
endif
146
- $(SHOW)set -e ;\
147
- cd $(ROOT)/test ;\
148
- DEVICE=$(DEVICE) ;\
149
- { \
150
- python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so ;\
151
- printf "\nTests with --use-slaved:\n\n" ;\
152
- python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so --use-slaves ;\
153
- printf "\nTests with --use-aof:\n\n" ;\
154
- python3 -m RLTest $(TEST_ARGS) --test $(TEST) --module $(INSTALL_DIR)/redisai.so --use-aof ;\
155
- }
156
- # Commented until the MacOS CI is available
157
- # python3 -m RLTest $(TEST_ARGS) --test double-panda.py --module $(INSTALL_DIR)/redisai.so
161
+ ifeq ($(GEN ) ,1)
162
+ $(SHOW)$(TEST_PREFIX); $(TEST_CMD)
163
+ endif
164
+ ifeq ($(AOF ) ,1)
165
+ $(SHOW)$(TEST_PREFIX); printf "\nTests with --use-aof:\n\n" ;\
166
+ $(TEST_CMD) --use-aof
167
+ endif
168
+ ifeq ($(SLAVES ) ,1)
169
+ $(SHOW)$(TEST_PREFIX); printf "\nTests with --use-slaves:\n\n" ;\
170
+ $(TEST_CMD) --use-slaves
171
+ endif
158
172
159
173
# ----------------------------------------------------------------------------------------------
160
174
0 commit comments