GN requires all actions to have at least one output file. However, many
Python scripts are run to process data without generating a file. Such
scripts would previously have to specify a dummy output file and touch
it on completion.
This change adds this stamp functionality to the script-runner script.
The pw_python_script template accepts a boolean "stamp" argument. If
set, the runner will touch a dummy file after it runs its sub-command.
Change-Id: Iff0408ea0d93007418a1766f1eb7ed7b30ec6913
This change adds a pw_python_script GN template which defines an action
to run a Python script through a script-runner script. This runner is
responsible for resolving any GN paths to filesystem paths, and finding
output binaries for compiled targets. This allows writing Python scripts
which are ignorant of the GN build system and work only with filesystem
paths.
The unit test runner script is updated to use the new runner template.
Change-Id: I132bb620af2bb1e57e9278fac57b676f8ab5a415
This change makes the default toolchain for the build system an
argument so that it can be configured per build target.
Change-Id: I32822be9a6e33376bb1e75b996f79d3451ef9963
This makes two tweaks to enable compiling with Clang on the desktop:
- Switch from (&function_pointer) to (*function_pointer) style.
- Make destructor final in derived test class to prevent warning from
the "-Wdelete-non-abstract-non-virtual-dtor" flag.
Change-Id: Ic1783e41ee8092a5ad218ebdb48376742f85ff50
This change adds a GN template for defining unit test executables.
The template, called pw_test, defines the executable and outputs a JSON
metadata file for the test.
A new build argument is added. This argument determines whether unit
test run targets are supported by the current build target. If this is
set, the pw_test template additionally creates a run target for its test
executable which invokes the executable through a script.
A basic test runner script is added to the pw_unit_test module. This
script currently only runs a single test executable directly.
The unit tests in the pw_preprocessor module are updated to use the
pw_test template.
Change-Id: I3cbde9c19440276dbab80dd2bab5fec87abe6d7e
- Add -fdiagnostics-color so that compiler warnings are colorized. The
way Ninja invokes GCC disables colors by default.
- Move -Wno-psabi up to the arm_gcc_toolchain template so that it
doesn't have to be specified for each arm_gcc_toolchain instance.
- Add -Werror to the strict_warnings config to prevent warnings from
slipping through. Exempt a few warnings that should actually be
warnings.
Change-Id: I8656d6690b488f7b004f15abd7100b62e1945cfd
This makes these changes to the unit test framework:
(1) Makes the simple test runner output match GTest
(2) Adds a new RunAllTestsStart() and RunAllTestsEnd() event
(3) Adds an intentionally-failing expectation to the sample test
Example output:
[==========] Running all tests.
[ RUN ] PigweedTest.ExpectBool
[ OK ] PigweedTest.ExpectBool
[ RUN ] PigweedTest.ExpectBasicComparisons
[ OK ] PigweedTest.ExpectBasicComparisons
[ RUN ] PigweedTest.ExpectStringEquality
[ OK ] PigweedTest.ExpectStringEquality
[ RUN ] PigweedTest.NonCopyableType
[ OK ] PigweedTest.NonCopyableType
[ RUN ] PigweedTest.MacroArgumentsOnlyAreEvaluatedOnce
[ OK ] PigweedTest.MacroArgumentsOnlyAreEvaluatedOnce
[ RUN ] FixtureTest.CustomFixture
[ OK ] FixtureTest.CustomFixture
[ RUN ] PigweedTestFixture.TheNumberIs35
[ OK ] PigweedTestFixture.TheNumberIs35
[ RUN ] PigweedTestFixture.YupTheNumberIs35
[ OK ] PigweedTestFixture.YupTheNumberIs35
[ RUN ] PigweedTestFixture.MissingExpectations
../pw_unit_test/framework_test.cc:156: Failure
Expected: missed_expectations == 200
[ FAILED ] PigweedTestFixture.MissingExpectations
[==========] Done running all tests.
[ PASSED ] 8 test(s).
[ FAILED ] 1 test(s).
Change-Id: I813096a9d62423e256993ae03724337d52702297
This change adds two Pigweed modules: pw_preprocessor and pw_unit_test.
The preprocessor module contains header files providing helpful macros
for the C preprocessor. The unit test module contains a starter
implementation of a unit testing framework for Pigweed.
Change-Id: I46e1a4cae1fd8ce36d7840a2e92f8013fb489cde
This change adds Pigweed's first few (incomplete) modules: pw_build,
pw_status, and pw_toolchain. The main scaffolding for Pigweed's GN-based
build system is also included, with a root BUILDCONFIG and BUILD.gn file
defining a top-level modules build target.
Change-Id: I09599443d50696343d6c5b85853cb5cee3ce0026