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

library checker tests #258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,29 @@ jobs:
run: make test-compiles
- name: Run stress tests
run: make test

verify:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4

- name: Install dependencies
run: pip3 install -U online-judge-verify-helper

# required by cargo-udeps
- name: Set up Rust (nightly)
run: |
rustup set profile minimal
rustup install nightly
rustup override set nightly

- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YUKICODER_TOKEN: ${{ secrets.YUKICODER_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
run: oj-verify all
14 changes: 14 additions & 0 deletions .verify-helper/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[languages.cpp.environments]]
CXX = "g++"
CXXFLAGS = [
"-O2",
"-std=c++17",
"-fsanitize=address,undefined",
"-fno-sanitize-recover=all",
"-fstack-protector",
"-D_GLIBCXX_DEBUG",
"-D_GLIBCXX_SANITIZE_VECTOR",
"-D_GLIBCXX_DEBUG_PEDANTIC",
"-D_GLIBCXX_ASSERTIONS",
"-D_FORTIFY_SOURCE=2",
]
20 changes: 20 additions & 0 deletions stress-tests/number-theory/Factor.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#define PROBLEM "https://judge.yosupo.jp/problem/factorize"
#include "../utilities/template.h"

#include "../../content/number-theory/Factor.h"

int main() {
cin.tie(0)->sync_with_stdio(0);
int q;
cin >> q;
while(q--) {
ull val;
cin >> val;
vector<ull> factors = factor(val);
sort(all(factors));
cout << sz(factors) << ' ';
for(ull fac : factors)
cout << fac << " ";
cout << '\n';
}
}
Loading