mirror of
https://github.com/bluenviron/mediamtx
synced 2025-02-22 14:36:54 +00:00
* fix: improve unsafe path handling Paths containing spaces or dashes were being interpreted as separate options, since the path handling lacked double quotes. This fixes all unsafe instances of "PWD" and "HOME", along with all other unsafe paths in the scripts. * readme: explicitly mount the configuration as read-only This clearly shows users that the MediaMTX container will not modify the configuration file.
38 lines
803 B
Makefile
38 lines
803 B
Makefile
ifeq ($(shell getconf LONG_BIT),64)
|
|
RACE=-race
|
|
endif
|
|
|
|
test-internal:
|
|
go generate ./...
|
|
go test -v $(RACE) -coverprofile=coverage-internal.txt \
|
|
$$(go list ./internal/... | grep -v /core)
|
|
|
|
test-core:
|
|
go test -v $(RACE) -coverprofile=coverage-core.txt ./internal/core
|
|
|
|
test-nodocker: test-internal test-core
|
|
|
|
define DOCKERFILE_TEST
|
|
ARG ARCH
|
|
FROM $$ARCH/$(BASE_IMAGE)
|
|
RUN apk add --no-cache make gcc musl-dev
|
|
WORKDIR /s
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
endef
|
|
export DOCKERFILE_TEST
|
|
|
|
test:
|
|
echo "$$DOCKERFILE_TEST" | docker build -q . -f - -t temp --build-arg ARCH=amd64
|
|
docker run --rm \
|
|
-v "$(PWD):/s" \
|
|
temp \
|
|
make test-nodocker
|
|
|
|
test32:
|
|
echo "$$DOCKERFILE_TEST" | docker build -q . -f - -t temp --build-arg ARCH=i386
|
|
docker run --rm \
|
|
-v "$(PWD):/s" \
|
|
temp \
|
|
make test-nodocker
|