summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-06-02 23:02:20 -0700
committerRuss Cox <rsc@golang.org>2009-06-02 23:02:20 -0700
commit5d553b6422fc4e7b8fbfbf0a7fff802f9de90ac4 (patch)
tree4f77746245571e42852680d4db64cad603f6b1b2
parent00a5b91f31d174cffc1efad409aa9479643ad73d (diff)
downloadgolang-5d553b6422fc4e7b8fbfbf0a7fff802f9de90ac4.tar.gz
for consistency with syscall, rename files
from GOARCH_GOOS -> GOOS_GOARCH. update os_test and add test of Time. R=r DELTA=490 (247 added, 233 deleted, 10 changed) OCL=29730 CL=29805
-rw-r--r--src/lib/os/Makefile10
-rw-r--r--src/lib/os/dir_darwin_amd64.go (renamed from src/lib/os/dir_amd64_darwin.go)0
-rw-r--r--src/lib/os/dir_linux_amd64.go (renamed from src/lib/os/dir_amd64_linux.go)0
-rw-r--r--src/lib/os/os_test.go24
-rw-r--r--src/lib/os/stat_darwin_amd64.go (renamed from src/lib/os/stat_amd64_darwin.go)0
-rw-r--r--src/lib/os/stat_linux_amd64.go (renamed from src/lib/os/stat_amd64_linux.go)0
6 files changed, 24 insertions, 10 deletions
diff --git a/src/lib/os/Makefile b/src/lib/os/Makefile
index 5272e88ad..4a53a26f9 100644
--- a/src/lib/os/Makefile
+++ b/src/lib/os/Makefile
@@ -3,7 +3,7 @@
# license that can be found in the LICENSE file.
# DO NOT EDIT. Automatically generated by gobuild.
-# gobuild -m dir_${GOARCH}_${GOOS}.go env.go error.go file.go path.go stat_${GOARCH}_${GOOS}.go time.go types.go exec.go proc.go getwd.go >Makefile
+# gobuild -m dir_${GOOS}_${GOARCH}.go env.go error.go file.go path.go stat_${GOOS}_${GOARCH}.go time.go types.go exec.go proc.go getwd.go >Makefile
D=
@@ -45,7 +45,7 @@ O1=\
O2=\
proc.$O\
- stat_$(GOARCH)_$(GOOS).$O\
+ stat_$(GOOS)_$(GOARCH).$O\
time.$O\
O3=\
@@ -53,7 +53,7 @@ O3=\
file.$O\
O4=\
- dir_$(GOARCH)_$(GOOS).$O\
+ dir_$(GOOS)_$(GOARCH).$O\
exec.$O\
getwd.$O\
path.$O\
@@ -67,7 +67,7 @@ a1: $(O1)
rm -f $(O1)
a2: $(O2)
- $(AR) grc _obj$D/os.a proc.$O stat_$(GOARCH)_$(GOOS).$O time.$O
+ $(AR) grc _obj$D/os.a proc.$O stat_$(GOOS)_$(GOARCH).$O time.$O
rm -f $(O2)
a3: $(O3)
@@ -75,7 +75,7 @@ a3: $(O3)
rm -f $(O3)
a4: $(O4)
- $(AR) grc _obj$D/os.a dir_$(GOARCH)_$(GOOS).$O exec.$O getwd.$O path.$O
+ $(AR) grc _obj$D/os.a dir_$(GOOS)_$(GOARCH).$O exec.$O getwd.$O path.$O
rm -f $(O4)
diff --git a/src/lib/os/dir_amd64_darwin.go b/src/lib/os/dir_darwin_amd64.go
index 2803ecee2..2803ecee2 100644
--- a/src/lib/os/dir_amd64_darwin.go
+++ b/src/lib/os/dir_darwin_amd64.go
diff --git a/src/lib/os/dir_amd64_linux.go b/src/lib/os/dir_linux_amd64.go
index 05b3d4c65..05b3d4c65 100644
--- a/src/lib/os/dir_amd64_linux.go
+++ b/src/lib/os/dir_linux_amd64.go
diff --git a/src/lib/os/os_test.go b/src/lib/os/os_test.go
index e4d115d81..84469b68a 100644
--- a/src/lib/os/os_test.go
+++ b/src/lib/os/os_test.go
@@ -12,16 +12,16 @@ import (
)
var dot = []string{
- "dir_amd64_darwin.go",
- "dir_amd64_linux.go",
+ "dir_darwin_amd64.go",
+ "dir_linux_amd64.go",
"env.go",
"error.go",
"file.go",
"os_test.go",
"time.go",
"types.go",
- "stat_amd64_darwin.go",
- "stat_amd64_linux.go"
+ "stat_darwin_amd64.go",
+ "stat_linux_amd64.go"
}
var etc = []string{
@@ -468,7 +468,7 @@ func TestChdirAndGetwd(t *testing.T) {
if mode == 0 {
err = Chdir(d);
} else {
- fd1, err := os.Open(d, os.O_RDONLY, 0);
+ fd1, err := Open(d, O_RDONLY, 0);
if err != nil {
t.Errorf("Open %s: %s", d, err);
continue;
@@ -501,3 +501,17 @@ func TestChdirAndGetwd(t *testing.T) {
}
fd.Close();
}
+
+func TestTime(t *testing.T) {
+ // Just want to check that Time() is getting something.
+ // A common failure mode on Darwin is to get 0, 0,
+ // because it returns the time in registers instead of
+ // filling in the structure passed to the system call.
+ // TODO(rsc): Too bad the compiler doesn't know that
+ // 365.24*86400 is an integer.
+ sec, nsec, err := Time();
+ if sec < (2009-1970)*36524*864 {
+ t.Errorf("Time() = %d, %d, %s; not plausible", sec, nsec, err);
+ }
+}
+
diff --git a/src/lib/os/stat_amd64_darwin.go b/src/lib/os/stat_darwin_amd64.go
index 1771ca160..1771ca160 100644
--- a/src/lib/os/stat_amd64_darwin.go
+++ b/src/lib/os/stat_darwin_amd64.go
diff --git a/src/lib/os/stat_amd64_linux.go b/src/lib/os/stat_linux_amd64.go
index 9b3018178..9b3018178 100644
--- a/src/lib/os/stat_amd64_linux.go
+++ b/src/lib/os/stat_linux_amd64.go