Skip to content

Commit

Permalink
chore(buildtool): add ios-build unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bassosimone committed Oct 12, 2023
1 parent 63edcbe commit 9f4ce24
Show file tree
Hide file tree
Showing 3 changed files with 925 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func CheckSingleCommand(cmd *execabs.Cmd, tee ExecExpectations) error {
return err
}
if err := CompareEnv(tee.Env, shellxtesting.CmdEnvironMinusOsEnviron(cmd)); err != nil {
return err
return fmt.Errorf("in %v: %w", tee.Argv, err)
}
return nil
}
Expand Down Expand Up @@ -253,12 +253,12 @@ func (*DependenciesCallCounter) XCRun(args ...string) string {
case "-sdk":
runtimex.Assert(len(args) == 3, "expected three arguments")
runtimex.Assert(args[2] == "--show-sdk-path", "the third argument must be --show-sdk-path")
return filepath.Join("Developer", "SDKs", args[1])
return string(filepath.Separator) + filepath.Join("Developer", "SDKs", args[1])

case "-find":
runtimex.Assert(len(args) == 4, "expected four arguments")
runtimex.Assert(args[1] == "-sdk", "the second argument must be -sdk")
return filepath.Join("Developer", "SDKs", args[2], "bin", args[3])
return string(filepath.Separator) + filepath.Join("", "Developer", "SDKs", args[2], "bin", args[3])

default:
panic(errors.New("the first argument must be -sdk or -find"))
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/buildtool/ios.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ func iosNewCBuildEnv(deps buildtoolmodel.Dependencies, ooniArch string) *cBuildE
CFLAGS: []string{
"-isysroot", isysroot,
minVersionFlag + iosMinVersion, // tricky: they must be concatenated
"-O2",
"-arch", appleArch,
"-fembed-bitcode",
"-O2",
},
CONFIGURE_HOST: "", // later
DESTDIR: destdir,
Expand Down
Loading

0 comments on commit 9f4ce24

Please sign in to comment.