-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cli-tests] Add tests that use --trace-file-stat
Basic tests for (de)compressing in the following modes: * file to file * file to stdout * stdin to file * stdin to stdout These are basic tests, and aren't testing more advanced scenarios, but it adds the groundwork for more complex tests as needed. Fixes #3010.
- Loading branch information
Showing
16 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen > file | ||
|
||
zstd file -q --trace-file-stat -o file.zst | ||
zstd -tq file.zst |
36 changes: 36 additions & 0 deletions
36
tests/cli-tests/file-stat/compress-file-to-file.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Trace:FileStat: > UTIL_isLink(file) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(2) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_getFileSize(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 65537 | ||
Trace:FileStat: > UTIL_isDirectory(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_isSameFile(file, file.zst) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file.zst) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file.zst) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_getFileSize(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 65537 | ||
Trace:FileStat: > UTIL_utime(file.zst) | ||
Trace:FileStat: < 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen > file | ||
|
||
zstd file -cq --trace-file-stat > file.zst | ||
zstd -tq file.zst |
22 changes: 22 additions & 0 deletions
22
tests/cli-tests/file-stat/compress-file-to-stdout.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Trace:FileStat: > UTIL_isLink(file) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(1) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_getFileSize(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 65537 | ||
Trace:FileStat: > UTIL_isDirectory(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_isRegularFile(/*stdout*\) | ||
Trace:FileStat: > UTIL_stat(/*stdout*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_getFileSize(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 65537 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen > file | ||
|
||
zstd < file -q --trace-file-stat -o file.zst | ||
zstd -tq file.zst |
28 changes: 28 additions & 0 deletions
28
tests/cli-tests/file-stat/compress-stdin-to-file.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Trace:FileStat: > UTIL_isConsole(0) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(2) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_getFileSize(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < -1 | ||
Trace:FileStat: > UTIL_isDirectory(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isSameFile(/*stdin*\, file.zst) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file.zst) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file.zst) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_getFileSize(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen > file | ||
|
||
zstd < file -cq --trace-file-stat > file.zst | ||
zstd -tq file.zst |
20 changes: 20 additions & 0 deletions
20
tests/cli-tests/file-stat/compress-stdin-to-stdout.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Trace:FileStat: > UTIL_isConsole(0) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(1) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_getFileSize(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < -1 | ||
Trace:FileStat: > UTIL_isDirectory(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(/*stdout*\) | ||
Trace:FileStat: > UTIL_stat(/*stdout*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_getFileSize(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen | zstd -q > file.zst | ||
|
||
zstd -dq --trace-file-stat file.zst |
30 changes: 30 additions & 0 deletions
30
tests/cli-tests/file-stat/decompress-file-to-file.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Trace:FileStat: > UTIL_isLink(file.zst) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(1) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(2) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isDirectory(file.zst) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_isSameFile(file.zst, file) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_utime(file) | ||
Trace:FileStat: < 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen | zstd -q > file.zst | ||
|
||
zstd -dcq --trace-file-stat file.zst > file |
14 changes: 14 additions & 0 deletions
14
tests/cli-tests/file-stat/decompress-file-to-stdout.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Trace:FileStat: > UTIL_isLink(file.zst) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(1) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isDirectory(file.zst) | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_stat(file.zst) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: > UTIL_isRegularFile(/*stdout*\) | ||
Trace:FileStat: > UTIL_stat(/*stdout*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen | zstd -q > file.zst | ||
|
||
zstd -dcq --trace-file-stat < file.zst -o file |
20 changes: 20 additions & 0 deletions
20
tests/cli-tests/file-stat/decompress-stdin-to-file.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Trace:FileStat: > UTIL_isConsole(0) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(2) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isDirectory(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isSameFile(/*stdin*\, file) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(file) | ||
Trace:FileStat: > UTIL_stat(file) | ||
Trace:FileStat: < 1 | ||
Trace:FileStat: < 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
datagen | zstd -q > file.zst | ||
|
||
zstd -dcq --trace-file-stat < file.zst > file |
12 changes: 12 additions & 0 deletions
12
tests/cli-tests/file-stat/decompress-stdin-to-stdout.sh.stderr.exact
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Trace:FileStat: > UTIL_isConsole(0) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isConsole(1) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isDirectory(/*stdin*\) | ||
Trace:FileStat: > UTIL_stat(/*stdin*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: > UTIL_isRegularFile(/*stdout*\) | ||
Trace:FileStat: > UTIL_stat(/*stdout*\) | ||
Trace:FileStat: < 0 | ||
Trace:FileStat: < 0 |