summaryrefslogtreecommitdiff
path: root/tests/url
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-08-11 21:46:42 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-08-11 21:46:42 +0200
commit6da9ed10808489c39df5d9fa8e6d629b68ba8b07 (patch)
tree2be3248510d4aceb94c539c9dbe69e0df7fd5c12 /tests/url
parent8264f32b2233c1f46446c51ea5a2983fd9f76497 (diff)
downloadcrawler-6da9ed10808489c39df5d9fa8e6d629b68ba8b07.tar.gz
crawler-6da9ed10808489c39df5d9fa8e6d629b68ba8b07.tar.bz2
fixed URL normalizer tests on Windows, work the same way as on Unix now
Diffstat (limited to 'tests/url')
-rwxr-xr-xtests/url/Makefile.W3234
-rwxr-xr-xtests/url/test1.cpp2
2 files changed, 19 insertions, 17 deletions
diff --git a/tests/url/Makefile.W32 b/tests/url/Makefile.W32
index cd545dd..f2f74ee 100755
--- a/tests/url/Makefile.W32
+++ b/tests/url/Makefile.W32
@@ -6,7 +6,7 @@ SUBDIRS =
INCLUDE_CXXFLAGS = \
/D_WIN32_WINNT=0x504 \
-# /DUSE_MODULELOADER
+ /DUSE_MODULELOADER
INCLUDE_DIRS = \
/I. \
@@ -18,10 +18,10 @@ INCLUDE_LDFLAGS = \
INCLUDE_LIBS = \
$(TOPDIR)\src\crawlingwolf.lib \
+ $(TOPDIR)\src\modules\urlnormalizer\simpleurl\simpleurlnormalizer.lib \
$(TOPDIR)\src\modules\urlnormalizer\googleurl\googleurlnormalizer.lib \
$(TOPDIR)\googleurl\googleurl.lib \
"$(ICU_DIR)\lib\icuuc.lib"
-# $(TOPDIR)\src\modules\urlnormalizer\simpleurl\simpleurlnormalizer.lib \
TEST_CPP_BINS = \
test1.exe
@@ -40,17 +40,19 @@ local_clean:
local_distclean:
local_test:
- @-copy "$(ICU_DIR)\bin\icuuc49.dll" .
- @-copy "$(ICU_DIR)\bin\icudt49.dll" .
- @-exec_test test1 test1 "parse illegal protocol" simple parse www.andreasbaumann.cc
- @-exec_test test1 test2 "parse normal start URL without slash" simple parse http://www.andreasbaumann.cc
- @-exec_test test1 test3 "parse normal start URL with slash" simple parse http://www.andreasbaumann.cc/
- @-exec_test test1 test4 "parse normal URL" simple parse http://www.andreasbaumann.cc/index.html
- @-exec_test test1 test5 "parse normal URL with default port" simple parse http://www.andreasbaumann.cc:80/index.html
- @-exec_test test1 test6 "parse normal URL with non-standard port" simple parse http://www.andreasbaumann.cc:8080/index.html
- @-exec_test test1 test100 "normalize a relative URL" simple normalize http://www.andreasbaumann.cc/index.html /software.html
- @-exec_test test1 test101 "absolute URL in HTML content" simple normalize http://www.andreasbaumann.cc/index.html http://www.yahoo.com/page.html
- @-exec_test test1 test102 "path normalization, relative path" simple normalize http://www.andreasbaumann.cc/adir/index.html bdir/page.html
- @-exec_test test1 test103 "path normalization, absolute path" simple normalize http://www.andreasbaumann.cc/adir/index.html /bdir/page.html
- @-exec_test test1 test104 "path normalization, current dir" simple normalize http://www.andreasbaumann.cc/adir/index.html ./bdir/page.html
- @-exec_test test1 test105 "path normalization, previous dir" simple normalize http://www.andreasbaumann.cc/adir/index.html ../bdir/page.html
+ @-copy "$(ICU_DIR)\bin\icuuc49.dll" . >NUL
+ @-copy "$(ICU_DIR)\bin\icudt49.dll" . >NUL
+ @-for %%m in ( simple google ) do \
+ @echo Using URL normalizer '%m'.. & \
+ @exec_test test1 test1 "parse illegal protocol" %m parse www.andreasbaumann.cc & \
+ @exec_test test1 test2 "parse normal start URL without slash" %m parse http://www.andreasbaumann.cc & \
+ @exec_test test1 test3 "parse normal start URL with slash" %m parse http://www.andreasbaumann.cc/ & \
+ @exec_test test1 test4 "parse normal URL" %m parse http://www.andreasbaumann.cc/index.html & \
+ @exec_test test1 test5 "parse normal URL with default port" %m parse http://www.andreasbaumann.cc:80/index.html & \
+ @exec_test test1 test6 "parse normal URL with non-standard port" %m parse http://www.andreasbaumann.cc:8080/index.html & \
+ @exec_test test1 test100 "normalize a relative URL" %m normalize http://www.andreasbaumann.cc/index.html /software.html & \
+ @exec_test test1 test101 "absolute URL in HTML content" %m normalize http://www.andreasbaumann.cc/index.html http://www.yahoo.com/page.html & \
+ @exec_test test1 test102 "path normalization, relative path" %m normalize http://www.andreasbaumann.cc/adir/index.html bdir/page.html & \
+ @exec_test test1 test103 "path normalization, absolute path" %m normalize http://www.andreasbaumann.cc/adir/index.html /bdir/page.html & \
+ @exec_test test1 test104 "path normalization, current dir" %m normalize http://www.andreasbaumann.cc/adir/index.html ./bdir/page.html & \
+ @exec_test test1 test105 "path normalization, previous dir" %m normalize http://www.andreasbaumann.cc/adir/index.html ../bdir/page.html
diff --git a/tests/url/test1.cpp b/tests/url/test1.cpp
index b46e690..95db9fb 100755
--- a/tests/url/test1.cpp
+++ b/tests/url/test1.cpp
@@ -42,7 +42,7 @@ int main( int argc, char *argv[] )
#else
URLNormalizer *normalizer;
if( strcmp( method, "simple" ) == 0 ) {
-// normalizer = new SimpleURLNormalizer( );
+ normalizer = new SimpleURLNormalizer( );
} else if( strcmp( method, "google" ) == 0 ) {
normalizer = new GoogleURLNormalizer( );
} else {