Skip to content

Commit

Permalink
Added make test option to nanos
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirk Eaton committed Oct 10, 2018
1 parent 256ee6a commit 6843a70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,6 @@ all: nanos

run: nanos $(foam2_JAR)
./$< -d --datadir src

test: nanos $(foam2_JAR)
./$< -t --datadir src
8 changes: 7 additions & 1 deletion nanos.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
DEBUG=n
SUSPEND=n
DEBUG_PORT=8000
TEST=0

usage() {
echo "Usage: nanos [OPTIONS] [NANOS_OPTIONS]"
Expand All @@ -21,13 +22,14 @@ usage() {
echo ""
}

while getopts ":da:shj:" opt; do
while getopts ":da:shj:t" opt; do
case $opt in
d) DEBUG=y ;;
s) SUSPEND=y ;;
a) DEBUG_PORT=$OPTARG ;;
j) EXTRA_CP=":$OPTARG" ;;
h) usage ; exit 0 ;;
t) TEST=1 ;;
?) break ;;
esac
done
Expand All @@ -38,6 +40,10 @@ if test "$DEBUG" = y; then
DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=${SUSPEND},address=${DEBUG_PORT}"
fi

if test "$TEST" = 1; then
DEBUG_ARGS="${DEBUG_ARGS} -Dfoam.main=testRunnerScript"
fi

shift $(($OPTIND - 1))

exec java $DEBUG_ARGS -cp @CLASSPATH@$EXTRA_CP foam.nanos.boot.Boot "$@"
2 changes: 1 addition & 1 deletion src/foam/lib/json/StringParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class StringParser
{
protected final static char ESCAPE = '\\';
protected final static ThreadLocal<Parser> unicodeParser = ThreadLocal.withInitial(UnicodeParser::new);
protected final static ThreadLocal<Parser> asciiEscapeParser = ThreadLocal.withInitial(ASCIIEscapeParser::new);cd
protected final static ThreadLocal<Parser> asciiEscapeParser = ThreadLocal.withInitial(ASCIIEscapeParser::new);
protected final static ThreadLocal<StringBuilder> sb = new ThreadLocal<StringBuilder>() {

@Override
Expand Down

0 comments on commit 6843a70

Please sign in to comment.