#!/bin/sh # Copyright (c) 2009 Chris Miceli (cmicel1@cct.lsu.edu) # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # Header while getopts d arg do case $arg in d) echo "This program tests the functionality of the default file adaptor to cat files." exit 0;; esac done # Create the temporary file TMPFILE=`mktemp -t saga.adaptor.XXXXXX` || exit 1 # Verify existence if ! test -e $TMPFILE then echo "Could not create temporary source file!" exit 1 fi # Give the file some contents `echo "Hello Saga" > $TMPFILE` # Cat the file RESULT=`$SAGA_LOCATION/bin/saga-file cat file://localhost/$TMPFILE` # Clean up temporaries rm $TMPFILE # Verify the cat exited what was expected if test "$RESULT" != "Hello Saga" then echo "Saga could not succesfully cat the file!" exit 1 else echo "Success" exit 0; fi