1. Shlomi Fish
  2. Quad-Pres

Commits

shl...@6a489e09-e8c2-0310-a3fb-a128a961c0b2  committed c17e6c1

Added the credit dir.

  • Participants
  • Parent commits 3bb2ae3
  • Branches default

Comments (0)

Files changed (1)

File installer/tests/credit/test1.bash

View file
  • Ignore whitespace
+#!/bin/bash
+
+# Verify the HTML correctness for all the themes
+
+if [ ! -e in-out ] ; then
+    mkdir in-out
+else
+    rm -fr in-out/*
+fi
+cd "in-out"
+
+# Check that the default charset and lang are OK.
+t=0
+
+perform_test()
+{
+let t++
+local theme
+theme="$1"
+shift
+local dir
+dir="$1"
+shift
+echo "Test No. $t : Theme=$theme dir=$dir"
+
+test_dir=testhtml$t
+quadp setup $test_dir --dest-dir=`pwd`/${test_dir}-output
+sed -i "s/-DTHEME=[-a-zA-Z_]\+/-DTHEME=${theme}/" $test_dir/.wmlrc
+
+cat > $test_dir/src/index.html.wml <<EOF
+<set-var body_dir="$dir" />
+#include 'template.wml'
+
+<p>
+Hello world!
+</p>
+
+EOF
+
+(cd $test_dir && quadp render -a)
+output_file=$test_dir-output/index.html
+if ! tidy -errors $output_file ; then
+    echo "File does not validate!" 1>&2 
+    exit 
+fi
+
+body_str="<body>"
+if test "$dir" == "rtl" ; then
+    body_str="<body dir=\"rtl\">"
+fi
+
+if ! grep -F "$body_str" $output_file > /dev/null ; then
+    echo "File does not contain the correct body!" 1>&2
+    exit
+fi
+
+}
+
+for theme in $(cd ../../installation/share/quad-pres/wml/themes/ && ls) ; do
+    for dir in ltr rtl ; do        
+        perform_test "$theme" "$dir"
+    done
+done
+