From a6325f1cf284d4d90f80d4ba04c5089a8e08b434 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Mon, 25 Aug 2014 12:52:01 -0700 Subject: [PATCH] Fix #203 --- makefile | 11 +++++++---- src/analysis/run.d | 2 +- test.sh | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index eb2398d..dc29cbc 100644 --- a/makefile +++ b/makefile @@ -22,23 +22,26 @@ DEBUG_VERSIONS = -version=std_parser_verbose all: dmdbuild debug: - ${DMD} -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC} + ${DMD} -g -ofdsc ${VERSIONS} ${DEBUG_VERSIONS} ${INCLUDE_PATHS} ${SRC} dmdbuild: mkdir -p bin - ${DMD} -O -release -inline -ofdscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} + ${DMD} -O -release -inline -ofbin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} + rm -f bin/dscanner.o gdcbuild: - ${GDC} -O3 -frelease -odscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} + ${GDC} -O3 -frelease -obin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} ldcbuild: - ${LDC} -O5 -release -oq -of=dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} + ${LDC} -O5 -release -oq -of=bin/dscanner ${VERSIONS} ${INCLUDE_PATHS} ${SRC} test: @./test.sh clean: + rm -rf dsc dsc.o rm -rf bin + rm -f dscanner-report.json report: all dscanner --report src > dscanner-report.json diff --git a/src/analysis/run.d b/src/analysis/run.d index edebbf2..08a615c 100644 --- a/src/analysis/run.d +++ b/src/analysis/run.d @@ -93,7 +93,7 @@ void analyze(string[] fileNames, StaticAnalysisConfig config, writeJSON(result.key, result.fileName, result.line, result.column, result.message); } } - else + else if (results !is null) { foreach (result; results[]) writefln("%s(%d:%d)[warn]: %s", result.fileName, result.line, diff --git a/test.sh b/test.sh index 7325f67..cdf5dd0 100755 --- a/test.sh +++ b/test.sh @@ -3,13 +3,14 @@ rm -f test rm -f test.o dmd\ - *.d\ + src/*.d\ libdparse/src/std/*.d\ libdparse/src/std/d/*.d\ inifiled/source/*.d\ - analysis/*.d\ + src/analysis/*.d\ -oftest\ -g -unittest ./test +rm -f test test.o