root/trunk/bin/fortick @ 3898

Revision 3898, 1.7 KB (checked in by sukyoungryu, 5 months ago)

[tests] Refactored the test harness to handle any Fortress shell commands.

  • Property svn:executable set to *
Line 
1#!/bin/bash
2
3################################################################################
4#    Copyright 2009 Sun Microsystems, Inc.,
5#    4150 Network Circle, Santa Clara, California 95054, U.S.A.
6#    All rights reserved.
7#
8#    U.S. Government Rights - Commercial software.
9#    Government users are subject to the Sun Microsystems, Inc. standard
10#    license agreement and applicable provisions of the FAR and its supplements.
11#
12#    Use is subject to license terms.
13#
14#    This distribution may include materials developed by third parties.
15#
16#    Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
17#    trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
18################################################################################
19
20FORTRESS_HOME="`${0%fortick}fortress_home`"
21
22if [ "x"$1 = "x-q" ] ; then
23  SILENCE="golden"
24  shift
25fi
26
27if [ $# -ne 1 ] ; then
28  echo "Usage: fortick [-q] somefile.suffix (one file, no more, no less)"
29  echo "  Replaces backtick-delimited fortress with nicely formatted fortress."
30  echo "  Writes to somefile.tex (will overwrite original if suffix = \"tex\")"
31  echo "  Option -q suppresses some of the command output."
32  exit 1
33fi
34
35if grep -q "usepackage{.*fortify.*}" $1 ; then
36  true
37else
38  if [ -z "$SILENCE" ]  ; then
39     echo "WARNING: input file lacks \\usepackage{fortify}"
40  fi
41fi
42
43BASENAME=${1%.*}
44
45USE_EMACS=${USE_EMACS:-emacs}
46[ -n "$EMACS" ] && unset EMACSLOADPATH
47"${USE_EMACS}" -batch "$@" -l "$FORTRESS_HOME/Fortify/fortify.el" -f fortick
48
49if [ -z "$SILENCE" ]  ; then
50  echo "Process with"
51  echo "  TEXINPUTS=\".:${FORTRESS_HOME}/Fortify:\" latex \"${BASENAME}.tex\""
52  echo "or (for pdf output) "
53  echo "  TEXINPUTS=\".:${FORTRESS_HOME}/Fortify:\" pdflatex \"${BASENAME}.tex\""
54fi
Note: See TracBrowser for help on using the browser.