Skip to content

Commit 6d0fbd3

Browse files
committed
emit a warning if committed changes are present in the current source tree
1 parent 137e560 commit 6d0fbd3

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
### Added
9+
- a simple regression test script test/make-test.sh to compile all examples
10+
811
### Changed
912
- using busybox as command shell for windows to run the wrapper scripts
1013

test/make-test.sh

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
CURDIR=$(pwd)
4-
SRCREV=$(git describe --tags --match="v*")
4+
SRCREV=$(git describe --tags --match="v*" --dirty)
55
LOGFILE=${CURDIR}/logs/test-${SRCREV}.log
66
BASEDIR=../sduino/hardware/sduino/stm8/libraries/
77

@@ -10,6 +10,7 @@ THREADS=$(grep processor /proc/cpuinfo |wc -l)
1010

1111
# make sure $COLUMNS is set
1212
shopt -s checkwinsize
13+
USE_COLOR=1
1314

1415
print_status() {
1516
local status
@@ -30,6 +31,35 @@ print_status() {
3031
echo "source revision: $SRCREV"
3132
) | tee "$LOGFILE"
3233

34+
35+
if [ $USE_COLOR -gt 0 ]; then
36+
# ANSI color codes to beautify the output:
37+
BLACK='\033[0;30m'
38+
RED='\033[0;31m'
39+
GREEN='\033[0;32m'
40+
ORANGE='\033[0;33m'
41+
BLUE='\033[0;34m'
42+
PURPLE='\033[0;35m'
43+
CYAN='\033[0;36m'
44+
LGRAY='\033[0;37m'
45+
DGRAY='\033[1;30m'
46+
LRED='\033[1;31m'
47+
LGREEN='\033[1;32m'
48+
YELLOW='\033[1;33m'
49+
LBLUE='\033[1;34m'
50+
LPURPLE='\033[1;35m'
51+
LCYAN='\033[1;36m'
52+
WHITE='\033[1;37m'
53+
OFF='\033[0m'
54+
fi
55+
56+
# check for a clean repository state
57+
if [[ "$SRCREV" = *-dirty ]]; then
58+
echo -e "${ORANGE}Warning:${OFF}"\
59+
"Uncommitted changes in the working tree. No clean repository state."
60+
fi
61+
62+
3363
# removing *all* old build directories for a clear start
3464
find "$BASEDIR" -name "build-*" -type d|xargs rm -r
3565

0 commit comments

Comments
 (0)