[sword-svn] r3152 - in trunk/tests: . testsuite
scribe at crosswire.org
scribe at crosswire.org
Sun Apr 13 16:35:53 MST 2014
Author: scribe
Date: 2014-04-13 16:35:53 -0700 (Sun, 13 Apr 2014)
New Revision: 3152
Added:
trunk/tests/ldtest.cpp
trunk/tests/testsuite/ldr12n.good
trunk/tests/testsuite/ldr12n.imp
trunk/tests/testsuite/ldr12n.sh
Modified:
trunk/tests/CMakeLists.txt
trunk/tests/Makefile.am
Log:
added new test for bug MOD-61. Make this test pass
Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt 2014-04-13 23:35:17 UTC (rev 3151)
+++ trunk/tests/CMakeLists.txt 2014-04-13 23:35:53 UTC (rev 3152)
@@ -31,6 +31,8 @@
localetest
mgrtest
modtest
+ osistest
+ ldtest
parsekey
rawldidxtest
romantest
Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am 2014-04-13 23:35:17 UTC (rev 3151)
+++ trunk/tests/Makefile.am 2014-04-13 23:35:53 UTC (rev 3152)
@@ -12,7 +12,7 @@
compnone complzss localetest introtest indextest \
configtest keycast romantest testblocks filtertest \
rawldidxtest lextest swaptest swbuftest xmltest \
- webiftest striptest osistest bibliotest
+ webiftest striptest ldtest osistest bibliotest
if HAVE_ICU
ICUPROG = icutest translittest tlitmgrtest
@@ -68,6 +68,7 @@
webiftest_SOURCES = webiftest.cpp
striptest_SOURCES = striptest.cpp
xmltest_SOURCES = xmltest.cpp
+ldtest_SOURCES = ldtest.cpp
osistest_SOURCES = osistest.cpp
bibliotest_SOURCES = bibliotest.cpp
Added: trunk/tests/ldtest.cpp
===================================================================
--- trunk/tests/ldtest.cpp (rev 0)
+++ trunk/tests/ldtest.cpp 2014-04-13 23:35:53 UTC (rev 3152)
@@ -0,0 +1,26 @@
+#include <swmodule.h>
+#include <swmgr.h>
+#include <iostream>
+
+using namespace sword;
+using namespace std;
+
+int main(int argc, char **argv) {
+
+ SWMgr library;
+ SWModule *module = library.getModule("ldr12n");
+ if (!module) {
+ cerr << "\nCouldn't find module: " << argv[1] << "\n" << endl;
+ exit(-2);
+ }
+ int i = 0;
+ for ((*module) = TOP; !module->popError(); module->increment()) {
+ cout << module->getKeyText() << ": " << module->stripText() << "\n";
+ if (++i > 10) {
+ cout << "ERROR: more than 10 iterations. stopping.\n";
+ break;
+ }
+
+ }
+ return 0;
+}
Added: trunk/tests/testsuite/ldr12n.good
===================================================================
--- trunk/tests/testsuite/ldr12n.good (rev 0)
+++ trunk/tests/testsuite/ldr12n.good 2014-04-13 23:35:53 UTC (rev 3152)
@@ -0,0 +1,12 @@
+0001
+0002
+0003
+4
+0005
+0006
+0001: Body of 1
+0002: Body of 2
+0003: Body of 3
+0005: Body of 5
+0006: Body of 6
+4: Body of 4
Added: trunk/tests/testsuite/ldr12n.imp
===================================================================
--- trunk/tests/testsuite/ldr12n.imp (rev 0)
+++ trunk/tests/testsuite/ldr12n.imp 2014-04-13 23:35:53 UTC (rev 3152)
@@ -0,0 +1,12 @@
+$$$0001
+Body of 1
+$$$0002
+Body of 2
+$$$0003
+Body of 3
+$$$4
+Body of 4
+$$$0005
+Body of 5
+$$$0006
+Body of 6
Added: trunk/tests/testsuite/ldr12n.sh
===================================================================
--- trunk/tests/testsuite/ldr12n.sh (rev 0)
+++ trunk/tests/testsuite/ldr12n.sh 2014-04-13 23:35:53 UTC (rev 3152)
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+rm -rf ldr12n/
+mkdir -p ldr12n/mods.d
+mkdir -p ldr12n/modules
+
+cat > ldr12n/mods.d/ldr12n.conf <<!
+[ldr12n]
+DataPath=./modules/ldr12n
+ModDrv=RawLD
+Encoding=UTF-8
+SourceType=Plain
+Lang=en
+!
+
+../../utilities/imp2ld ldr12n.imp -o ldr12n/modules/ldr12n 2>&1 | grep -v \$Rev
+
+cd ldr12n && ../../ldtest ldr12n
Property changes on: trunk/tests/testsuite/ldr12n.sh
___________________________________________________________________
Added: svn:executable
+ *
More information about the sword-cvs
mailing list