Skip to content

feat: support stress testing#1031

Merged
ouuan merged 59 commits into
masterfrom
stress-testing
Jan 21, 2026
Merged

feat: support stress testing#1031
ouuan merged 59 commits into
masterfrom
stress-testing

Conversation

@swiftqwq

@swiftqwq swiftqwq commented Jan 1, 2022

Copy link
Copy Markdown
Member

Description

Support stress testing.

Related Issues / Pull Requests

Closes #917

cpeditor/cpeditor.github.io#366

Motivation and Context

How Has This Been Tested?

macOS 12.0.1

Screenshots (if appropriate)

Screen.Recording.2022-01-01.at.8.42.27.PM.mov

Checklist

  • If the key of a setting is changed, the old attribute is updated or it is resolved in SettingsUpdater.
  • If there are changes of the text displayed in the UI, they are wrapped in tr() or QCoreApplication::translate().
  • If needed, I have opened a pull request or an issue to update the documentation.
  • If these changes are notable, they are documented in CHANGELOG.md.

Additional text

It is almost the same as Polygon's, so only testilb style generators are supported.

@coder3101 coder3101 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Awesome! Left some comments please provide your feedback

Comment thread src/Widgets/StressTesting.cpp Outdated
Comment thread src/Widgets/StressTesting.cpp Outdated
Comment thread src/Widgets/StressTesting.cpp Outdated
Comment thread src/Widgets/StressTesting.cpp Outdated
Comment thread src/Widgets/StressTesting.cpp Outdated
@swiftqwq swiftqwq added the work in progress The work has been started and is in progress. label Jan 2, 2022
@ouuan

ouuan commented Feb 16, 2022

Copy link
Copy Markdown
Member

I haven't tested it at local yet. But from the screen record, it seems that more features are needed to make it more useful than a shell script. See #162 (comment).

  • A button to add the counterexample in the test cases.
  • Be able to choose gen and std from editor tabs (as well as local files).
  • Be able to use a code template dedicated to generators.

It is almost the same as Polygon's, so only testilb style generators are supported.

By "testlib style", do you mean generators that take command-line arguments? I don't think we need to force this style. Now we provide the Polygon functionality to feed random arguments to the generator, and testlib-style generators can make use of these arguments. But the user can keep the arguments empty and generate different test cases with the same empty arguments. And if we don't restrict the style, we can also support Python/Java generators.

@anHiep anHiep mentioned this pull request Mar 11, 2024
5 tasks
@swiftqwq swiftqwq removed the work in progress The work has been started and is in progress. label Jul 7, 2025
@swiftqwq

swiftqwq commented Dec 9, 2025

Copy link
Copy Markdown
Member Author

I'm thinking that the generator argument design might be unintuitive for users unfamiliar with the testlib-style generator / generator with arguments. Maybe we can have two modes, one without arguments and one with an arguments pattern. In the no argument mode, I'm not sure whether it's better to set the number of test cases, to set the total running duration, or to run indefinitely until manual stop 🤔

This can be simulated by [1..n], but the user might not know this without hints. And maybe it's just simpler to run until manual stop. I think that's what I always did with a simple bash script.

I think in the no argument mode, we could let it run until it’s manually stopped, and display both the number of test cases that have been run and the elapsed time?

@swiftqwq swiftqwq requested review from ouuan and removed request for ouuan December 11, 2025 10:42

@ouuan ouuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Some text/translation issues
  • Elapsed time should pause on the counter example dialog

Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
Comment thread translations/zh_CN.ts Outdated
@swiftqwq swiftqwq requested a review from ouuan January 20, 2026 05:34
@ouuan

ouuan commented Jan 20, 2026

Copy link
Copy Markdown
Member

Generator and std chosen from tabs should be automatically saved depending on SettingsHelper::isSaveFileOnCompilation().

@swiftqwq swiftqwq removed the request for review from ouuan January 21, 2026 02:30
@swiftqwq swiftqwq requested a review from ouuan January 21, 2026 03:18
@ouuan ouuan merged commit 833df30 into master Jan 21, 2026
14 checks passed
@ouuan ouuan deleted the stress-testing branch January 21, 2026 03:44
@coder3101

Copy link
Copy Markdown
Member

Thanks for sticking around and driving this to completion.

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.

Stress testing

3 participants