]> Cypherpunks repositories - gostls13.git/commitdiff
misc/ios: fix the Test386EndToEnd test on iOS
authorElias Naur <elias.naur@gmail.com>
Mon, 17 Apr 2017 19:09:56 +0000 (21:09 +0200)
committerElias Naur <elias.naur@gmail.com>
Mon, 17 Apr 2017 19:55:54 +0000 (19:55 +0000)
Some tests need the src/runtime/textflag.h file. Make sure it is
included in iOS test runs.

Change-Id: I5e0e7ebe85679686ef15a7d336f28ac9b68a587a
Reviewed-on: https://go-review.googlesource.com/40915
Run-TryBot: Elias Naur <elias.naur@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

misc/ios/go_darwin_arm_exec.go

index 46e3fcbc43caad877fe656932d6fc64ab00cba43..aac5e9d760bc4f36e8d9f1f74dbe2ce9d6cea738 100644 (file)
@@ -517,13 +517,13 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
                }
        }
 
-       // Copy timezone file.
-       //
-       // Typical apps have the zoneinfo.zip in the root of their app bundle,
-       // read by the time package as the working directory at initialization.
-       // As we move the working directory to the GOROOT pkg directory, we
-       // install the zoneinfo.zip file in the pkgpath.
        if underGoRoot {
+               // Copy timezone file.
+               //
+               // Typical apps have the zoneinfo.zip in the root of their app bundle,
+               // read by the time package as the working directory at initialization.
+               // As we move the working directory to the GOROOT pkg directory, we
+               // install the zoneinfo.zip file in the pkgpath.
                err := cp(
                        filepath.Join(dstbase, pkgpath),
                        filepath.Join(cwd, "lib", "time", "zoneinfo.zip"),
@@ -531,6 +531,19 @@ func copyLocalData(dstbase string) (pkgpath string, err error) {
                if err != nil {
                        return "", err
                }
+               // Copy src/runtime/textflag.h for (at least) Test386EndToEnd in
+               // cmd/asm/internal/asm.
+               runtimePath := filepath.Join(dstbase, "src", "runtime")
+               if err := os.MkdirAll(runtimePath, 0755); err != nil {
+                       return "", err
+               }
+               err = cp(
+                       filepath.Join(runtimePath, "textflag.h"),
+                       filepath.Join(cwd, "src", "runtime", "textflag.h"),
+               )
+               if err != nil {
+                       return "", err
+               }
        }
 
        return finalPkgpath, nil