@ -26,15 +26,15 @@ endif
DIRECT_TESTS =
i f e q ( $( BUILD_C_ANALYZERS ) , y e s )
DIRECT_TESTS += c_errors_test c_frontend_test cpp_checkers_test cpp_errors_test cpp_frontend_test cpp_quandary_test
DIRECT_TESTS += c_errors c_frontend cpp_checkers cpp_errors cpp_frontend cpp_quandary
e n d i f
i f e q ( $( BUILD_JAVA_ANALYZERS ) , y e s )
DIRECT_TESTS += \
java_checkers_test java_eradicate_test java_infer_test java_tracing_test \
java_quandary_test java_threadsafety_test java_ crashcontext_test java_harness_test
java_checkers java_eradicate java_infer java_tracing java_quandary java _thr ead safe ty \
java_crashcontext java_harness
e n d i f
i f n e q ( $( XCODE_SELECT ) , n o )
DIRECT_TESTS += objc_frontend_test objc_errors_test objc_linters_test objcpp_frontend_test objcpp_linters_test
DIRECT_TESTS += objc_frontend objc_errors objc_linters objcpp_frontend objcpp_linters
e n d i f
.PHONY : all
@ -95,58 +95,49 @@ endif
ocaml_unit_test : test_build
$( call silent_on_success,$( TEST_BUILD_DIR) /unit/inferunit.byte)
DIRECT_TESTS_REPLACE = $( patsubst %_frontend_test,%_frontend_replace,$( filter %_frontend_test,$( DIRECT_TESTS) ) )
DIRECT_TESTS_REPLACE = $( patsubst %_frontend,%_frontend_replace,$( filter %_frontend,$( DIRECT_TESTS) ) )
d e f i n e s i l e n c e _ m a k e
( $( 1) 2> >( grep -v "warning: \(ignoring old\|overriding\) \(commands\|recipe\) for target" ) \
; exit $$ { PIPESTATUS[ 0] } )
e n d e f
.PHONY : frontend_replace
frontend_replace : $( DIRECT_TESTS_REPLACE )
d e f i n e g e n _ d i r e c t _ t e s t _ r u l e
.PHONY : $( 1)
$(1) : infer
( $( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $( 1) | cut -f 1 -d _) /$( shell printf $( 1) | cut -f 2 -d _) \
test \
3>& 1 1>& 2- 2>& 3- ) \
| grep -v "warning: ignoring old commands for target" \
| grep -v "warning: overriding commands for target" \
; exit $$ $$ { PIPESTATUS[ 0] }
.PHONY : $( 1) _clean
$(1)_clean :
@$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $( 1) | cut -f 1 -d _) /$( shell printf $( 1) | cut -f 2 -d _) \
clean
e n d e f
.PHONY : $( DIRECT_TESTS :%=direct_ %_test )
$(DIRECT_TESTS : %=direct_ %_test ): infer
@$( call silence_make,\
$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $@ | cut -f 2 -d _) /$( shell printf $@ | cut -f 3 -d _) \
test )
$( foreach test ,$ ( DIRECT_TESTS ) $ ( DIRECT_TESTS_REPLACE ) ,\
$( eval \
$( call gen_direct_test_rule,$( test ) ) ) )
.PHONY : $( DIRECT_TESTS :%=direct_ %_clean )
$(DIRECT_TESTS : %=direct_ %_clean ):
@$( call silence_make,\
$( MAKE) -C \
$( INFER_DIR) /tests/codetoanalyze/$( shell printf $@ | cut -f 2 -d _) /$( shell printf $@ | cut -f 3 -d _) \
clean)
.PHONY : direct_tests
direct_tests : $( DIRECT_TESTS )
d e f i n e g e n _ b u i l d _ s y s t e m _ t e s t _ r u l e
.PHONY : build_ $( 1) _test
build_$(1)_test : infer
@( $( MAKE) -C $( INFER_DIR) /tests/build_systems/$( 1) test \
3>& 1 1>& 2- 2>& 3- ) \
| grep -v "warning: ignoring old commands for target" \
| grep -v "warning: overriding commands for target" \
; exit $$ $$ { PIPESTATUS[ 0] }
.PHONY : build_ $( 1) _clean
build_$(1)_clean :
@$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( 1) clean
e n d e f
direct_tests : $( DIRECT_TESTS :%=direct_ %_test )
.PHONY : $( BUILD_SYSTEMS_TESTS :%=build_ %_test )
$(BUILD_SYSTEMS_TESTS : %=build_ %_test ): infer
@$( call silence_make,\
$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( patsubst build_%_test,%,$@ ) test )
$( foreach test ,$ ( BUILD_SYSTEMS_TESTS ) , $ ( eval $ ( call gen_build_system_test_rule ,$ ( test ) ) ) )
.PHONY : $( BUILD_SYSTEMS_TESTS :%=build_ %_clean )
$(BUILD_SYSTEMS_TESTS : %=build_ %_clean ):
@$( call silence_make,\
$( MAKE) -C $( INFER_DIR) /tests/build_systems/$( patsubst build_%_clean,%,$@ ) clean)
.PHONY : build_systems_tests
build_systems_tests : infer $( foreach test ,$ ( BUILD_SYSTEMS_TESTS ) ,build_ $ ( test ) _test )
build_systems_tests : infer $( BUILD_SYSTEMS_TESTS :%=build_ %_test )
NO_BUCKD = 1 $( INFER_DIR) /tests/build_systems/build_integration_tests.py
.PHONY : buck _test
buck _test: direct_tests build_systems_tests
.PHONY : endtoend _test
endtoend _test: direct_tests build_systems_tests
.PHONY : inferTraceBugs_test
inferTraceBugs_test : infer
@ -182,16 +173,12 @@ inferScriptMode_test: test_build
checkCopyright :
@$( MAKE) -C $( SRC_DIR) checkCopyright
.PHONY : run -test
run-test : test_build ocaml_unit_test buck_test inferTraceBugs_test inferScriptMode_test checkCopyright
$( MAKE) -C $( SRC_DIR) mod_dep.dot
.PHONY : test
test :
test : test_build ocaml_unit_test endtoend_test inferTraceBugs_test inferScriptMode_test \
checkCopyright
@$( MAKE) -C $( SRC_DIR) mod_dep.dot
i f e q ( , $( findstring s ,$ ( MAKEFLAGS ) ) )
@$( MAKE) run-test && echo "ALL TESTS PASSED"
e l s e
@$( MAKE) run-test
@echo "ALL TESTS PASSED"
e n d i f
.PHONY : quick -test
@ -199,7 +186,7 @@ quick-test: test_build ocaml_unit_test
.PHONY : test -replace
test-replace :
@$( MAKE) -k run- test || true
@$( MAKE) -k endtoend_ test || true
@for file in $$ ( find $( INFER_DIR) /tests -name "*.exp.test" ) ; do \
mv -f $$ file $$ ( dirname $$ file) /$$ ( basename -s .exp.test $$ file) .exp; done
@for file in $$ ( find $( INFER_DIR) /tests -name "*.test.dot" ) ; do \
@ -213,8 +200,7 @@ uninstall:
$( REMOVE) $( DESTDIR) $( bindir) /infer
.PHONY : test_clean
test_clean : $( foreach test ,$ ( DIRECT_TESTS ) ,$ ( test ) _clean ) \
$( foreach test,$( BUILD_SYSTEMS_TESTS) ,build_$( test ) _clean)
test_clean : $( DIRECT_TESTS :%=direct_ %_clean ) $( BUILD_SYSTEMS_TESTS :%=build_ %_clean )
.PHONY : install
install : infer