aboutsummaryrefslogtreecommitdiff
path: root/all_test.go
diff options
context:
space:
mode:
authorJan Mercl <0xjnml@gmail.com>2017-07-03 17:29:33 +0200
committerJan Mercl <0xjnml@gmail.com>2017-07-03 17:29:33 +0200
commit481e652f27a8ccebf301ff73a65fa7f38bd204d5 (patch)
tree0706d572715234c38123ae7140dd2ca6cb3c6201 /all_test.go
parent51c2f03f63483b0e3312cce063e6798f6b90f38f (diff)
Regenerate Linux using latest CCGO.
modified: Makefile modified: all_test.go modified: internal/bin/bin_linux_386.go modified: internal/bin/bin_linux_amd64.go modified: internal/mptest/mptest_linux_386.go modified: internal/mptest/mptest_linux_amd64.go modified: internal/threadtest4/threadtest4_linux_386.go modified: internal/threadtest4/threadtest4_linux_amd64.go
Diffstat (limited to 'all_test.go')
-rw-r--r--all_test.go21
1 files changed, 16 insertions, 5 deletions
diff --git a/all_test.go b/all_test.go
index c814ed1..39925b5 100644
--- a/all_test.go
+++ b/all_test.go
@@ -60,6 +60,7 @@ func init() {
// ============================================================================
var (
+ memTrace = flag.Bool("memory.trace", false, "")
recsPerSec = flag.Bool("recs_per_sec_as_mbps", false, "Show records per second as MB/s.")
)
@@ -392,10 +393,10 @@ func TestMP(t *testing.T) {
t.Fatalf("%s: no files", pat)
}
- cmd := filepath.FromSlash("./mptest")
+ nm := filepath.FromSlash("./mptest")
for _, v := range m {
os.Remove("db")
- out, err := exec.Command(cmd, "db", v).CombinedOutput()
+ out, err := exec.Command(nm, "db", v).CombinedOutput()
t.Logf("%s", out)
if err != nil {
t.Fatal(err)
@@ -437,7 +438,7 @@ func TestThread1(t *testing.T) {
for j := 0; j <= 20; j++ {
out, err := exec.Command("./threadtest1", strconv.Itoa(j), "-v").CombinedOutput()
- t.Logf("%v, %v: %s", i, j, out)
+ t.Logf("%v, %v:\n%s", i, j, out)
if err != nil {
t.Fatal(err)
}
@@ -510,7 +511,11 @@ func TestThread4(t *testing.T) {
t.Fatal(err)
}
- if out, err := exec.Command("go", "build", "-o", "threadtest4", "github.com/cznic/sqlite/internal/threadtest4").CombinedOutput(); err != nil {
+ s := []string{"build", "-o", "threadtest4"}
+ if *memTrace {
+ s = append(s, "-tags", "memory.trace", "-race")
+ }
+ if out, err := exec.Command("go", append(s, "github.com/cznic/sqlite/internal/threadtest4")...).CombinedOutput(); err != nil {
t.Fatalf("go build mptest: %s\n%s", err, out)
}
@@ -526,10 +531,16 @@ func TestThread4(t *testing.T) {
} {
for i := 2; i <= 10; i++ {
out, err := exec.Command("./threadtest4", append(opts, strconv.Itoa(i))...).CombinedOutput()
- t.Logf("%v: %v %s", i, opts, out)
+ t.Logf("%v: %v\n%s", i, opts, out)
if err != nil {
t.Fatal(err)
}
+
+ if bytes.Contains(out, []byte("fault address")) ||
+ bytes.Contains(out, []byte("data race")) ||
+ bytes.Contains(out, []byte("RACE")) {
+ t.Fatal("fault")
+ }
}
}
}