xcodebuild error DVTAssertions: ASSERTION FAILURE while executing single command line test, but the all test case command works fine - xctest

I can execute my project using XCUItest with following command:
xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone
8,OS=11.4'
This command works fine, and all my test cases run.
I want to execute a single .swift file. so I used the following command:
xcodebuild test -workspace Maple.xcworkspace -scheme Maple -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.4' -only-testing:/Users/amit.jathar/Maple/MapleUITests/DashboardTests.swift
The above command throws following error:
User defaults from command line:
IDETestRunOnlyIdentifiers = (
"Maple/MapleUITests/DashboardTests"
)
--- xcodebuild: WARNING: Unable to open project file '/Users/amit.jathar/sdm-maple-ios/MaplePlayground.playground' in workspace 'Maple.xcworkspace'.
2018-07-12 17:44:55.000 xcodebuild[13879:5394085] [MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-14161/IDEFoundation/Execution/Schemes/IDETestSchemeAction.m:272
Details: (anyTestRunSpecification) should not be nil.
Object:
Method: -testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock:
Thread: {number = 1, name = main}
Hints:
Backtrace:
0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
1 _DVTAssertionHandler (in DVTFoundation)
2 _DVTAssertionFailureHandler (in DVTFoundation)
3 -[IDETestSchemeAction testOperationWithSchemeOperationParameters:testManager:withBuildOperation:buildParameters:schemeCommand:actionRecord:testRunSpecifications:deviceAvailableChecker:outError:actionCallbackBlock:] (in IDEFoundation)
4 -[IDEScheme _executionOperationForSchemeOperationParameters:build:onlyBuild:buildParameters:title:buildLog:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:actionCallbackBlock:] (in IDEFoundation)
5 -[IDEScheme schemeOperationForSchemeOperationParameters:buildLog:overridingProperties:overridingBuildConfiguration:dontActuallyRunCommands:restorePersistedBuildResults:deviceAvailableChecker:error:completionBlock:] (in IDEFoundation)
6 -[IDEScheme schemeOperationForSchemeOperationParameters:buildLog:overridingProperties:overridingBuildConfiguration:dontActuallyRunCommands:restorePersistedBuildResults:error:completionBlock:] (in IDEFoundation)
7 -[Xcode3CommandLineBuildTool _buildWithTimingSection:] (in Xcode3Core)
8 -[Xcode3CommandLineBuildTool run] (in Xcode3Core)
9 main (in xcodebuild)
10 start (in libdyld.dylib)
Abort trap: 6

Related

xcodebuild test on Xcode 14: Could not find test host for DoSomethingElseTests: TEST_HOST evaluates

I'm running the following command to build and test my project:
xcodebuild -sdk iphonesimulator -configuration DoSomethingElse -project DoSomethingElse.xcodeproj -scheme DoSomethingElse -destination "platform=iOS Simulator,name=iPhone 8 Plus" test
But I'm getting this error:
Reason: Could not find test host for DoSomethingElseTests: TEST_HOST evaluates
But I run the unit test using XCode IDE works just fine.
Any of you knows what I'm doing wrong?, or if there is a way around this?
I'll really appreciate your help

Objective-C Travis failed for 'Test runner exited before starting test execution'

Here is my code in .travis.yml file,after run build is passing, but I found the TEST are failed. I have no idea about this and block me a few days, appreciate your help. THX
--- Error as below ---
2018-12-20 05:57:42.698 xcodebuild[2394:8186] [MT]
IDETestOperationsObserverDebug: (CB8F382A-5B77-4BDA-BC4F-6EDF7B7DB822)
Beginning test session aaaaTests-CB8F382A-5B77-4BDA-BC4F-6EDF7B7DB822 at 2018-
12-20 05:57:42.698 with Xcode 10A255 on target <DVTiPhoneSimulator:
0x7f86387e49d0> {
SimDevice: iPhone 6 (B25EC6DB-0B2F-4920-B6C2-8560331BA779, iOS 9.1, Booted)
} (9.1 (13B143))
2018-12-20 05:57:53.744 xcodebuild[2394:8186] [MT]
IDETestOperationsObserverDebug: 11.068 elapsed -- Testing started completed.
2018-12-20 05:57:53.744 xcodebuild[2394:8186] [MT]
IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2018-12-20 05:57:53.744 xcodebuild[2394:8186] [MT]
IDETestOperationsObserverDebug: 11.068 sec, +11.068 sec -- end
2018-12-20 05:57:53.746 xcodebuild[2394:8186] Error
Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit,
operation never finished bootstrapping - no restart will be attempted"
UserInfo={NSLocalizedDescription=Early unexpected exit, operation never
finished bootstrapping - no restart will be attempted,
NSUnderlyingError=0x7f86389df930 {Error
Domain=IDETestOperationsObserverErrorDomain Code=5 "Test runner exited before
starting test execution." UserInfo={NSLocalizedDescription=Test runner exited
before starting test execution., NSLocalizedRecoverySuggestion=If you believe
this error represents a bug, please attach the result bundle at
/Users/travis/Library/Developer/Xcode/DerivedData/aaaa-
bdscsxnorhzvygafnsqdiqoriugx/Logs/Test/Run-aaaa-2018.12.20_05-57-22-
+0000.xcresult}}}
Testing failed:
aaaa.app (2488) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. Underlying error: Test runner exited before starting test execution.)
** TEST FAILED **
The command "set -o pipefail && xcodebuild -workspace aaaa.xcworkspace -scheme aaaa -destination platform\=iOS\ Simulator,OS\=9.1,name\=iPhone\ 6 build test | xcpretty" exited with 65.
Done. Your build exited with 1.
---My code as below---
language: objective-c
osx_image: xcode10
xcode_workspace: aaaa.xcworkspace
xcode_scheme: aaaa
xcode_destination: platform=iOS Simulator,OS=9.1,name=iPhone 6
before_install:
- pod repo update
- npm install ios-sim -g
- ios-sim start --devicetypeid "com.apple.CoreSimulator.SimDeviceType.iPhone-6, 9.1"
The issue can fix by below step:
change the version of osx_image in .travis.yml file and retry
// if xcode10.1 build failed, you can change to other version, like xcode9.4
osx_image: xcode10.1
Travis support xcode version list:
https://docs.travis-ci.com/user/languages/objective-c/

xcodebuild builds test target but cannot run xctest

I run a command in terminal
sudo /usr/bin/xcodebuild -project awesome.xcodeproj -scheme "AwesomeTests"
-configuration Production test -derivedDataPath ~/Documents/buildData
-sdk "OS X 10.9"
last lines of output looks like
error: failed to launch '/Applications/Xcode.app/Contents/Developer/usr/bin/xctest'
-- error: Host::LaunchProcess (launch_info) => pid=0,
path='/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/Resources/debugserver'
err = Problems with launching via XPC. XPC error : Connection interrupted (0x00000005)
** TEST SUCCEEDED **
Before outputing these lines I'm prompted with: "xcodebuild is trying to take control of a root process. Type your password to allow this"
I'm using Xcode 5.0.2.
As #trojanfoe noted, the sudo was the cause of the error.
It seems like ~/Documents/buildData folder was created with root permissions and couldn't be accessed from xtest.

VxWorks 6.8 Image Project Not Compiling

I am using Wind River Workbench 3.3 and VxWorks 6.8. When using building from the command line everything works, but when I attempt to build within Workbench I get errors. In attempting to track it down, I have determined that the same problem occurs when creating a new VxWorks Image Project using our board support package and the gnu tool chain.
I created a new project and attempt to build it in the default_romCompress build spec. I get the following errors.
romInit.o: In function `delay_100us':
C:/WindRiver/vxworks-6.8/target/config/mrim/romInit.s:649: undefined reference to `romStart'
C:/WindRiver/vxworks-6.8/target/config/mrim/romInit.s:650: undefined reference to `romStart'
make.exe[1]: *** [vxWorks_romCompress] Error 1
rm ipcom_ipdomain
make.exe[1]: Leaving directory `D:/WindRiverWorkbench/Test/default_romCompress'
C:\WindRiver\utilities-1.0\x86-win32\bin\make.exe: *** [target_vxWorks] Error 2
Build Failed in Project 'Test' (Process Exit Value was 2): 2014-01-14 17:22:11 (Elapsed Time: 00:06)
the symbol romStart is defined in romStart.c, which is part of the project. When I attempt to compile just romStart.c I get the following output.
Build Started in Project 'Test': 2014-01-15 08:57:25
Generation of makefiles started.
Generation of makefiles finished (Elapsed Time: 00:00).
Platform: Wind River VxWorks 6.8
Command: make BUILD_SPEC=default_romCompress DEBUG_MODE=0 TRACE=1 default_romCompress/romStart.o
Working Directory: D:/WindRiverWorkbench/Test
make.exe[1]: Entering directory `D:/WindRiverWorkbench/Test'
make.exe[2]: Entering directory `D:/WindRiverWorkbench/Test/default_romCompress'
ccppc -c -DCPU_VARIANT=_ppc860 -g -msoft-float -mstrict-align -ansi -fno-builtin -Wall -D_VSB_CONFIG_FILE=\"C:/WindRiver/vxworks-6.8/target/lib/h/config/vsbConfig.h\" -mcpu=860 -I.. -IC:/WindRiver/vxworks-6.8/target/config/mrim -IC:/WindRiver/vxworks-6.8/target/h -IC:/WindRiver/vxworks-6.8/target/config/comps/src -IC:/WindRiver/vxworks-6.8/target/h/wrn/coreip -IC:/WindRiver/vxworks-6.8/target/src/drv -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=sfgnu -DPRJ_BUILD -D_WRS_KERNEL -IC:/WindRiver/components/windml-5.3/h -IC:/WindRiver/components/webservices-1.7/h -IC:/WindRiver/components/webcli-4.8/target/h -IC:/WindRiver/components/opc-3.2/h -IC:/WindRiver/components/dcom-2.3/h -IC:/WindRiver/components/windml-5.3/osconfig/vxworks/src -IC:/WindRiver/components/ip_net2-6.8/osconfig/vxworks/src -IC:/WindRiver/components/windml-5.3/osconfig/vxworks/h -IC:/WindRiver/components/ip_net2-6.8/osconfig/vxworks/h -IC:/WindRiver/vxworks-6.8/target/src/hwif -IC:/WindRiver/vxworks-6.8/target/src/hwif/h #./ipcom_ipdomain -DIP_PORT_VXWORKS=68 -DINET -UCPU -DCPU=PPC860 -I. -MD -fvolatile -G8 -msdata=eabi -DROM_COMPRESS -DRAM_DATA_ADRS=0x00e00000 -DRAM_DST_ADRS=0x00010000 C:/WindRiver/vxworks-6.8/target/config/comps/src/romStart.c -o romStart.o
ccppc: #./ipcom_ipdomain: No such file or directory
make.exe[2]: *** [romStart.o] Error 1
make.exe[2]: Leaving directory `D:/WindRiverWorkbench/Test/default_romCompress'
make.exe[1]: *** [compile_romStart.o] Error 2
make.exe[1]: Leaving directory `D:/WindRiverWorkbench/Test'
C:\WindRiver\utilities-1.0\x86-win32\bin\make.exe: *** [default_romCompress/romStart.o] Error 2
Build Failed in Project 'Test' (Process Exit Value was 2): 2014-01-15 08:57:26 (Elapsed Time: 00:01)
However, if I attempt to compile romStart.c a second time, then it succeeds
If I again try to build the project (not clean and not rebuild), then it fails again with the following output.
Build Started in Project 'Test': 2014-01-15 08:58:36
Generation of makefiles started.
Generation of makefiles finished (Elapsed Time: 00:00).
Platform: Wind River VxWorks 6.8
Command: make BUILD_SPEC=default_romCompress DEBUG_MODE=0 TRACE=1
Working Directory: D:/WindRiverWorkbench/Test
building default vxWorks image of D:/WindRiverWorkbench/Test
make.exe[1]: Entering directory `D:/WindRiverWorkbench/Test/default_romCompress'
cp vxWorks vxWorks.o
true vxWorks.o
objcopyppc -O binary --binary-without-bss vxWorks.o tmp.bin
VX_CPU_FAMILY=ppc C:/WindRiver/vxworks-6.8/host/x86-win32/bin/deflate < tmp.bin > tmp.Z
Deflation: 53.98%
VX_CPU_FAMILY=ppc C:/WindRiver/vxworks-6.8/host/x86-win32/bin/binToAsm tmp.Z > vxWorks.Z.s
ccppc -c -DCPU_VARIANT=_ppc860 -g -msoft-float -mstrict-align -ansi -fno-builtin -xassembler-with-cpp -D_VSB_CONFIG_FILE=\"C:/WindRiver/vxworks-6.8/target/lib/h/config/vsbConfig.h\" -mcpu=860 -I.. -IC:/WindRiver/vxworks-6.8/target/config/mrim -IC:/WindRiver/vxworks-6.8/target/h -IC:/WindRiver/vxworks-6.8/target/config/comps/src -IC:/WindRiver/vxworks-6.8/target/h/wrn/coreip -IC:/WindRiver/vxworks-6.8/target/src/drv -DCPU=PPC32 -DTOOL_FAMILY=gnu -DTOOL=sfgnu -DPRJ_BUILD -D_WRS_KERNEL -IC:/WindRiver/components/windml-5.3/h -IC:/WindRiver/components/webservices-1.7/h -IC:/WindRiver/components/webcli-4.8/target/h -IC:/WindRiver/components/opc-3.2/h -IC:/WindRiver/components/dcom-2.3/h -IC:/WindRiver/components/windml-5.3/osconfig/vxworks/src -IC:/WindRiver/components/ip_net2-6.8/osconfig/vxworks/src -IC:/WindRiver/components/windml-5.3/osconfig/vxworks/h -IC:/WindRiver/components/ip_net2-6.8/osconfig/vxworks/h -IC:/WindRiver/vxworks-6.8/target/src/hwif -IC:/WindRiver/vxworks-6.8/target/src/hwif/h #./ipcom_ipdomain -DIP_PORT_VXWORKS=68 -DINET -UCPU -DCPU=PPC860 -I. -MD vxWorks.Z.s -o vxWorks.Z.o
ccppc: #./ipcom_ipdomain: No such file or directory
make.exe[1]: *** [vxWorks_romCompress] Error 1
make.exe[1]: Leaving directory `D:/WindRiverWorkbench/Test/default_romCompress'
C:\WindRiver\utilities-1.0\x86-win32\bin\make.exe: *** [target_vxWorks] Error 2
Build Failed in Project 'Test' (Process Exit Value was 2): 2014-01-15 08:58:37 (Elapsed Time: 00:01)
Can anyone suggest how I might go about fixing these problems?

How can I fix "Symbol not found: _NSURLSessionTransferSizeUnknown" when running tests using Travis that work locally?

The command xctool -workspace Foo.xcworkspace -scheme Foo -sdk macosx -configuration Debug test -test-sdk macosx works locally and all of the tests pass.
Using Travis I get the following error:
Failed to query the list of test cases in the test bundle: dlopen(/Users/travis/Library/Developer/Xcode/DerivedData/Foo-bvxkmfrwzzvtxgaeoosknyzjovjc/Build/Products/Debug/OS X Tests.xctest/Contents/MacOS/OS X Tests, 2): Symbol not found: _NSURLSessionTransferSizeUnknown
Referenced from: /Users/travis/Library/Developer/Xcode/DerivedData/Foo-bvxkmfrwzzvtxgaeoosknyzjovjc/Build/Products/Debug/OS X Tests.xctest/Contents/MacOS/OS X Tests
Expected in: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
in /Users/travis/Library/Developer/Xcode/DerivedData/Foo-bvxkmfrwzzvtxgaeoosknyzjovjc/Build/Products/Debug/OS X Tests.xctest/Contents/MacOS/OS X Tests
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
** TEST FAILED: 0 passed, 0 failed, 0 errored, 0 total ** (21121 ms)
The command "xctool -workspace Foo.xcworkspace -scheme Foo -sdk macosx -configuration Debug test -test-sdk macosx" exited with 1.
My .travis.yml file is as follows:
language: objective-c
before_install:
- gem install cocoapods --no-ri --no-rdoc --no-document --quiet
- brew update
- brew uninstall xctool
- brew install xctool
script:
- xctool -workspace Foo.xcworkspace -scheme Foo -sdk macosx -configuration Debug test -test-sdk macosx
Why does this happen and how can I fix this?
Travis does not currently support Mavericks which is the root cause of the problem.
Support for 10.9 is being tracked in this issue on GitHub.