* support/regression/Makefile: redo 1.27
* support/regression/generate-cases.py: redo 1.5
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2583
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2003-05-04 Bernhard Held <bernhard@bernhardheld.de>
+
+ * support/regression/HTMLgen.py: added compare_s2f()
+ * support/regression/Makefile: redo 1.27
+ * support/regression/generate-cases.py: redo 1.5
+
2003-04-30 Bernhard Held <bernhard@bernhardheld.de>
* support/regression/tests/float.c: workaround 33 bit hex constant
f = open(template)
self.source = f.read()
f.close()
+
+def compare_s2f(s, f2):
+ """Helper to compare a string to a file, return 0 if they are equal."""
+
+ BUFSIZE = 8192
+ i = 0
+ fp2 = open(f2)
+ try:
+ while 1:
+ try:
+ b1 = s[i: i + BUFSIZE]
+ i = i + BUFSIZE
+ except IndexError:
+ b1 = ''
+ b2 = fp2.read(BUFSIZE)
+ if not b1 and not b2: return 0
+ c = cmp(b1, b2)
+ if c: return c
+ finally:
+ fp2.close()
# Rule to generate the iterations of a test suite off the soure suite.
$(PORT_CASES_DIR)/%/iterations.stamp: $(TESTS_DIR)/%.c $(GENERATE_CASES)
echo Processing $<
- rm -rf $(CASES_DIR)/$(PORT)/$(TESTS_NAME)
- mkdir -p $(CASES_DIR)/$(PORT)/$(TESTS_NAME)
mkdir -p `dirname $@`
- python $(GENERATE_CASES) $< $(CASES_DIR)/$(PORT) > /dev/null
- cp $(CASES_DIR)/$(PORT)/$(TESTS_NAME)/*.c `dirname $@`
+ python $(GENERATE_CASES) $< `dirname $@` > /dev/null
touch $@
# Rule linking the combined results log to all of the files in the
createdir(outdir)
# Generate
- self.permute(os.path.join(outdir, self.basename), self.replacements.keys())
+ self.permute(os.path.join(outdir, os.path.basename(self.basename)), self.replacements.keys())
# Remove the temporary file
os.remove(self.tmpname)