-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve unit-test coverage for cmd and fileserver
Signed-off-by: Heathcliff <[email protected]>
- Loading branch information
1 parent
04f675a
commit 7fe7dc2
Showing
3 changed files
with
65 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,19 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
) | ||
|
||
func TestMain(t *testing.T) { | ||
if os.Getenv("RUN_CRASH_TEST") == "1" { | ||
t.Setenv("SFILESERVER_WEBROOT", "../pkg/filesystem/testdata") | ||
t.Setenv("SFILESERVER_CERT", "ssl.crt") | ||
t.Setenv("SFILESERVER_KEY", "ssl.key") | ||
t.Setenv("SFILESERVER_LOG", "true") | ||
main() | ||
// Should not reach here, ensure exit with 0 if it does | ||
os.Exit(0) | ||
} | ||
execExitTest(t, "TestMain", true) | ||
} |
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
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