Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Add makefile_test.py, to verify make in all build-modes. #19

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

gapisback
Copy link
Member

Previous commit that introduced support for building with LOC-ELF encoding scheme (i.e, SHA f7e7b10) is only exercising building with the LOC-ELF encoding scheme for a very simple unit-test, unit/single_file_elf_src/single_file_prog_elf_test.c

We need a better way to trigger either the default LOC-encoding or the LOC-ELF encoding technique. The approach chosen, to be implemented in subsequent commits, is to flag-off of an env-var, LOC_ENABLED={1,2}.

Default mode, with this env-var unset is to use default LOC-encoding.

This commit adds a collection of make build-mode pytest cases to exercise make with diff env-variables, such as:

    # Default build mode, using Python generator.
 1. $ make

    # Default LOC-encoding, using Python generator.
 2. $ LOC_ENABLED=1 make ...

    # LOC-ELF encoding, w/o using Python generator.
 3. $ LOC_ENABLED=2 make ...

The test cases carefully verify that:

a) The required files are generated in the expected sub-dirs for (1) and (2)

b) The Python generator is not invoked for (3), i.e., no generated files
are found after the make completes. The sources compile because the provided src/loc.c and include/loc.h are used to build all the sample / unit-test programs.

Some of these test cases are failing so are currently skipped with this commit. Future changes will be applied to fix the make build rules issues, enabling failing tests.

run-tests: run-unit-tests run-test-code
./test.sh
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this, otherwise, test.sh will invoke the newly added makefile_test.py, leading to endless recursion in these testing cycles.

Previous commit that introduced support for building with LOC-ELF
encoding scheme (i.e, SHA f7e7b10) is only exercising building
with the LOC-ELF encoding scheme for a very simple unit-test,
unit/single_file_elf_src/single_file_prog_elf_test.c

We need a better way to trigger either the default LOC-encoding
or the LOC-ELF encoding technique. The approach chosen, to be implemented
in subsequent commits, is to flag-off of an env-var, LOC_ENABLED={1,2}.
Default mode, with this env-var unset is to use default LOC-encoding.

This commit adds a collection of `make` build-mode pytest cases to exercise
`make` with diff env-variables, such as:

    # Default build mode, using Python generator.
 1. $ make

    # Default LOC-encoding, using Python generator.
 2. $ LOC_ENABLED=1 make ...

    # LOC-ELF encoding, w/o using Python generator.
 3. $ LOC_ENABLED=2 make ...

The test cases carefully verify that:

 a) The required files are generated in the expected sub-dirs for (1) and (2)

 b) The Python generator is _not_ invoked for (3), i.e., no generated files
    are found after the `make` completes. The sources compile because the
    provided src/loc.c and include/loc.h are used to build all the sample /
    unit-test programs.

Some of these test cases are failing so are currently skipped with
this commit. Future changes will be applied to fix the `make` build
rules issues, enabling failing tests.

Fix pylint errors found in CI.
@gapisback gapisback marked this pull request as ready for review April 11, 2024 02:03
@gapisback gapisback merged commit 019796a into main Apr 11, 2024
5 checks passed
@gapisback gapisback deleted the gapisback/Fix-LOC-ELF-cpp branch April 11, 2024 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant