#!/bin/bash

# Barcode Writer in Pure PostScript
# https://bwipp.terryburton.co.uk
#
# Copyright (c) 2004-2024 Terry Burton

set -e
set -u
set -o pipefail

TEST=$(dirname "$0")

echo -n "Running $TEST: "

if gs --version | grep -q '^7\.'; then
	echo "SKIPPED GS too old"
	exit 0
fi

cd build/resource/Resource || exit

if gs -dNOPAUSE -dQUIET -dBATCH -sDEVICE=nullpage -P ../sample.ps; then
	echo "PASS"
	exit 0
else
	echo "FAIL"
	exit 1
fi
