Merge pull request #1754 from facebook/decTest
Tests for single-file decompressor
This commit is contained in:
commit
d944197e79
1
Makefile
1
Makefile
@ -100,6 +100,7 @@ contrib: lib
|
||||
$(MAKE) -C contrib/pzstd all
|
||||
$(MAKE) -C contrib/seekable_format/examples all
|
||||
$(MAKE) -C contrib/largeNbDicts all
|
||||
cd contrib/single_file_decoder/ ; ./build_test.sh
|
||||
|
||||
.PHONY: cleanTabs
|
||||
cleanTabs:
|
||||
|
@ -7,7 +7,10 @@ Create `zstddeclib.c` from the Zstd source using:
|
||||
cd zstd/contrib/declib
|
||||
./combine.sh -r ../../lib -r ../../lib/common -r ../../lib/decompress -o zstddeclib.c zstddeclib-in.c
|
||||
```
|
||||
Then add the resulting file to your project (see the [example files](examples)). `build.sh` will run the above script then compile and test the library.
|
||||
Then add the resulting file to your project (see the [example files](examples)).
|
||||
|
||||
`create_single_file_decoder.sh` will run the above script, creating file `zstddeclib.c`.
|
||||
`build_test.sh` will create the decoder, then compile and test the library.
|
||||
|
||||
Why
|
||||
---
|
@ -10,14 +10,13 @@ OUT_FILE="tempbin"
|
||||
OUT_WASM="temp.wasm"
|
||||
|
||||
# Amalgamate the sources
|
||||
echo "Amalgamating files... this may take a few minutes"
|
||||
./combine.sh -r "$ZSTD_SRC_ROOT" -r "$ZSTD_SRC_ROOT/common" -r "$ZSTD_SRC_ROOT/decompress" -o zstddeclib.c zstddeclib-in.c
|
||||
./create_single_file_decoder.sh
|
||||
# Did combining work?
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Combine script: FAILED"
|
||||
echo "Single file decoder creation script: FAILED"
|
||||
exit 1
|
||||
fi
|
||||
echo "Combine script: PASSED"
|
||||
echo "Single file decoder creation script: PASSED"
|
||||
|
||||
# Compile the generated output
|
||||
cc -Os -g0 -o $OUT_FILE examples/simple.c
|
15
contrib/single_file_decoder/create_single_file_decoder.sh
Executable file
15
contrib/single_file_decoder/create_single_file_decoder.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Where to find the sources
|
||||
ZSTD_SRC_ROOT="../../lib"
|
||||
|
||||
|
||||
# Amalgamate the sources
|
||||
echo "Amalgamating files... this can take a while"
|
||||
./combine.sh -r "$ZSTD_SRC_ROOT" -r "$ZSTD_SRC_ROOT/common" -r "$ZSTD_SRC_ROOT/decompress" -o zstddeclib.c zstddeclib-in.c
|
||||
# Did combining work?
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Combine script: FAILED"
|
||||
exit 1
|
||||
fi
|
||||
echo "Combine script: PASSED"
|
Loading…
x
Reference in New Issue
Block a user