summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorMyoungJune Park <mj2004.park@samsung.com>2016-06-28 19:02:02 -0700
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2016-06-28 19:02:02 -0700
commit9f437f121e0a3f95f2f73a2fb94129df473ce6c7 (patch)
treebe58f256e24304bccfdc6329d96567dcd6b8d877 /win32
parent925059ca6aa063c9640e82ad4f40be2e38959aa8 (diff)
parent0f3d43b0708f1e7a1a1826b2e4d310c86f086078 (diff)
downloadlibxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.tar.gz
libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.tar.bz2
libxslt-9f437f121e0a3f95f2f73a2fb94129df473ce6c7.zip
Merge "Rebase for libxslt-1.1.29" into tizen_base
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.mingw6
-rw-r--r--win32/Makefile.msvc1
-rw-r--r--win32/runtests.py87
3 files changed, 91 insertions, 3 deletions
diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw
index 946ffa3d..5b102b38 100644
--- a/win32/Makefile.mingw
+++ b/win32/Makefile.mingw
@@ -72,6 +72,7 @@ endif
# Libxslt object files.
XSLT_OBJS = $(XSLT_INTDIR)/attributes.o\
+ $(XSLT_INTDIR)/attrvt.o\
$(XSLT_INTDIR)/documents.o\
$(XSLT_INTDIR)/extensions.o\
$(XSLT_INTDIR)/extra.o\
@@ -93,6 +94,7 @@ XSLT_SRCS = $(subst .o,.c,$(subst $(XSLT_INTDIR),$(XSLT_SRCDIR),$(XSLT_OBJS)))
# Static libxslt object files.
XSLT_OBJS_A = $(XSLT_INTDIR_A)/attributes.o\
+ $(XSLT_INTDIR_A)/attrvt.o\
$(XSLT_INTDIR_A)/documents.o\
$(XSLT_INTDIR_A)/extensions.o\
$(XSLT_INTDIR_A)/extra.o\
@@ -290,11 +292,11 @@ CFLAGS += -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC
APP_LDFLAGS += -Bstatic
$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
- $(LD) $(APP_LDFLAGS) -o $@ $(APPLIBS) $(subst .c,.o,$(UTILS_INTDIR)/$(<F))
+ $(LD) $(APP_LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) $(APPLIBS)
else
$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
- $(LD) $(APP_LDFLAGS) -o $@ $(APPLIBS) $(subst .c,.o,$(UTILS_INTDIR)/$(<F))
+ $(LD) $(APP_LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) $(APPLIBS)
endif
# Builds xsltproc and friends. Uses the implicit rule for commands.
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index 54e8e23f..23a02d27 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -71,7 +71,6 @@ CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
LDFLAGS = $(LDFLAGS) /DEBUG
!else
CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
-LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
!endif
# Libxslt object files.
diff --git a/win32/runtests.py b/win32/runtests.py
new file mode 100644
index 00000000..4d9aabb7
--- /dev/null
+++ b/win32/runtests.py
@@ -0,0 +1,87 @@
+import io
+import os
+import sys
+import difflib
+
+from os import path
+from subprocess import Popen, PIPE
+
+xsltproc = path.join(os.getcwd(), "win32", "bin.msvc", "xsltproc.exe")
+if not path.isfile(xsltproc):
+ xsltproc = path.join(os.getcwd(), "win32", "bin.mingw", "xsltproc.exe")
+ if not path.isfile(xsltproc):
+ raise FileNotFoundError(xsltproc)
+
+def runtests(xsl_dir, xml_dir="."):
+ old_dir = os.getcwd()
+ os.chdir(xsl_dir)
+
+ for xsl_file in os.listdir():
+ if not xsl_file.endswith(".xsl"):
+ continue
+ xsl_path = "./" + xsl_file
+ name = path.splitext(xsl_file)[0]
+
+ xml_path = path.join(xml_dir + "/" + name + ".xml")
+ if not path.isfile(xml_path):
+ continue
+
+ args = [ xsltproc, xsl_path, xml_path ]
+ p = Popen(args, stdout=PIPE, stderr=PIPE)
+ out_path = path.join(xml_dir, name + ".out")
+ err_path = path.join(xml_dir, name + ".err")
+ out_diff = diff(p.stdout, "<stdout>", name + ".out")
+ err_diff = diff(p.stderr, "<stderr>", name + ".err")
+
+ if (len(out_diff) or len(err_diff)):
+ sys.stdout.writelines(out_diff)
+ sys.stdout.writelines(err_diff)
+ print()
+
+ os.chdir(old_dir)
+
+def diff(got_stream, got_name, expected_path):
+ text_stream = io.TextIOWrapper(got_stream, encoding="latin_1")
+ got_lines = text_stream.readlines()
+
+ if path.isfile(expected_path):
+ file = open(expected_path, "r", encoding="latin_1")
+ expected_lines = file.readlines()
+ else:
+ expected_lines = []
+
+ diff = difflib.unified_diff(expected_lines, got_lines,
+ fromfile=expected_path,
+ tofile=got_name)
+ return list(diff)
+
+print("## Running REC tests")
+runtests("tests/REC")
+
+print("## Running general tests")
+runtests("tests/general", "./../docs")
+
+print("## Running exslt common tests")
+runtests("tests/exslt/common")
+
+print("## Running exslt functions tests")
+runtests("tests/exslt/functions")
+
+print("## Running exslt math tests")
+runtests("tests/exslt/math")
+
+print("## Running exslt saxon tests")
+runtests("tests/exslt/saxon")
+
+print("## Running exslt sets tests")
+runtests("tests/exslt/sets")
+
+print("## Running exslt strings tests")
+runtests("tests/exslt/strings")
+
+print("## Running exslt dynamic tests")
+runtests("tests/exslt/dynamic")
+
+print("## Running exslt date tests")
+runtests("tests/exslt/date")
+