Jules Villard
b964f6ab74
[CLI] options to unset default checkers and to print active checkers
...
Summary:
Demo:
```
$ infer -a checkers --print-active-checkers
Found 1 source file to analyze in /home/jul/infer/infer-out
Active checkers: annotation reachability, fragment retains view, immutable cast, printf args, quandary, SIOF, thread safety
Starting analysis...
[...]
$ infer -a checkers --print-active-checkers --no-default-checkers
Found 1 source file to analyze in /home/jul/infer/infer-out
Active checkers: none
[...]
$ infer -a checkers --print-active-checkers --no-default-checkers --bufferoverrun
Found 1 source file to analyze in /home/jul/infer/infer-out
Active checkers: buffer overrun
[...]
$ infer -a checkers --print-active-checkers --no-default-checkers --bufferoverrun --default-checkers --biabduction --no-siof
Found 1 source file to analyze in /home/jul/infer/infer-out
Active checkers: annotation reachability, biabduction, buffer overrun, fragment retains view, immutable cast, printf args, quandary, thread safety
[...]
```
Reviewed By: jeremydubreil
Differential Revision: D5095657
fbshipit-source-id: 8043b00
8 years ago
Jules Villard
724a592c34
[toplevel] do not read inferconfig location from the command line
...
Summary:
Try to read .inferconfig in the current directory, then in .., then in ../..,
etc. This can be overriden with the `INFERCONFIG` environment variable.
This removes the need for two-phase parsing, so clean up that code too.
Paths in .inferconfig are interpreted relative to where .inferconfig is located.
This does not apply to other path-sensitive things like regexpes... this is not
a show stopper because regexpes can account for the fact that infer may be
called from different project roots.
Make sure we fail when .inferconfig exists but cannot be read.
Reviewed By: jberdine
Differential Revision: D4843142
fbshipit-source-id: 340a63f
8 years ago
Jules Villard
3ab6c43fb6
[tests] awesomize make output
...
Summary:
Hide the output of all the toplevel `make` actions and print messages instead, as if we had a better build system than Makefiles. When a command fails, print its stdout and stderr and prefix it with bold red letters. Also display timing information.
```
$ make -j 4 test
[17:39:18][27290] Facebook setup...
[17:39:18][27363] Building checkCopyright...
[17:39:18][27443] Validating facebook/...
[ 0s][27363] SUCCESS Building checkCopyright
[ 0s][27290] SUCCESS Facebook setup
[17:39:18][27863] Building clang plugin...
[ 0s][27443] SUCCESS Validating facebook/
[ 0s][27863] SUCCESS Building clang plugin
[17:39:18][27898] Building clang plugin OCaml interface...
[ 0s][27898] SUCCESS Building clang plugin OCaml interface
[17:39:18][27974] Testing Infer builds without warnings...
[17:39:18][28033] Building native Infer...
[ 12s][27974] SUCCESS Testing Infer builds without warnings
[17:39:30][28998] Testing Infer toplevel builds...
[ 6s][28998] SUCCESS Testing Infer toplevel builds
[17:39:36][31417] Running OCaml unit tests...
[17:39:36][31456] Testing infer OCaml REPL...
[ 6s][31417] SUCCESS Running OCaml unit tests
[ 9s][31456] SUCCESS Testing infer OCaml REPL
[ 92s][28033] SUCCESS Building native Infer
[17:40:50][ 2170] Building Java annotations...
[ 0s][ 2170] SUCCESS Building Java annotations
[17:40:50][ 2186] Building Infer models...
[ 11s][ 2186] SUCCESS Building Infer models
[17:41:01][ 2803] Running build assembly test...
[17:41:01][ 2861] Running build ck analytics test...
[17:41:01][ 2941] Running build ck imports test...
[17:41:01][ 3035] Running build clang compilation db escaped test...
[ 1s][ 3035] SUCCESS Running build clang compilation db escaped test
[17:41:02][ 3139] Running build clang compilation db relpath test...
[ 3s][ 2861] SUCCESS Running build ck analytics test
[17:41:04][ 3296] Running build clang multiple files test...
[*ERROR**][2803] *** ERROR Running build assembly test
[*ERROR**][2803] *** command: ( make INTERACTIVE=1 -C /home/jul/infer/infer/tests/build_systems/assembly test 2> >(grep -v warning: (ignoring old|overriding) (commands|recipe) for target) ; exit 0)
[*ERROR**][2803] *** CWD: /home/jul/infer
[*ERROR**][2803] *** stdout:
[*ERROR**][2803] make[1]: Entering directory '/home/jul/infer/infer/tests/build_systems/assembly'
[*ERROR**][2803] *** inner Testing infer/clang in build_systems/assembly
[*ERROR**][2803] *** inner command: /home/jul/infer/infer/bin/infer --results-dir infer-out --dump-duplicate-symbols --report-custom-error --developer-mode --project-root ../codetoanalyze --no-failures-allowed -a infer -- clang -c ../codetoanalyze/example.S ../codetoanalyze/hello.c
[*ERROR**][2803] *** inner CWD: /home/jul/infer/infer/tests/build_systems/assembly
[*ERROR**][2803] Capturing in make/cc mode...
[*ERROR**][2803] Starting analysis...
[*ERROR**][2803]
[*ERROR**][2803] legend:
[*ERROR**][2803] "F" analyzing a file
[*ERROR**][2803] "." analyzing a procedure
[*ERROR**][2803]
[*ERROR**][2803] Found 1 (out of 1) source files to be analyzed in /home/jul/infer/infer/tests/build_systems/assembly/infer-out
[*ERROR**][2803]
[*ERROR**][2803]
[*ERROR**][2803] No issues found
[*ERROR**][2803]
[*ERROR**][2803] ../../infer.make:30: recipe for target 'test' failed
[*ERROR**][2803] make[1]: Leaving directory '/home/jul/infer/infer/tests/build_systems/assembly'
[*ERROR**][2803] F.--- build_systems/assembly/issues.exp 2017-03-22 16:25:44.583854270 +0000
[*ERROR**][2803] +++ build_systems/assembly/issues.exp.test 2017-03-28 17:41:04.743678254 +0100
[*ERROR**][2803] @@ -1 +0,0 @@
[*ERROR**][2803] -hello.c, test, 2, NULL_DEREFERENCE, [start of procedure test()]
[*ERROR**][2803]
[*ERROR**][2803] Test output (build_systems/assembly/issues.exp.test) differs from expected test output build_systems/assembly/issues.exp
[*ERROR**][2803] Run the following command to replace the expected test output with the new output:
[*ERROR**][2803]
[*ERROR**][2803] make -C build_systems/assembly replace
[*ERROR**][2803]
[*ERROR**][2803] make[1]: *** [test] Error 1
[*ERROR**][2803] *** stderr:
Makefile:230: recipe for target 'build_assembly_test' failed
make: *** [build_assembly_test] Error 1
make: *** Waiting for unfinished jobs....
[...]
```
Reviewed By: jberdine
Differential Revision: D4781857
fbshipit-source-id: cbce26d
8 years ago
Jules Villard
dac8906d86
[make] make sure makefile uses config-time values
...
Summary:
This makes sure that one can run `./build-infer.sh` then `make`. Otherwise it's
not always clear what one should do to recompile infer, eg when `make` will
work and when `./build-infer.sh` should be used instead, in particular when the
user doesn't have opam configured for her terminal.
Reviewed By: jberdine
Differential Revision: D4698159
fbshipit-source-id: 5df8059
8 years ago
Jules Villard
de8356e4b0
[tests] move javac test to a Makefile
...
Reviewed By: jberdine
Differential Revision: D4329635
fbshipit-source-id: 143ea87
8 years ago
Jules Villard
a6be58848b
[make] make frontend tests more functional
...
Summary: These direct tests were still mostly relying on PHONY targets.
Reviewed By: jberdine
Differential Revision: D4326469
fbshipit-source-id: 37b2d0a
8 years ago
Andrzej Kotulski
b6b7593cf6
[tests] Make project root infer/test/ for java tests
...
Summary: Run all java tests with project-root at `infer/tests`. Do it to keep things consistent between clang and java tests
Reviewed By: sblackshear
Differential Revision: D4233236
fbshipit-source-id: c3f24fd
8 years ago
Jules Villard
70720798d8
[tests] share javac.make more broadly
...
Summary:
- rename java.make -> javac.make, config.make -> java.make, and move to infer/tests/ so it's easier to use from infer/tests/build_systems/
- use these from ant's test Makefile, much code reuse!
- factor out common functionality between java and clang
A wrinkle: sorting is now done the same way for --issues-tests and
--issues-txt, which produces bogus (but still as deterministic) sorting for
--issues-txt. This is more of a cosmetic issue, but I hope to fix it in a later
diff that gets rid of calls to `sort` in favour of sorting directly from
`InferPrint`.
Reviewed By: jberdine
Differential Revision: D4166841
fbshipit-source-id: ed6f232
8 years ago