@@ -280,15 +280,16 @@ func TestExportedSymbols(t *testing.T) {
280
280
t .Parallel ()
281
281
282
282
cmd := "testp0"
283
+ bin := cmdToRun (cmd )
283
284
284
285
createHeadersOnce (t )
285
286
286
287
runCC (t , "-I" , installdir , "-o" , cmd , "main0.c" , libgoname )
287
288
adbPush (t , cmd )
288
289
289
- defer os .Remove (cmd )
290
+ defer os .Remove (bin )
290
291
291
- out := runExe (t , append (gopathEnv , "LD_LIBRARY_PATH=." ), cmdToRun ( cmd ) )
292
+ out := runExe (t , append (gopathEnv , "LD_LIBRARY_PATH=." ), bin )
292
293
if strings .TrimSpace (out ) != "PASS" {
293
294
t .Error (out )
294
295
}
@@ -304,15 +305,16 @@ func TestExportedSymbolsWithDynamicLoad(t *testing.T) {
304
305
}
305
306
306
307
cmd := "testp1"
308
+ bin := cmdToRun (cmd )
307
309
308
310
createHeadersOnce (t )
309
311
310
312
runCC (t , "-o" , cmd , "main1.c" , "-ldl" )
311
313
adbPush (t , cmd )
312
314
313
- defer os .Remove (cmd )
315
+ defer os .Remove (bin )
314
316
315
- out := runExe (t , nil , cmdToRun ( cmd ) , "./" + libgoname )
317
+ out := runExe (t , nil , bin , "./" + libgoname )
316
318
if strings .TrimSpace (out ) != "PASS" {
317
319
t .Error (out )
318
320
}
@@ -328,6 +330,7 @@ func TestUnexportedSymbols(t *testing.T) {
328
330
}
329
331
330
332
cmd := "testp2"
333
+ bin := cmdToRun (cmd )
331
334
libname := "libgo2." + libSuffix
332
335
333
336
run (t ,
@@ -348,9 +351,9 @@ func TestUnexportedSymbols(t *testing.T) {
348
351
adbPush (t , cmd )
349
352
350
353
defer os .Remove (libname )
351
- defer os .Remove (cmd )
354
+ defer os .Remove (bin )
352
355
353
- out := runExe (t , append (gopathEnv , "LD_LIBRARY_PATH=." ), cmdToRun ( cmd ) )
356
+ out := runExe (t , append (gopathEnv , "LD_LIBRARY_PATH=." ), bin )
354
357
355
358
if strings .TrimSpace (out ) != "PASS" {
356
359
t .Error (out )
@@ -370,15 +373,16 @@ func TestMainExportedOnAndroid(t *testing.T) {
370
373
}
371
374
372
375
cmd := "testp3"
376
+ bin := cmdToRun (cmd )
373
377
374
378
createHeadersOnce (t )
375
379
376
380
runCC (t , "-o" , cmd , "main3.c" , "-ldl" )
377
381
adbPush (t , cmd )
378
382
379
- defer os .Remove (cmd )
383
+ defer os .Remove (bin )
380
384
381
- out := runExe (t , nil , cmdToRun ( cmd ) , "./" + libgoname )
385
+ out := runExe (t , nil , bin , "./" + libgoname )
382
386
if strings .TrimSpace (out ) != "PASS" {
383
387
t .Error (out )
384
388
}
@@ -397,11 +401,12 @@ func testSignalHandlers(t *testing.T, pkgname, cfile, cmd string) {
397
401
runCC (t , "-pthread" , "-o" , cmd , cfile , "-ldl" )
398
402
adbPush (t , cmd )
399
403
404
+ bin := cmdToRun (cmd )
405
+
400
406
defer os .Remove (libname )
401
- defer os .Remove (cmd )
407
+ defer os .Remove (bin )
402
408
defer os .Remove (pkgname + ".h" )
403
409
404
- bin := cmdToRun (cmd )
405
410
out := runExe (t , nil , bin , "./" + libname )
406
411
if strings .TrimSpace (out ) != "PASS" {
407
412
t .Error (run (t , nil , bin , libname , "verbose" ))
0 commit comments