summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to 'testing')
-rw-r--r--testing/SUPPRESSIONS1
-rwxr-xr-xtesting/tools/api_check.py2
-rwxr-xr-xtesting/tools/make_expected.sh9
-rw-r--r--testing/tools/test_runner.py11
4 files changed, 18 insertions, 5 deletions
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index ed2973c2ee..f3d5867dda 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -299,7 +299,6 @@ FRC_8.5_PO_GoToE_T_R&N.pdf * * *
Choose.pdf * * *
data_binding.pdf * * *
-Date_FormCale.pdf * * *
# TODO(npm): Add proper evt for MouseEvents.
MouseEvents_enter.pdf * * *
MouseEvents_exit.pdf * * *
diff --git a/testing/tools/api_check.py b/testing/tools/api_check.py
index 2c5cc4fa3e..934577b21b 100755
--- a/testing/tools/api_check.py
+++ b/testing/tools/api_check.py
@@ -22,6 +22,8 @@ def _IsValidFunctionName(function, filename):
return True
if function == 'FSDK_SetUnSpObjProcessHandler' and filename == 'fpdf_ext.h':
return True
+ if function == 'FSDK_SetTimeFunction' and filename == 'fpdf_ext.h':
+ return True
if function.startswith('FORM_') and filename == 'fpdf_formfill.h':
return True
return False
diff --git a/testing/tools/make_expected.sh b/testing/tools/make_expected.sh
index a70df797c2..9b7e3d8716 100755
--- a/testing/tools/make_expected.sh
+++ b/testing/tools/make_expected.sh
@@ -6,6 +6,11 @@
#
# Script to generate expected result files.
+# Arbitrary timestamp, expressed in seconds since the epoch, used to make sure
+# that tests that depend on the current time are stable. Happens to be the
+# timestamp of the first commit to repo, 2014/5/9 17:48:50.
+TEST_SEED_TIME=1399672130
+
# Do this before "set -e" so "which" failing is not fatal.
PNGOPTIMIZER="$(which optipng)"
@@ -15,9 +20,9 @@ while (( "$#" )); do
echo $INFILE | grep -qs ' ' && echo space in filename detected && exit 1
EVTFILE="${INFILE%.*}.evt"
if [ -f "$EVTFILE" ]; then
- out/Debug/pdfium_test --send-events --png $INFILE
+ out/Debug/pdfium_test --send-events --time=$TEST_SEED_TIME --png $INFILE
else
- out/Debug/pdfium_test --png $INFILE
+ out/Debug/pdfium_test --time=$TEST_SEED_TIME --png $INFILE
fi
RESULTS="$INFILE.*.png"
for RESULT in $RESULTS ; do
diff --git a/testing/tools/test_runner.py b/testing/tools/test_runner.py
index ecd87ad082..43dc578a90 100644
--- a/testing/tools/test_runner.py
+++ b/testing/tools/test_runner.py
@@ -17,6 +17,11 @@ import gold
import pngdiffer
import suppressor
+# Arbitrary timestamp, expressed in seconds since the epoch, used to make sure
+# that tests that depend on the current time are stable. Happens to be the
+# timestamp of the first commit to repo, 2014/5/9 17:48:50.
+TEST_SEED_TIME = "1399672130"
+
class KeyboardInterruptError(Exception): pass
# Nomenclature:
@@ -132,14 +137,16 @@ class TestRunner:
txt_path = os.path.join(self.working_dir, input_root + '.txt')
with open(txt_path, 'w') as outfile:
- cmd_to_run = [self.pdfium_test_path, '--send-events', pdf_path]
+ cmd_to_run = [self.pdfium_test_path, '--send-events',
+ '--time=' + TEST_SEED_TIME, pdf_path]
subprocess.check_call(cmd_to_run, stdout=outfile)
cmd = [sys.executable, self.text_diff_path, expected_txt_path, txt_path]
return common.RunCommand(cmd)
def TestPixel(self, input_root, pdf_path, use_ahem):
- cmd_to_run = [self.pdfium_test_path, '--send-events', '--png', '--md5']
+ cmd_to_run = [self.pdfium_test_path, '--send-events', '--png', '--md5',
+ '--time=' + TEST_SEED_TIME]
if self.oneshot_renderer:
cmd_to_run.append('--render-oneshot')