1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

seekable_format: Add test for parallel_compression memory usage

Use ulimit to fail the test if we use O(filesize) memory, rather than
O(threads).
This commit is contained in:
Dave Vasilevsky
2025-05-07 01:43:36 -04:00
committed by Yann Collet
parent 01c973de8d
commit 13cb7a10ae
2 changed files with 23 additions and 2 deletions

View File

@ -1 +1,2 @@
seekable_tests seekable_tests
data.txt

View File

@ -24,7 +24,7 @@ SEEKABLE_OBJS = ../zstdseek_compress.c ../zstdseek_decompress.c $(ZSTDLIB)
.PHONY: default clean test .PHONY: default clean test
default: test default: test
test: seekable_tests test: seekable_tests parallel_compression_test
./seekable_tests ./seekable_tests
$(ZSTDLIB): $(ZSTDLIB):
@ -32,7 +32,27 @@ $(ZSTDLIB):
seekable_tests : $(SEEKABLE_OBJS) seekable_tests : $(SEEKABLE_OBJS)
EXAMPLES_PATH = ../examples
PARALLEL_COMPRESSION = $(EXAMPLES_PATH)/parallel_compression
DATAGEN_PATH = ../../../tests
DATAGEN = $(DATAGEN_PATH)/datagen
$(PARALLEL_COMPRESSION):
$(MAKE) -C $(EXAMPLES_PATH) parallel_compression
$(DATAGEN):
$(MAKE) -C $(DATAGEN_PATH) datagen
data.txt: $(DATAGEN)
$(DATAGEN) -g100M > $@
parallel_compression_test: $(PARALLEL_COMPRESSION) data.txt
ulimit -Sv 102400; $(PARALLEL_COMPRESSION) data.txt 1048576 2
.PHONY: parallel_compression_test parallel_comp
clean: clean:
@$(RM) core *.o tmp* result* *.zst \ @$(RM) core *.o tmp* result* *.zst \
seekable_tests seekable_tests data.txt
@echo Cleaning completed @echo Cleaning completed