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

yarpgen_v1: Add an option to change code output to help preparing a reduced testcase #175

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from

Conversation

winspool
Copy link
Contributor

@winspool winspool commented Mar 8, 2023

This patch adds a new option "--reduce" ("-r") which changes the code output
to print (and reset) the hash for every entry in all checksum functions.

  • Redirecting the output of the compiled program to a result file is needed.
  • Using a "diff -u" on the result files and finding/removing
    the working testcode is an easy way to get a reduced testcase.

Example: https://savannah.nongnu.org/bugs/?63895

--
Regards ... Detlef

@@ -197,6 +197,9 @@ int main (int argc, char* argv[128]) {
else if (!strcmp(argv[i], "-q")) {
quiet = true;
}
else if (!strcmp(argv[i], "-r") || !strcmp(argv[i], "--reduce")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to update help message - see print_usage_and_exit() above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated according to your comment.

…educed testcase.

This patch adds a new option "--reduce" ("-r") and changes the code output
to print (and reset) the hash for every entry in all checksum functions.

 * Redirecting the output of the compiled program to a result file is needed.

 * Using a "diff -u" on the result files and finding/removing
   the working testcode is an easy way to get a reduced testcase.

Example: https://savannah.nongnu.org/bugs/?63895

--
Regards ... Detlef
Copy link
Contributor Author

@winspool winspool left a comment

Choose a reason for hiding this comment

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

Tested local, works.

The c++ compiler fails in the x86 CI build during a cmake check:
The compiler creates a 32bit object file ("-m 32"),
but the linker searches libraries only in the 64bit lib path.

@@ -197,6 +197,9 @@ int main (int argc, char* argv[128]) {
else if (!strcmp(argv[i], "-q")) {
quiet = true;
}
else if (!strcmp(argv[i], "-r") || !strcmp(argv[i], "--reduce")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated according to your comment.

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.

2 participants