ICU-1627 Make the new directory structure work better with the tests.
X-SVN-Rev: 7702
This commit is contained in:
parent
4d2ae0ff58
commit
83656c2517
@ -238,7 +238,7 @@ void ctest_setICU_DATA() {
|
||||
/* We found and truncated three names from the path.
|
||||
* Now append "source\data" and set the environment
|
||||
*/
|
||||
strcpy(pBackSlash, U_FILE_SEP_STRING "data" U_FILE_SEP_STRING);
|
||||
strcpy(pBackSlash, U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING);
|
||||
u_setDataDirectory(p); /* p is "ICU_DATA=wherever\icu\source\data" */
|
||||
return;
|
||||
}
|
||||
|
@ -622,17 +622,20 @@ static void TestUnicodeData()
|
||||
|
||||
/* Look inside ICU_DATA first */
|
||||
strcpy(newPath, u_getDataDirectory());
|
||||
strcat(newPath, "unidata" U_FILE_SEP_STRING "UnicodeData.txt");
|
||||
strcat(newPath, ".." U_FILE_SEP_STRING "unidata" U_FILE_SEP_STRING "UnicodeData.txt");
|
||||
|
||||
/* As a fallback, try to guess where the source data was located
|
||||
* at the time ICU was built, and look there.
|
||||
*/
|
||||
#if defined (U_TOPSRCDIR)
|
||||
strcpy(backupPath, U_TOPSRCDIR U_FILE_SEP_STRING "data");
|
||||
#else
|
||||
strcpy(backupPath, u_getDataDirectory());
|
||||
strcat(backupPath, ".." U_FILE_SEP_STRING ".." U_FILE_SEP_STRING "data");
|
||||
#endif
|
||||
#if defined (U_TOPSRCDIR)
|
||||
strcpy(backupPath, U_TOPSRCDIR U_FILE_SEP_STRING "data");
|
||||
#else
|
||||
strcpy(backupPath, __FILE__);
|
||||
strrchr(backupPath, U_FILE_SEP_CHAR)[0] = 0; /* Remove the file name */
|
||||
strrchr(backupPath, U_FILE_SEP_CHAR)[0] = 0; /* Previous directory */
|
||||
strrchr(backupPath, U_FILE_SEP_CHAR)[0] = 0; /* Previous directory */
|
||||
strcat(backupPath, U_FILE_SEP_STRING "data");
|
||||
#endif
|
||||
strcat(backupPath, U_FILE_SEP_STRING);
|
||||
strcat(backupPath, "unidata" U_FILE_SEP_STRING "UnicodeData.txt");
|
||||
|
||||
|
@ -379,7 +379,7 @@ void IntlTest::setICU_DATA() {
|
||||
|
||||
#if defined (U_TOPBUILDDIR)
|
||||
{
|
||||
static char env_string[] = U_TOPBUILDDIR "/data/out/";
|
||||
static char env_string[] = U_TOPBUILDDIR U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING;
|
||||
u_setDataDirectory(env_string);
|
||||
return;
|
||||
}
|
||||
@ -410,7 +410,7 @@ void IntlTest::setICU_DATA() {
|
||||
/* We found and truncated three names from the path.
|
||||
* Now append "source\data" and set the environment
|
||||
*/
|
||||
strcpy(pBackSlash, U_FILE_SEP_STRING "data" U_FILE_SEP_STRING);
|
||||
strcpy(pBackSlash, U_FILE_SEP_STRING "data" U_FILE_SEP_STRING "out" U_FILE_SEP_STRING);
|
||||
u_setDataDirectory(p); /* p is "ICU_DATA=wherever\icu\source\data" */
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user