Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
57a16b1
Revert part of commit 8b3719c
swiftqwq Apr 1, 2022
6e741e1
Add documentations for some parts of ops
quangloc99 Apr 3, 2022
80e76a5
Add opt with default value + function for checking unused opts
quangloc99 Apr 3, 2022
3e17a79
Add an example generator for using opt
quangloc99 Apr 3, 2022
0d8067e
Merge pull request #135 from swift-zym/master
MikeMirzayanov May 19, 2022
323fc1c
Checker testset and group support
MikeMirzayanov May 19, 2022
9eb3c0f
Merge branch 'master' of github.com:MikeMirzayanov/testlib
MikeMirzayanov May 19, 2022
6daa79f
__testlib_set_binary updated
MikeMirzayanov May 20, 2022
ef38033
Scorer + some bugfix around __testlib_set_binary
MikeMirzayanov Jun 22, 2022
e5bc25b
Updated validator examples to current standards
KalininN Jul 7, 2022
6db79a7
Updated generator examples to current standards.
KalininN Jul 7, 2022
5ac4c8a
Updated readme examples to current standards and generators to use rn…
KalininN Jul 7, 2022
87b756b
Fix #140 - rnd.perm(0) should return empty vector instead of fail
MikeMirzayanov Jul 21, 2022
36852a1
Guarantee result bounds for random (mostly for wnext), fixed wrong fo…
MikeMirzayanov Jul 21, 2022
6a52d7d
WIP: tests
MikeMirzayanov Jul 22, 2022
83754ea
gitignore, shell scripts reformat and small changes
MikeMirzayanov Jul 25, 2022
fbaddab
tests/README.md
MikeMirzayanov Jul 25, 2022
9962c95
Merge pull request #141 from MikeMirzayanov/fix_140
MikeMirzayanov Jul 25, 2022
f1343bf
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Jul 25, 2022
3420ba7
Merge pull request #142 from MikeMirzayanov/fix_76_133
MikeMirzayanov Jul 25, 2022
d81e693
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Jul 25, 2022
3db8803
Merge pull request #143 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Jul 25, 2022
29e9fbd
0.9.39-SNAPSHOT
MikeMirzayanov Jul 25, 2022
cf4b080
Update README.md
MikeMirzayanov Jul 25, 2022
2cecb8e
Resolved conflicts with origin
KalininN Jul 25, 2022
25e849b
Merge branch 'KalininN-master' into dev-kan
KalininN Jul 25, 2022
49bea07
Reverted examples to satisfy c++11 standard.
KalininN Jul 25, 2022
2903813
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Jul 25, 2022
5d63abc
`$CPP -v` before test, test rnd.partition(1, 0, 0)
MikeMirzayanov Jul 26, 2022
617bfe0
Formatting checkers
KalininN Jul 26, 2022
b6cbb51
Formatting generators
KalininN Jul 26, 2022
bc7e034
Formatting validators
KalininN Jul 26, 2022
ebb5fd2
Formatting interactors
KalininN Jul 26, 2022
e4e07ef
Reformat with default CLion (as testlib.h), removed `return 0;` in ma…
MikeMirzayanov Jul 26, 2022
387539b
Merge pull request #1 from MikeMirzayanov/master
quangloc99 Jul 26, 2022
7f554fd
Merge branch 'master' into opts-default-value
quangloc99 Jul 26, 2022
0793008
chore: not run tests when docs changes
renbaoshuo Jul 26, 2022
398d05f
Add tests for default-value and unused opts.
quangloc99 Jul 26, 2022
db3d61d
Remove usage comment in the example generator.
quangloc99 Jul 26, 2022
1bdd421
Adjust generator to fit with C++11 standard
quangloc99 Jul 26, 2022
abe3c22
Merge pull request #145 from renbaoshuo/ci/no-docs-run
MikeMirzayanov Jul 26, 2022
63f0a8f
Fixed extra token read in casencmp.cpp
KalininN Jul 26, 2022
7af3171
Merge pull request #144 from MikeMirzayanov/dev-kan
MikeMirzayanov Jul 27, 2022
ddae282
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Jul 27, 2022
fca0a2f
Merge pull request #136 from quangloc99/opts-default-value
MikeMirzayanov Jul 27, 2022
cf3c049
opt defaults improvements
MikeMirzayanov Jul 27, 2022
6e3c761
Add automatical ensurement for no unused opts.
quangloc99 Jul 27, 2022
9ee8187
Remove check_unused_opts() in gen-array-with-opt.
quangloc99 Jul 27, 2022
4920be3
Use new functions for tests opts-defaults.
quangloc99 Jul 27, 2022
53eeb1b
Add test-auto-ensure-no-unused-test.
quangloc99 Jul 27, 2022
d0d711e
Add some more color for text in test scripts.
quangloc99 Jul 27, 2022
d713a94
Merge pull request #146 from quangloc99/opt-defaults
MikeMirzayanov Jul 28, 2022
14bf287
Extract test-005_opts, supress->suppress
MikeMirzayanov Jul 28, 2022
47fbf57
Set executable flags for test scripts
Fefer-Ivan Jul 28, 2022
9f5c7d8
add skipBom to InStream on init
Fefer-Ivan Jul 28, 2022
08c2dfc
Fix tests
Fefer-Ivan Jul 28, 2022
884cb75
Merge pull request #147 from Fefer-Ivan/ifefer/set_executable_flags_f…
MikeMirzayanov Jul 28, 2022
d9b8609
Merge pull request #148 from Fefer-Ivan/ifefer/skip_bom
MikeMirzayanov Jul 30, 2022
c75b485
Update README.md
MikeMirzayanov Jul 30, 2022
925cb4e
Check on testlib exit that register-function has been actually called
MikeMirzayanov Jul 30, 2022
2d1a734
Fixed test-004_use-test.h/test.cpp
MikeMirzayanov Jul 30, 2022
2e10083
Merge pull request #149 from MikeMirzayanov/require_regs
MikeMirzayanov Jul 30, 2022
f0c69a2
Merge pull request #150 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Aug 1, 2022
20dd269
Merge pull request #151 from MikeMirzayanov/master
MikeMirzayanov Aug 1, 2022
c034848
Note in the list of updates
MikeMirzayanov Aug 1, 2022
545b3e4
Merge branch 'master' into opt-defaults
MikeMirzayanov Aug 1, 2022
62efd6c
Merge pull request #152 from MikeMirzayanov/opt-defaults
MikeMirzayanov Aug 1, 2022
9c884fb
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Aug 1, 2022
dff826f
Remove code to set binary mode on non-Windows systems
Menci Aug 2, 2022
d4e14b5
validators: '--testMarkupFileName fn' and '--dumpTestCase tc' for val…
MikeMirzayanov Aug 2, 2022
e8d7111
Missed files
MikeMirzayanov Aug 2, 2022
a76054d
Merge pull request #153 from Menci/patch-1
MikeMirzayanov Aug 4, 2022
bd2872e
Effectively do not use __testlib_set_binary on non-Windows, better su…
MikeMirzayanov Aug 4, 2022
4cc5a41
Merge pull request #154 from MikeMirzayanov/no-binmode-for-non-windows
MikeMirzayanov Aug 4, 2022
fc3de52
Merge pull request #155 from MikeMirzayanov/master
MikeMirzayanov Aug 4, 2022
136daf2
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Aug 4, 2022
23ea527
Better support for win7 and old g++ windows compilers
MikeMirzayanov Aug 4, 2022
e2981e5
--testCase/--testCaseFileName
MikeMirzayanov Aug 4, 2022
fc4a690
Fix tests
MikeMirzayanov Aug 4, 2022
68c705d
Better tests
MikeMirzayanov Aug 5, 2022
5ba30e4
Missed ref files
MikeMirzayanov Aug 7, 2022
ced4979
Merge branch 'master' into scorer
MikeMirzayanov Aug 7, 2022
f6dfd2a
Merge pull request #156 from MikeMirzayanov/scorer
MikeMirzayanov Aug 7, 2022
a5b449e
Merge pull request #157 from MikeMirzayanov/master
MikeMirzayanov Aug 7, 2022
cb46e9b
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Aug 7, 2022
b74d317
Other test markup format
MikeMirzayanov Aug 7, 2022
a76c6f0
setTestCase supports 0-based test cases indices (migrates them silent…
MikeMirzayanov Aug 7, 2022
7fd543d
Merge pull request #158 from MikeMirzayanov/validator-exts
MikeMirzayanov Aug 7, 2022
6d72a55
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Aug 8, 2022
a43cd17
Simple test on interactors
MikeMirzayanov Aug 8, 2022
cb972e7
Missed files
MikeMirzayanov Aug 9, 2022
232769e
dos2unix -> tr
MikeMirzayanov Aug 12, 2022
139afc4
skipBom only in checker-mode for output, more tests
MikeMirzayanov Aug 13, 2022
6ab4954
Fixed test
MikeMirzayanov Aug 13, 2022
748dbf2
sleep 1 -> sleep 3
MikeMirzayanov Aug 13, 2022
27b22d2
sleep 3 -> sleep 1 && scanf -> cin
MikeMirzayanov Aug 14, 2022
db4ac74
logging
MikeMirzayanov Aug 20, 2022
daaf2ef
Fix typos
int-y1 Sep 19, 2022
3c6e5c6
gcc13 requires include `<cstdint>` for `uint64_t`
mizar May 6, 2023
e5e0194
Update test.h that change sprintf to snprintf
seadog007 Jul 19, 2023
45f6151
Merge pull request #177 from seadog007/patch-1
MikeMirzayanov Sep 3, 2023
8bff9c5
Merge pull request #174 from mizar/gcc13-cstdint
MikeMirzayanov Sep 3, 2023
abd32a9
Merge pull request #163 from int-y1/fix-typos
MikeMirzayanov Sep 3, 2023
f6aa4d8
cast seed to unsigned long long in setSeed
MikeMirzayanov Sep 3, 2023
0e821ac
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Sep 3, 2023
f6245cf
tmp macos tests only, fix bom issue
MikeMirzayanov Sep 3, 2023
f8ba76b
tmp test only g++12 on macos-11, more sleep in interactive test
MikeMirzayanov Sep 3, 2023
a65f61c
All tests
MikeMirzayanov Sep 3, 2023
718a536
tmp test on win only
MikeMirzayanov Sep 3, 2023
22d391f
wip
MikeMirzayanov Sep 3, 2023
54db625
wip
MikeMirzayanov Sep 3, 2023
c31b75f
wip
MikeMirzayanov Sep 3, 2023
8a58d25
wip
MikeMirzayanov Sep 3, 2023
75a5b9a
wip
MikeMirzayanov Sep 3, 2023
aac2c21
wip
MikeMirzayanov Sep 3, 2023
cf89338
wip
MikeMirzayanov Sep 3, 2023
ff694b3
wip
MikeMirzayanov Sep 3, 2023
cf23a5e
wip
MikeMirzayanov Sep 3, 2023
fc12fbf
wip
MikeMirzayanov Sep 3, 2023
d38bf8b
wip
MikeMirzayanov Sep 3, 2023
3170cc3
wip
MikeMirzayanov Sep 3, 2023
2abe6cc
wip
MikeMirzayanov Sep 3, 2023
29f7668
wip
MikeMirzayanov Sep 3, 2023
dcdd6d1
wip
MikeMirzayanov Sep 3, 2023
79f54c2
wip
MikeMirzayanov Sep 3, 2023
ff6ca5d
wip
MikeMirzayanov Sep 3, 2023
e0de214
wip
MikeMirzayanov Sep 3, 2023
b0ccb0e
wip
MikeMirzayanov Sep 3, 2023
a249880
wip
MikeMirzayanov Sep 3, 2023
ec8f9f8
wip
MikeMirzayanov Sep 4, 2023
1f5e4f0
Merge branch 'dev-mikemirzayanov' of https://github.com/MikeMirzayano…
MikeMirzayanov Sep 4, 2023
4d01e77
wip
MikeMirzayanov Sep 4, 2023
3c2d852
wip
MikeMirzayanov Sep 4, 2023
93fbb69
all tests
MikeMirzayanov Sep 4, 2023
7b9ffdf
wip
MikeMirzayanov Sep 4, 2023
28843b0
wip
MikeMirzayanov Sep 4, 2023
41b1200
docker tests
MikeMirzayanov Sep 4, 2023
b3fad97
wip
MikeMirzayanov Sep 4, 2023
87d5d25
test-006_interactors
MikeMirzayanov Sep 4, 2023
a591441
wip
MikeMirzayanov Sep 4, 2023
642de1e
all tests
MikeMirzayanov Sep 4, 2023
e9d3695
tests in docker
MikeMirzayanov Sep 4, 2023
8884fb8
Disable ubuntu1804 tests
MikeMirzayanov Sep 4, 2023
c3f7215
Merge pull request #178 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Sep 5, 2023
9e60dd4
use std::advance
MikeMirzayanov Sep 5, 2023
1818675
Merge pull request #179 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Sep 6, 2023
31f40a0
Fix #168
MikeMirzayanov Sep 6, 2023
6063260
fix: use std::advance in wany
HeRaNO Sep 6, 2023
323f3f0
setAppesModeEncoding
MikeMirzayanov Sep 26, 2023
1b1c411
Merge pull request #182 from MikeMirzayanov/xml-encoding
MikeMirzayanov Sep 26, 2023
7a5a0a4
more rnd.any/wany tests
MikeMirzayanov Sep 26, 2023
525e696
Fixed rnd.wany unstable behavior
MikeMirzayanov Sep 26, 2023
c18958c
tmp use only tests-windows-2022
MikeMirzayanov Sep 26, 2023
30d6a66
debug
MikeMirzayanov Sep 26, 2023
d69502c
add compile flag: -static
MikeMirzayanov Sep 27, 2023
8f5abb8
add -static for win
MikeMirzayanov Sep 27, 2023
16b399e
use -static for win compilation
MikeMirzayanov Sep 27, 2023
da1128d
Try windows-2022 clang++
MikeMirzayanov Sep 28, 2023
093e88b
all tests
MikeMirzayanov Sep 28, 2023
7391cf2
Merge pull request #185 from MikeMirzayanov/compile-static
MikeMirzayanov Sep 28, 2023
2815976
Merge branch 'master' into dev-mikemirzayanov
MikeMirzayanov Sep 28, 2023
4c57080
better stringToLongLong/stringToUnsignedLongLong
MikeMirzayanov Sep 28, 2023
a047899
cleanups
MikeMirzayanov Sep 28, 2023
abef2d6
dos2unix
MikeMirzayanov Sep 28, 2023
37a1c5c
Merge pull request #186 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Sep 28, 2023
ffe5752
Merge branch 'master' into anywany-tests
MikeMirzayanov Sep 28, 2023
8ff2de3
Merge pull request #181 from HeRaNO/fix-171-wany
MikeMirzayanov Sep 28, 2023
f5b8c28
More in Docker tests
MikeMirzayanov Sep 28, 2023
60c9c2f
better any/wany fix, tests
MikeMirzayanov Sep 28, 2023
8f438fa
better tests/test-003_run-rnd
MikeMirzayanov Sep 28, 2023
c6c2dbd
Merge pull request #184 from MikeMirzayanov/anywany-tests
MikeMirzayanov Sep 28, 2023
7cf5a1e
Merge branch 'master' into HeRaNO-fix-171-wany
MikeMirzayanov Sep 28, 2023
fdb967f
faster tests
MikeMirzayanov Sep 28, 2023
5dab275
Merge pull request #188 from MikeMirzayanov/HeRaNO-fix-171-wany
MikeMirzayanov Sep 29, 2023
3faed88
Merge pull request #189 from MikeMirzayanov/faster-tests
MikeMirzayanov Sep 29, 2023
8fa873c
Merge pull request #187 from MikeMirzayanov/more-docker-tests
MikeMirzayanov Sep 29, 2023
b940a91
In case of EJUDGE ignore argc == 5/6 cases in registerTestlibCmd
MikeMirzayanov Sep 29, 2023
b354fcf
wip
MikeMirzayanov Sep 29, 2023
8d92a1d
impl + tests
MikeMirzayanov Sep 29, 2023
80530b3
Fix test-ref logging for macos
MikeMirzayanov Sep 29, 2023
284254d
support TESTLIB_COMPILER_OPTIMIZATION_OPT env, passed to -O<opt> in c…
MikeMirzayanov Sep 29, 2023
02adee7
Merge branch 'dev-mikemirzayanov' of https://github.com/MikeMirzayano…
MikeMirzayanov Sep 29, 2023
c59428d
Merge pull request #190 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Sep 29, 2023
cdd4ffd
Merge pull request #191 from MikeMirzayanov/skip-bounds-checks
MikeMirzayanov Sep 29, 2023
56bd892
Rephrase README.md
MikeMirzayanov Sep 29, 2023
d5c73d4
Merge pull request #192 from MikeMirzayanov/dev-mikemirzayanov
MikeMirzayanov Sep 29, 2023
d34dafa
dos2unix
MikeMirzayanov Sep 29, 2023
bca6f50
Merge pull request #193 from MikeMirzayanov/skip-bounds-checks
MikeMirzayanov Sep 30, 2023
0ca6179
Merge pull request #194 from MikeMirzayanov/issue-170-ejudge-register…
MikeMirzayanov Sep 30, 2023
fee1343
0.9.41-alpha
MikeMirzayanov Oct 3, 2023
68f9f30
0.9.41
MikeMirzayanov Oct 6, 2023
d0a0161
Merge pull request #195 from MikeMirzayanov/release-0.9.41
MikeMirzayanov Oct 6, 2023
7d37a1a
__testlib_preparePoints
MikeMirzayanov Jan 17, 2024
da59e0d
added ConstantBoundsLog to validator testOverviewLogFile
MikeMirzayanov Jan 17, 2024
269931f
added ConstantBoundsLog to validator testOverviewLogFile
MikeMirzayanov Jan 17, 2024
36041fc
Added ConstantBoundsLog, VariablesLog to validator testOverviewLogFile
MikeMirzayanov Jan 17, 2024
d57ce40
ci sudo apt-get update
MikeMirzayanov Jan 17, 2024
7805559
Merge remote-tracking branch 'origin/master' into better-quitp
MikeMirzayanov Jul 31, 2024
8554703
Merge pull request #210 from MikeMirzayanov/better-quitp
MikeMirzayanov Aug 1, 2024
7968ff5
#define VERSION "0.9.43"
MikeMirzayanov Aug 1, 2024
a6e57ad
Merge pull request #211 from MikeMirzayanov/ConstantBoundsLog
MikeMirzayanov Aug 1, 2024
65d2b11
docs/read.me
MikeMirzayanov Sep 22, 2024
5b780b3
10000 -> 10'000 and similar
MikeMirzayanov Sep 22, 2024
7b15e65
revert 10000->10'000, fix macos-12-gpp, macos-13-gpp
MikeMirzayanov Sep 22, 2024
5f898aa
Fallback to std::format for c++20, fixed some warns
MikeMirzayanov Sep 22, 2024
4df0ed8
fix macos issue?
MikeMirzayanov Sep 22, 2024
5c1ee38
fix
MikeMirzayanov Sep 22, 2024
748bcf3
- macos-11; + test-008_format
MikeMirzayanov Sep 22, 2024
f736340
+ macos-14
MikeMirzayanov Sep 22, 2024
96fd1b8
format issue
MikeMirzayanov Sep 24, 2024
558dd2e
more tests
MikeMirzayanov Sep 24, 2024
3ec5caf
use sscanf_s and similar for msvc
MikeMirzayanov Sep 25, 2024
7c3388f
some msvc warn fixed
MikeMirzayanov Sep 25, 2024
f5d2265
Removed meaningless update comment
MikeMirzayanov Sep 25, 2024
9ecb111
Merge pull request #213 from MikeMirzayanov/fix-workflows
MikeMirzayanov Sep 25, 2024
c792964
Fix test case message in multitest checkers with partial scores
nsychev Jul 8, 2025
01dc8bb
fix #222
fy-hb Dec 17, 2025
585a3ac
Merge pull request #223 from fy-hb/remove_attribute_const
MikeMirzayanov Dec 17, 2025
937bf6d
0.9.45: Remove incorrect const attributes
MikeMirzayanov Dec 17, 2025
2d20123
Merge pull request #216 from nsychev/patch-2
MikeMirzayanov Dec 17, 2025
f646a1f
Remove g++9 from ubuntu 22.04 CI workflow
MikeMirzayanov Feb 5, 2026
8c8a672
Remove macOS 12 test jobs from CI configuration
MikeMirzayanov Feb 5, 2026
ef9f282
Remove g++12 from macos-14 CI workflow
MikeMirzayanov Feb 5, 2026
0c6208a
Remove CI macos-13, added macos-26-arm64
MikeMirzayanov Feb 5, 2026
86050b1
Add workflow_dispatch trigger to CI workflow
MikeMirzayanov Feb 6, 2026
721c0a6
Temporarily removed CI on ubuntu-20.04, macos26arm -> macos15arm
MikeMirzayanov Feb 6, 2026
cdeca03
Temporarily removed CI on ubuntu-20.04, macos26arm -> macos15arm
MikeMirzayanov Feb 6, 2026
1e4e8a2
+ macos-15, macos-26 ci, - macos-26-amd64
MikeMirzayanov Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* binary
263 changes: 263 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
name: CI

on:
workflow_dispatch:
push:
paths-ignore:
- 'docs/**'
- 'LICENSE'
- 'read.me'
- 'README.md'
pull_request:
paths-ignore:
- 'docs/**'
- 'LICENSE'
- 'read.me'
- 'README.md'

env:
TEST_REF_FORBID_GEN_REFS: true

jobs:
# tests-ubuntu2004-gpp:
# strategy:
# matrix:
# os: [ubuntu-20.04]
# compiler: [g++]
# version: [9, 10]
# name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# - name: Run tests
# run: |
# cd tests
# bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}
#
# tests-ubuntu2004-clang:
# strategy:
# matrix:
# os: [ubuntu-20.04]
# compiler: [clang++]
# version: [10, 11, 12]
# name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# - name: Run tests
# run: |
# cd tests
# bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}

tests-ubuntu2204-gpp:
strategy:
matrix:
os: [ubuntu-22.04]
compiler: [g++]
version: [10, 11, 12]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}

tests-ubuntu2204-clang:
strategy:
matrix:
os: [ubuntu-22.04]
compiler: [clang++]
version: [13, 14]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}

# tests-ubuntu2004-gpp-32:
# strategy:
# matrix:
# os: [ubuntu-20.04]
# compiler: [g++]
# version: [9, 10]
# name: Use ${{ matrix.compiler }}-${{ matrix.version }} -m32 on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# - name: Run tests
# run: |
# sudo apt-get update
# sudo apt-get install gcc-${{ matrix.version }}-multilib g++-${{ matrix.version }}-multilib
# cd tests
# bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} 32
#
# tests-ubuntu2004-clang-32:
# strategy:
# matrix:
# os: [ubuntu-20.04]
# compiler: [clang++]
# version: [10, 11, 12]
# name: Use ${{ matrix.compiler }}-${{ matrix.version }} -m32 on ${{ matrix.os }}
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# - name: Run tests
# run: |
# sudo apt-get update
# sudo apt-get install gcc-multilib g++-multilib
# cd tests
# bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} 32

tests-ubuntu2204-gpp-32:
strategy:
matrix:
os: [ubuntu-22.04]
compiler: [g++]
version: [9, 10, 11]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} -m32 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
sudo apt-get update
sudo apt-get install gcc-${{ matrix.version }}-multilib g++-${{ matrix.version }}-multilib
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} 32

tests-ubuntu2204-clang-32:
strategy:
matrix:
os: [ubuntu-22.04]
compiler: [clang++]
version: [13, 14]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} -m32 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
sudo apt-get update
sudo apt-get install gcc-multilib g++-multilib
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }} 32

tests-macos14-gpp:
strategy:
matrix:
os: [macos-14]
compiler: [g++]
version: [13, 14, 15]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}

tests-macos14-clang:
strategy:
matrix:
os: [macos-14]
compiler: [clang++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}

tests-macos15-gpp:
strategy:
matrix:
os: [macos-15]
compiler: [g++]
version: [13, 14, 15]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}

tests-macos15-clang:
strategy:
matrix:
os: [macos-15]
compiler: [clang++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}

tests-macos26-gpp:
strategy:
matrix:
os: [macos-26]
compiler: [g++]
version: [13, 14, 15]
name: Use ${{ matrix.compiler }}-${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }} v${{ matrix.version }}

tests-macos26-clang:
strategy:
matrix:
os: [macos-26]
compiler: [clang++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}

tests-windows-2019:
strategy:
matrix:
os: [windows-2019]
compiler: [msvc, g++, clang++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}

tests-windows-2022:
strategy:
matrix:
os: [windows-2022]
compiler: [msvc, g++, clang++]
name: Use ${{ matrix.compiler }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
cd tests
bash ./run.sh ${{ matrix.compiler }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
cmake-build-debug

*.exe
*.o
*.obj
CMakeLists.txt
30 changes: 12 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

## Intro

This project contains C++ implementation of the testlib. It is already being used on many programming contests in Russia (Russian National Olympiad in Informatics, different stages of ACM-ICPC). Join!
This project contains a C++ implementation of testlib. It is already being used in many programming contests in Russia, such as the Russian National Olympiad in Informatics and different stages of ICPC. Join!

The library C++ code is tested for compatibility with Borland C++ (5.6), Microsoft Visual C++ (2003+), g++ (MinGW 4.0.2). Also we don't hear any issues about incorrect work with other compilers.
The library's C++ code is tested for compatibility with standard C++11 and higher on different versions of `g++`, `clang++`, and Microsoft Visual C++.

This code used many times on Open Team Programming Collegiate Cup contests (http://opencup.ru/) running on Linux platform and compiled by g++ compiler.
This code has been used many times in Codeforces contests.

## Samples

### Checker

This is sample checker which expects in the output and in the answer the same integer. It ignores all white-spaces. See more examples in the package.
This sample checker expects the same integer in the output and the answer. It ignores all white-spaces. See more examples in the package.

```c++
#include "testlib.h"
Expand All @@ -30,9 +30,9 @@ int main(int argc, char * argv[]) {

### Interactor

This sample interactor reads pairs of numbers from input file, sends it to the other program, reads
result and writes it to output file (to be verified later). Another option could be terminating
interactor with `quitf(_wa, <comment>)`.
This sample interactor reads pairs of numbers from the input file, sends them to another program, reads
the result, and writes it to an output file (to be verified later). Another option could be to terminate
the interactor with `quitf(_wa, <comment>)`.

```c++
#include "testlib.h"
Expand Down Expand Up @@ -65,8 +65,7 @@ int main(int argc, char* argv[]) {

### Validator

This code reads input from the standard input and checks that it contains the only integer between 1 and 100, inclusive. Also validates that file ends with EOLN and EOF. On Windows it expects #13#10 as EOLN and it expects #10 as EOLN on other platforms. It doesn't ignore white-spaces, so it works very strict. It will return non-zero code in case of illegal input and writes message into the standard output. See more examples in the package.

This code reads input from the standard input and checks that it contains only one integer between 1 and 100, inclusive. It also validates that the file ends with EOLN and EOF. On Windows, it expects #13#10 as EOLN, and it expects #10 as EOLN on other platforms. It does not ignore white-spaces, so it works very strictly. It will return a non-zero code in the case of illegal input and write a message to the standard output. See more examples in the package.

```c++
#include "testlib.h"
Expand All @@ -81,28 +80,23 @@ int main(int argc, char* argv[]) {

### Generator

This generator outputs into the standard output random token, containing Latin letters or digits. The length of the token will be between 1 and 1000, inclusive. It will use uniformly distributed random. To generate different values, call it with different command line parameters. It is typical behaviour of testlib generator to setup randseed by command line. See more examples in the package.
This generator outputs a random token to the standard output, containing Latin letters or digits. The length of the token will be between 1 and 1000, inclusive. It will use a uniformly distributed random generator. To generate different values, call it with different command-line parameters. It is typical behavior for a testlib generator to set up randseed by command line. See more examples in the package.

```c++
#include "testlib.h"
#include <iostream>

using namespace std;

int main(int argc, char* argv[]) {
registerGen(argc, argv, 1);
cout << rnd.next(1, 10) << endl; /* Random number in the range [1,10]. */
cout << rnd.next("[a-zA-Z0-9]{1,1000}") << endl; /* Random word of length [1,1000]. */
println(rnd.next(1, 10)); /* Random number in the range [1,10]. */
println(rnd.next("[a-zA-Z0-9]{1,1000}")); /* Random word of length [1,1000]. */
}
```

This generator outputs random permutation, the size equals to the first command line argument.
This generator outputs a random permutation; the size is equal to the first command-line argument.

```c++
#include "testlib.h"

using namespace std;

int main(int argc, char* argv[]) {
registerGen(argc, argv, 1);

Expand Down
10 changes: 4 additions & 6 deletions checkers/acmp.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#include "testlib.h"
#include <stdio.h>
#include <math.h>
#include <cmath>

const double EPS = 1.5E-6;

int main(int argc, char * argv[])
{
int main(int argc, char *argv[]) {
setName("compare two doubles, maximal absolute error = %.10f", EPS);
registerTestlibCmd(argc, argv);

double ja = ans.readDouble();
double pa = ouf.readDouble();

if (fabs(ja - pa) > EPS + 1E-15)
quitf(_wa, "expected %.10f, found %.10f", ja, pa);

quitf(_ok, "answer is %.10f", ja);
}
Loading