Monotone-Parent: 766baf56d74d898b08d6a686cdd909e3825d8e2f

Monotone-Revision: 808d40a88677de09c4168d17acc5946afe8e9813

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-11-03T14:27:31
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2010-11-03 14:27:31 +00:00
parent 10833ce7d1
commit 5e94a939a8
4 changed files with 121 additions and 0 deletions

View File

@ -1,5 +1,8 @@
2010-11-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Tests/Integration/teststrings.sh: new utility script to test the
parsability of the localization strings file.
* UI/WebServerResources/generic.js: (onCASRecoverIFrameLoaded):
go back to the user's page instead of the logoff page.

View File

@ -0,0 +1,19 @@
PROGRAM=teststrings
SRCS=teststrings.m
OBJS=$(SRCS:.m=.o)
teststrings: $(OBJS)
$(CC) -o $@ $< $(GNUSTEP_LIBRARIES_FLAGS) -lSOGo -lgnustep-base
include $(GNUSTEP_MAKEFILES)/common.make
all: $(PROGRAM)
clean:
rm -f $(PROGRAM) $(OBJS) *~
.m.o:
$(CC) -o $@ -c $(GNUSTEP_HEADERS_FLAGS) $(AUXILIARY_OBJCFLAGS) $(OBJCFLAGS) $(CPPFLAGS) $<
.SUFFIXES: .m .o

View File

@ -0,0 +1,79 @@
/* teststrings.m - this file is part of SOGO
*
* Copyright (C) 2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/Foundation.h>
#import <SOGo/NSDictionary+Utilities.h>
static int
performTest (char *filename)
{
NSDictionary *testDict;
NSString *nsFilename;
int rc;
nsFilename = [NSString stringWithFormat: @"%s", filename];
NS_DURING
{
testDict = [NSDictionary dictionaryFromStringsFile: nsFilename];
if ([testDict count] == 0)
{
NSLog (@"Bad or empty strings file");
rc = 2;
testDict = nil;
}
else
rc = 0;
}
NS_HANDLER
{
NSLog (@"An exception was caught: %@", localException);
rc = 1;
testDict = nil;
}
NS_ENDHANDLER;
return rc;
}
int
main (int argc, char *argv[])
{
NSAutoreleasePool *pool;
int rc;
pool = [NSAutoreleasePool new];
if (argc == 2)
{
rc = performTest (argv[1]);
}
else
{
NSLog (@"Usage: %s file.strings", argv[0]);
rc = 1;
}
[pool release];
return rc;
}

View File

@ -0,0 +1,20 @@
#!/bin/sh
TOPDIR=../..
if [ ! -f teststrings ]
then
make teststrings
fi
for stringfile in ${TOPDIR}/*/*/*.lproj/Localizable.strings
do
./teststrings "$stringfile" > /dev/null
code=$?
if test $code -eq 0;
then
echo "$stringfile: passed";
else
echo "$stringfile: failed (code: $code)";
fi
done