From 6277ce8223d05432fc6b458733cb52b985693fa1 Mon Sep 17 00:00:00 2001 From: Ryan Delaney Date: Thu, 5 Jun 2014 14:58:49 -0700 Subject: [PATCH] initial commit to build a test suite --- buildsuite | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100755 buildsuite diff --git a/buildsuite b/buildsuite new file mode 100755 index 0000000..91062db --- /dev/null +++ b/buildsuite @@ -0,0 +1,117 @@ +#!/usr/bin/env bash +# GNU bash, version 4.3.18(1)-release (x86_64-unknown-linux-gnu) +# +# © Copyright 2014 Ryan Delaney. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# + +# Functions {{{1 +verbose() { + if [[ "$verbose" = "1" ]]; then + echo "$1" >&2 + fi +} + +error() { + echo "$1" >&2 +} +# }}} +# Usage {{{1 +# +usage() { +cat <&2 + exit 1 + shift + ;; + *) # no more options. Stop while loop + break + ;; + esac +done +# }}} +# Dependencies {{{ +if ! type sed &> /dev/null; then echo "ERROR: Missing dependency: sed" 1>&2; exit 1; fi +# }}} + +if [[ ! -d "./test" ]]; then mkdir test || exit 1; fi +cd test || exit 1 + +# File +touch FILE + +# Executable file +touch EXECUTABLE +chmod +x EXECUTABLE + +# Directory +mkdir DIRECTORY + +# Symlink +ln -s FILE SYMLINK + +# Hardlink +touch HARDLINK1 +ln HARDLINK1 HARDLINK2 + +# Create a link to nowhere +touch nothing +ln -s nothing ORPHAN +rm nothing + +# World-writable +touch WORLDWRITEABLE +chmod 0777 WORLDWRITEABLE + +# Supported extensions +while read line; do + : +# echo "$line" +done < <(sed -e '/^[ ]+#/d' ../LS_COLORS) + +# vim: ft=sh foldmethod=marker: