Skip to content

Commit 4bed675

Browse files
committed
Support running make test with PROG_SUFFIX
Signed-off-by: Zhijun <dszhijun@gmail.com>
1 parent 3fd0942 commit 4bed675

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ distclean: clean
590590
.PHONY: distclean
591591

592592
test: $(SERVER_NAME) $(ENGINE_CHECK_AOF_NAME) $(ENGINE_CHECK_RDB_NAME) $(ENGINE_CLI_NAME) $(ENGINE_BENCHMARK_NAME)
593-
@(cd ..; ./runtest)
593+
@(cd ..; VALKEY_PROG_SUFFIX="$(PROG_SUFFIX)" ./runtest)
594594

595595
test-unit: $(ENGINE_UNIT_TESTS)
596596
./$(ENGINE_UNIT_TESTS)

tests/support/set_executable_path.tcl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ if {[info exists ::env(VALKEY_BIN_DIR)]} {
88
set ::VALKEY_BIN_DIR "[pwd]/src"
99
}
1010

11+
# Optional program suffix (e.g. `make PROG_SUFFIX=-alt` will create binary valkey-server-alt).
12+
# Passed from `make test` as environment variable VALKEY_PROG_SUFFIX.
13+
set ::VALKEY_PROG_SUFFIX [expr {
14+
[info exists ::env(VALKEY_PROG_SUFFIX)] ? $::env(VALKEY_PROG_SUFFIX) : ""
15+
}]
16+
1117
# Helper to build absolute paths
1218
proc valkey_bin_absolute_path {name} {
13-
set p [file join $::VALKEY_BIN_DIR $name]
14-
return $p
19+
set full_name "${name}${::VALKEY_PROG_SUFFIX}"
20+
return [file join $::VALKEY_BIN_DIR $full_name]
1521
}
1622

1723
set ::VALKEY_SERVER_BIN [valkey_bin_absolute_path "valkey-server"]

0 commit comments

Comments
 (0)