aboutsummaryrefslogtreecommitdiffstats
path: root/test/exec_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/exec_test.go')
-rw-r--r--test/exec_test.go25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/exec_test.go b/test/exec_test.go
index f2d48ce..ff67322 100644
--- a/test/exec_test.go
+++ b/test/exec_test.go
@@ -53,6 +53,15 @@ func flushChannelExec(channel chan xsapiv1.ExecOutMsg, ms time.Duration) {
}
func TestExec(t *testing.T) {
helloworldDir := InitExec(t)
+ chSdks := make(chan xsapiv1.SDK)
+ defer close(chSdks)
+ sdk := xsapiv1.SDKInstallArgs{
+ ID: "",
+ Filename: sdkFileName,
+ Force: false,
+ }
+ ConnectSDKStateChange(t, sCli, chSdks)
+ sdkRes := installFakeSdk(t, sdk, chSdks)
var cfgArray []xsapiv1.FolderConfig
assert.Nil(t, HTTPCli.Get("/folders", &cfgArray))
@@ -77,7 +86,12 @@ func TestExec(t *testing.T) {
chExec <- ev
})
- cmd := "cd " + fPrj.ClientPath
+ sdkSourceFile := path.Join(sdkRes.Path, "environment-setup-corei7-64-native-linux")
+ cmd := "source " + sdkSourceFile
+ cmd = cmd + " && "
+ cmd = cmd + "unset SDKTARGETSYSROOT"
+ cmd = cmd + " && "
+ cmd = cmd + "cd " + fPrj.ClientPath
cmd = cmd + " && "
cmd = cmd + "mkdir -p build"
cmd = cmd + " && "
@@ -93,7 +107,11 @@ func TestExec(t *testing.T) {
assert.Nil(t, HTTPCli.Post("/exec", exec, &execRes))
flushChannelExec(chExec, 1000)
- cmd = "cd " + fPrj.ClientPath
+ cmd = "source " + sdkSourceFile
+ cmd = cmd + " && "
+ cmd = cmd + "unset SDKTARGETSYSROOT"
+ cmd = cmd + " && "
+ cmd = cmd + "cd " + fPrj.ClientPath
cmd = cmd + "&&"
cmd = cmd + "cd build"
cmd = cmd + "&&"
@@ -107,4 +125,7 @@ func TestExec(t *testing.T) {
assert.Nil(t, err)
assert.Nil(t, HTTPCli.Delete("/folders/"+cfg.ID, &cfg))
+
+ RemoveSdk(t, sdkRes, chSdks)
+ DisconnectSDKStateChange(t, sCli)
}