mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-11-16 12:34:34 +00:00
Reworked scripts/pretty_asserts.py a bit
- Renamed explode_asserts.py -> pretty_asserts.py, this name is
hopefully a bit more descriptive
- Small cleanup of the parser rules
- Added recognization of memcmp/strcmp => 0 statements and generate
the relevant memory inspecting assert messages
I attempted to fix the incorrect column numbers for the generated
asserts, but unfortunately this didn't go anywhere and I don't think
it's actually possible.
There is no column control analogous to the #line directive. I thought
you might be able to intermix #line directives to put arguments at the
right column like so:
assert(a == b);
__PRETTY_ASSERT_INT_EQ(
#line 1
a,
#line 1
b);
But this doesn't work as preprocessor directives are not allowed in
macros arguments in standard C. Unfortunately this is probably not
possible to fix without better support in the language.
This commit is contained in:
4
Makefile
4
Makefile
@@ -175,10 +175,10 @@ $(BUILDDIR)%.s: %.c
|
||||
$(CC) -S $(CFLAGS) $< -o $@
|
||||
|
||||
$(BUILDDIR)%.a.c: %.c
|
||||
./scripts/explode_asserts.py $< -o $@
|
||||
./scripts/pretty_asserts.py -p LFS_ASSERT $< -o $@
|
||||
|
||||
$(BUILDDIR)%.a.c: $(BUILDDIR)%.c
|
||||
./scripts/explode_asserts.py $< -o $@
|
||||
./scripts/pretty_asserts.py -p LFS_ASSERT $< -o $@
|
||||
|
||||
$(BUILDDIR)%.t.c: %.toml
|
||||
./scripts/test.py -c $< $(TESTCFLAGS) -o $@
|
||||
|
||||
Reference in New Issue
Block a user