tests: simplify names

main_test_tmp -> tmp
	main_benchmark.bash -> benchmark.bash
This commit is contained in:
Jakob Unterwurzacher 2015-10-04 20:46:21 +02:00
parent aa082c235a
commit d1522c7992
3 changed files with 9 additions and 11 deletions

10
.gitignore vendored
View File

@ -1,9 +1,5 @@
# Binary # binary
/gocryptfs /gocryptfs
# Manual test mounts # temporary files created by the tests
/cipherdir /tmp
/mountpoint
# main_test.go temporary files
/main_test_tmp

View File

@ -13,7 +13,7 @@ import (
"time" "time"
) )
const tmpDir = "main_test_tmp/" const tmpDir = "tmp/"
const plainDir = tmpDir + "plain/" const plainDir = tmpDir + "plain/"
const cipherDir = tmpDir + "cipher/" const cipherDir = tmpDir + "cipher/"
@ -37,7 +37,9 @@ func md5fn(filename string) string {
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
unmount() fu := exec.Command("fusermount", "-z", "-u", plainDir)
fu.Run()
os.RemoveAll(tmpDir) os.RemoveAll(tmpDir)
err := os.MkdirAll(plainDir, 0777) err := os.MkdirAll(plainDir, 0777)
@ -226,7 +228,7 @@ func BenchmarkStreamRead(t *testing.B) {
if t.N > mb { if t.N > mb {
// Grow file so we can satisfy the test // Grow file so we can satisfy the test
fmt.Printf("Growing file to %d MB... ", t.N) //fmt.Printf("Growing file to %d MB... ", t.N)
f2, err := os.OpenFile(fn, os.O_WRONLY|os.O_APPEND, 0666) f2, err := os.OpenFile(fn, os.O_WRONLY|os.O_APPEND, 0666)
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
@ -240,7 +242,7 @@ func BenchmarkStreamRead(t *testing.B) {
} }
} }
f2.Close() f2.Close()
fmt.Printf("done\n") //fmt.Printf("done\n")
} }
file, err := os.Open(plainDir + "BenchmarkWrite") file, err := os.Open(plainDir + "BenchmarkWrite")