2012-05-21 04:12:37 -07:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2008-02-27 08:28:13 -08:00
|
|
|
|
2008-05-05 11:32:31 -07:00
|
|
|
OUTPARAMS_WARNING_TESTCASES = \
|
2008-04-30 17:47:27 -07:00
|
|
|
e1.cpp \
|
|
|
|
e4.cpp \
|
|
|
|
e6.cpp \
|
|
|
|
e7.cpp \
|
|
|
|
e8.cpp \
|
|
|
|
e9.cpp \
|
|
|
|
e10.cpp \
|
|
|
|
e11.cpp \
|
2008-05-20 11:26:03 -07:00
|
|
|
e12.cpp \
|
|
|
|
e13.cpp \
|
2008-04-30 17:47:27 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2008-12-09 14:34:48 -08:00
|
|
|
OUTPARAMS_NS_FAILED_TESTCASES = \
|
|
|
|
e2.cpp \
|
|
|
|
e5.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
2008-04-30 17:47:27 -07:00
|
|
|
OUTPARAMS_PASS_TESTCASES = \
|
|
|
|
o1.cpp \
|
|
|
|
o2.cpp \
|
|
|
|
o3.cpp \
|
|
|
|
o4.cpp \
|
|
|
|
o5.cpp \
|
|
|
|
o6.cpp \
|
|
|
|
o7.cpp \
|
|
|
|
o8.cpp \
|
|
|
|
o9.cpp \
|
|
|
|
o10.cpp \
|
2008-05-02 18:03:38 -07:00
|
|
|
o11.cpp \
|
2008-05-20 11:26:03 -07:00
|
|
|
o12.cpp \
|
|
|
|
o13.cpp \
|
2008-07-01 14:22:49 -07:00
|
|
|
o14.cpp \
|
2008-07-01 14:24:58 -07:00
|
|
|
o15.cpp \
|
2008-07-09 10:35:29 -07:00
|
|
|
o16.cpp \
|
2008-08-19 11:17:13 -07:00
|
|
|
onull.cpp \
|
|
|
|
onull2.cpp \
|
2009-02-24 07:11:06 -08:00
|
|
|
opmember.cpp \
|
2008-04-30 17:47:27 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2008-09-08 11:01:22 -07:00
|
|
|
FLOW_PASS_TESTCASES = \
|
|
|
|
flow_through_pass.cpp
|
|
|
|
|
|
|
|
FLOW_FAILURE_TESTCASES = \
|
|
|
|
flow_through_fail.cpp
|
|
|
|
|
2009-09-18 10:26:13 -07:00
|
|
|
MUST_OVERRIDE_PASS_TESTCASES = \
|
|
|
|
OverrideOK1.cpp \
|
|
|
|
OverrideOK2.cpp \
|
2010-08-18 18:06:05 -07:00
|
|
|
OverrideOK3-NamespaceTypedef.cpp \
|
2009-09-18 10:26:13 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
MUST_OVERRIDE_FAILURE_TESTCASES = \
|
|
|
|
OverrideFail1.cpp \
|
|
|
|
OverrideFail2.cpp \
|
|
|
|
OverrideFail3.cpp \
|
|
|
|
OverrideFail4.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
2009-09-04 08:21:31 -07:00
|
|
|
OVERRIDE_PASS_TESTCASES = \
|
|
|
|
override-pass.cpp \
|
2010-08-18 18:06:05 -07:00
|
|
|
override-namespace-typedef.cpp \
|
2009-09-04 08:21:31 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
OVERRIDE_FAILURE_TESTCASES = \
|
|
|
|
override-global.cpp \
|
|
|
|
override-signature.cpp \
|
|
|
|
override-static.cpp \
|
|
|
|
override-virtual.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
2010-08-18 18:04:39 -07:00
|
|
|
STATIC_INIT_PASS_TESTCASES = \
|
|
|
|
TestStaticInitStructOK.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
STATIC_INIT_WARNING_TESTCASES = \
|
|
|
|
TestStaticInitAttr.cpp \
|
|
|
|
TestStaticInitConstructor.cpp \
|
|
|
|
TestStaticInitGlobal.cpp \
|
|
|
|
TestStaticInitGlobalConst.cpp \
|
|
|
|
$(NULL)
|
|
|
|
|
2008-05-05 11:32:31 -07:00
|
|
|
STATIC_FAILURE_TESTCASES = \
|
2009-09-18 10:26:13 -07:00
|
|
|
$(FLOW_FAILURE_TESTCASES) \
|
|
|
|
$(MUST_OVERRIDE_FAILURE_TESTCASES) \
|
2009-09-04 08:21:31 -07:00
|
|
|
$(OVERRIDE_FAILURE_TESTCASES) \
|
2008-05-05 11:32:31 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
STATIC_WARNING_TESTCASES = \
|
|
|
|
$(OUTPARAMS_WARNING_TESTCASES) \
|
2010-08-18 18:04:39 -07:00
|
|
|
$(STATIC_INIT_WARNING_TESTCASES) \
|
2008-05-05 11:32:31 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
STATIC_PASS_TESTCASES = \
|
2008-12-09 14:34:48 -08:00
|
|
|
$(OUTPARAMS_NS_FAILED_TESTCASES) \
|
2008-05-05 11:32:31 -07:00
|
|
|
$(OUTPARAMS_PASS_TESTCASES) \
|
2008-09-08 11:01:22 -07:00
|
|
|
$(FLOW_PASS_TESTCASES) \
|
2009-09-18 10:26:13 -07:00
|
|
|
$(MUST_OVERRIDE_PASS_TESTCASES) \
|
2009-09-04 08:21:31 -07:00
|
|
|
$(OVERRIDE_PASS_TESTCASES) \
|
2010-08-18 18:04:39 -07:00
|
|
|
$(STATIC_INIT_PASS_TESTCASES) \
|
2008-05-05 11:32:31 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2008-12-03 08:49:54 -08:00
|
|
|
|
2008-02-27 08:28:13 -08:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
|
|
|
# We want to compile each file and invert the result to ensure that
|
|
|
|
# compilation failed.
|
2008-05-05 11:32:31 -07:00
|
|
|
check:: \
|
|
|
|
$(STATIC_FAILURE_TESTCASES:.cpp=.s-fail) \
|
|
|
|
$(STATIC_WARNING_TESTCASES:.cpp=.s-warn) \
|
|
|
|
$(STATIC_PASS_TESTCASES:.cpp=.s-pass)
|
2008-02-27 08:28:13 -08:00
|
|
|
|
2012-09-11 00:43:32 -07:00
|
|
|
%.s-fail: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS) $(call mkdir_deps,$(MDDEPDIR))
|
2013-12-02 13:34:21 -08:00
|
|
|
@printf 'Compiling $(<F) to check that the static-analysis script is checking properly...'
|
2008-05-05 11:32:31 -07:00
|
|
|
@if $(CCC) $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'fail:\nerror: compilation of $(<F) succeeded. It shouldn't have!\n'; \
|
2008-02-27 08:28:13 -08:00
|
|
|
exit 1; \
|
|
|
|
else \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'ok.\n'; \
|
2008-02-27 08:28:13 -08:00
|
|
|
fi
|
2008-04-30 17:47:27 -07:00
|
|
|
|
2012-09-11 00:43:32 -07:00
|
|
|
%.s-warn: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS) $(call mkdir_deps,$(MDDEPDIR))
|
2013-12-02 13:34:21 -08:00
|
|
|
@printf 'Compiling $(<F) to check that the static-analysis script is checking properly...'
|
2008-05-05 11:32:31 -07:00
|
|
|
@if $(CCC) -Werror $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'fail:\nerror: compilation of $(<F) succeeded with -Werror. It shouldn't have!\n'; \
|
2008-05-05 11:32:31 -07:00
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
@if $(CCC) $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).werrlog 2>&1; then \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'ok.\n'; \
|
2008-05-05 11:32:31 -07:00
|
|
|
else \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'fail:\nerror: compilation of $(<F) without -Werror failed. A warning should have been issued.\n'; \
|
2008-05-05 11:32:31 -07:00
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
|
2012-09-11 00:43:32 -07:00
|
|
|
%.s-pass: %.cpp $(GLOBAL_DEPS) $(DEHYDRA_SCRIPTS) $(call mkdir_deps,$(MDDEPDIR))
|
2013-12-02 13:34:21 -08:00
|
|
|
@printf 'Compiling $(<F) to check that the static-analysis script is checking properly...'
|
2008-05-05 11:32:31 -07:00
|
|
|
@if $(CCC) -Werror $(OUTOPTION)/dev/null -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) >$(*F).errlog 2>&1; then \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'ok.\n'; \
|
2008-04-30 17:47:27 -07:00
|
|
|
else \
|
2013-12-02 13:34:21 -08:00
|
|
|
printf 'fail:\nerror: compilation of $(<F) failed. It shouldn't have!\n'; \
|
2008-04-30 17:47:27 -07:00
|
|
|
exit 1; \
|
|
|
|
fi
|