Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Christian Holler 8e72e4cc2f Bug 1431090 - Prepare tools/fuzzing/ to be used with JS_STANDALONE. r=froydnj
This patch adjusts tools/fuzzing/ in such a way that the relevant parts can be
reused in the JS engine. Changes in detail include:

* Various JS_STANDALONE checks to exclude parts that cannot be included in
  those builds.

* Turn LibFuzzerRegistry and LibFuzzerRunner into generic FuzzerRegistry and
  FuzzerRunner classes and use them for AFL as well. Previously, AFL was
  piggy-backing on gtests which was kind of an ugly solution anyway (besides
  that it can't work in JS). Now more code like registry and harness is
  shared between the two and they follow almost the same call paths and entry
  points. AFL macros in FuzzingInterface have been rewritten accordingly.
  This also required name changes in various places. Furthermore, this unifies
  the way, the fuzzing target is selected, using the FUZZER environment
  variable rather than LIBFUZZER (using LIBFUZZER in browser builds will give
  you a deprecation warning because I know some people are using this already
  and need time to switch). Previously, AFL target had to be selected using
  GTEST_FILTER, so this is also much better now.

* I had to split up FuzzingInterface* such that the STREAM parts are in a
  separate set of files FuzzingInterfaceStream* because they use nsStringStream
  which is not allowed to be included into the JS engine even in a full browser
  build (error: "Using XPCOM strings is limited to code linked into libxul.").
  I also had to pull FuzzingInterface.cpp (the RAW part only) into the header
  and make it static because otherwise, would have to make not only separate
  files but also separate libraries to statically link to the JS engine, which
  seemed overkill for a single small function. The streaming equivalent of the
  function is still in a cpp file.

* LibFuzzerRegister functions are now unique by appending the module name to
  avoid redefinition errors.

MozReview-Commit-ID: 44zWCdglnHr

--HG--
extra : rebase_source : fe07c557032fd33257eb701190becfaf85ab79d0
2018-01-17 15:20:35 +01:00
Coroiu Cristina faa2f8c7da Backed out 2 changesets (bug 1431090) for Bf bustage at src/tools/fuzzing/interface/harness/FuzzerTestHarness.h
Backed out changeset 2e98bda3f397 (bug 1431090)
Backed out changeset eb6acc9e44ad (bug 1431090)

--HG--
rename : tools/fuzzing/registry/FuzzerRegistry.cpp => tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.cpp
rename : tools/fuzzing/registry/FuzzerRegistry.h => tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.h
rename : tools/fuzzing/interface/harness/FuzzerRunner.cpp => tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.cpp
rename : tools/fuzzing/interface/harness/FuzzerRunner.h => tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.h
rename : tools/fuzzing/interface/harness/FuzzerTestHarness.h => tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h
rename : tools/fuzzing/interface/harness/moz.build => tools/fuzzing/libfuzzer/harness/moz.build
2018-01-23 13:49:26 +02:00
Christian Holler 4ce6f81fee Bug 1431090 - Prepare tools/fuzzing/ to be used with JS_STANDALONE. r=froydnj
This patch adjusts tools/fuzzing/ in such a way that the relevant parts can be
reused in the JS engine. Changes in detail include:

* Various JS_STANDALONE checks to exclude parts that cannot be included in
  those builds.

* Turn LibFuzzerRegistry and LibFuzzerRunner into generic FuzzerRegistry and
  FuzzerRunner classes and use them for AFL as well. Previously, AFL was
  piggy-backing on gtests which was kind of an ugly solution anyway (besides
  that it can't work in JS). Now more code like registry and harness is
  shared between the two and they follow almost the same call paths and entry
  points. AFL macros in FuzzingInterface have been rewritten accordingly.
  This also required name changes in various places. Furthermore, this unifies
  the way, the fuzzing target is selected, using the FUZZER environment
  variable rather than LIBFUZZER (using LIBFUZZER in browser builds will give
  you a deprecation warning because I know some people are using this already
  and need time to switch). Previously, AFL target had to be selected using
  GTEST_FILTER, so this is also much better now.

* I had to split up FuzzingInterface* such that the STREAM parts are in a
  separate set of files FuzzingInterfaceStream* because they use nsStringStream
  which is not allowed to be included into the JS engine even in a full browser
  build (error: "Using XPCOM strings is limited to code linked into libxul.").
  I also had to pull FuzzingInterface.cpp (the RAW part only) into the header
  and make it static because otherwise, would have to make not only separate
  files but also separate libraries to statically link to the JS engine, which
  seemed overkill for a single small function. The streaming equivalent of the
  function is still in a cpp file.

* LibFuzzerRegister functions are now unique by appending the module name to
  avoid redefinition errors.

MozReview-Commit-ID: 44zWCdglnHr

--HG--
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.cpp => tools/fuzzing/interface/harness/FuzzerRunner.cpp
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRunner.h => tools/fuzzing/interface/harness/FuzzerRunner.h
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerTestHarness.h => tools/fuzzing/interface/harness/FuzzerTestHarness.h
rename : tools/fuzzing/libfuzzer/harness/moz.build => tools/fuzzing/interface/harness/moz.build
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.cpp => tools/fuzzing/registry/FuzzerRegistry.cpp
rename : tools/fuzzing/libfuzzer/harness/LibFuzzerRegistry.h => tools/fuzzing/registry/FuzzerRegistry.h
extra : rebase_source : 7d0511ca0591dbf4d099376011402e063a79ee3b
2018-01-17 15:20:35 +01:00