Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17090

Unable to reach plist files in "command line" target

$
0
0

@metorres89 wrote:

Hi everyone! I'm working on a iOS mobile game using cocos2d-x 3.10 and cocos studio on Mac.

I'm using Catch as a unit test framework. In order to use Catch I've added a new target to the original XCode project. In this target I've created my "testXXX.cpp" files which contains the code of the unit tests that I want to run.

I'm having some troubles in one of my unit tests. I'm trying to test a method. Inside this method I'm using cocos2d FileUtils to reach two .plist files that configure some behaviour in the game. Here is the code that I'm using:

std::string fullPathLevels = cocos2d::FileUtils::getInstance()->fullPathForFilename(OIR_CONFIG_LEVELS);
std::string fullPathRhythmTable = cocos2d::FileUtils::getInstance()->fullPathForFilename(OIR_CONFIG_RHYTHMS);

this->Levels = cocos2d::FileUtils::getInstance()->getValueMapFromFile(fullPathLevels);
this->rhythmTable = cocos2d::FileUtils::getInstance()->getValueMapFromFile(fullPathRhythmTable);

It works fine when I build the code aiming mobile or desktop target BUT when I change to the "command line" target that I've created to test using Catch then the plist files can't be found.

I've already added the plist files to the target membership and they appear on the "Copy Bundle Resources" section in Build Phases...

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>