Skip to content
Snippets Groups Projects
Commit 444612f4 authored by Thomas Oster's avatar Thomas Oster
Browse files

added test-script for code sanity (to be extended)

parent 6bdaf024
No related branches found
No related tags found
No related merge requests found
/**
* This file is part of LibLaserCut.
* Copyright (C) 2011 - 2013 Thomas Oster <thomas.oster@rwth-aachen.de>
* RWTH Aachen University - 52062 Aachen, Germany
*
* LibLaserCut is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LibLaserCut 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with LibLaserCut. If not, see <http://www.gnu.org/licenses/>.
**/
test.sh 0 → 100755
#!/bin/bash
# Performs some sanity and code cleanness tests. Intended to be run before every commit
echo "Checking for copryight header"
if ! [ -f copyrightheader ]
then
echo "File 'copyrightheader' is missing"
exit 1
fi
HEADERSIZE=$(wc -l < copyrightheader)
ERRORS=0
for f in $(find src -name '*.java')
do
if ! cat $f|head -n $HEADERSIZE|diff - copyrightheader > /dev/null
then
echo "Copyright header mismatch on $f"
ERRORS=1
fi
done
exit $ERRORS
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment