From 2a9d3e789832727954899db3ed7c7d0e90bf29f4 Mon Sep 17 00:00:00 2001 From: Keenan Gugeler Date: Fri, 4 Nov 2022 20:26:30 -0400 Subject: [PATCH] testsuite: refactor and replace dependencies test --- testsuite/batch_dependencies/1.txt | 1 - testsuite/batch_dependencies/2.txt | 1 - testsuite/batch_dependencies/3.txt | 1 - testsuite/batch_dependencies/init.yml | 14 ------------ .../tests/python_ac_all/echo.py | 1 - .../tests/python_ac_all/test.yml | 5 ----- .../tests/python_pass_one/allone.py | 1 - .../tests/python_pass_one/test.yml | 5 ----- .../tests/python_pass_two/alltwo.py | 1 - .../tests/python_pass_two/test.yml | 5 ----- testsuite/dependencies/data.zip | Bin 0 -> 1288 bytes testsuite/dependencies/init.yml | 20 ++++++++++++++++++ testsuite/dependencies/tests/ac_all/sol.py | 5 +++++ testsuite/dependencies/tests/ac_all/test.yml | 5 +++++ .../hardcode_samples_solve_even.py | 7 ++++++ .../tests/hardcode_sample_solve_even/test.yml | 5 +++++ .../hardcode_samples/hardcode_samples.py | 7 ++++++ .../tests/hardcode_samples/test.yml | 5 +++++ .../hardcode_samples_solve_odd.py | 5 +++++ .../tests/hardcode_samples_solve_odd/test.yml | 5 +++++ .../tests/solve_even/solve_even.py | 2 ++ .../dependencies/tests/solve_even/test.yml | 5 +++++ .../dependencies/tests/solve_odd/solve_odd.py | 2 ++ .../dependencies/tests/solve_odd/test.yml | 5 +++++ 24 files changed, 78 insertions(+), 35 deletions(-) delete mode 100644 testsuite/batch_dependencies/1.txt delete mode 100644 testsuite/batch_dependencies/2.txt delete mode 100644 testsuite/batch_dependencies/3.txt delete mode 100644 testsuite/batch_dependencies/init.yml delete mode 100644 testsuite/batch_dependencies/tests/python_ac_all/echo.py delete mode 100644 testsuite/batch_dependencies/tests/python_ac_all/test.yml delete mode 100644 testsuite/batch_dependencies/tests/python_pass_one/allone.py delete mode 100644 testsuite/batch_dependencies/tests/python_pass_one/test.yml delete mode 100644 testsuite/batch_dependencies/tests/python_pass_two/alltwo.py delete mode 100644 testsuite/batch_dependencies/tests/python_pass_two/test.yml create mode 100644 testsuite/dependencies/data.zip create mode 100644 testsuite/dependencies/init.yml create mode 100644 testsuite/dependencies/tests/ac_all/sol.py create mode 100644 testsuite/dependencies/tests/ac_all/test.yml create mode 100644 testsuite/dependencies/tests/hardcode_sample_solve_even/hardcode_samples_solve_even.py create mode 100644 testsuite/dependencies/tests/hardcode_sample_solve_even/test.yml create mode 100644 testsuite/dependencies/tests/hardcode_samples/hardcode_samples.py create mode 100644 testsuite/dependencies/tests/hardcode_samples/test.yml create mode 100644 testsuite/dependencies/tests/hardcode_samples_solve_odd/hardcode_samples_solve_odd.py create mode 100644 testsuite/dependencies/tests/hardcode_samples_solve_odd/test.yml create mode 100644 testsuite/dependencies/tests/solve_even/solve_even.py create mode 100644 testsuite/dependencies/tests/solve_even/test.yml create mode 100644 testsuite/dependencies/tests/solve_odd/solve_odd.py create mode 100644 testsuite/dependencies/tests/solve_odd/test.yml diff --git a/testsuite/batch_dependencies/1.txt b/testsuite/batch_dependencies/1.txt deleted file mode 100644 index d00491fd7..000000000 --- a/testsuite/batch_dependencies/1.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/testsuite/batch_dependencies/2.txt b/testsuite/batch_dependencies/2.txt deleted file mode 100644 index 0cfbf0888..000000000 --- a/testsuite/batch_dependencies/2.txt +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/testsuite/batch_dependencies/3.txt b/testsuite/batch_dependencies/3.txt deleted file mode 100644 index 00750edc0..000000000 --- a/testsuite/batch_dependencies/3.txt +++ /dev/null @@ -1 +0,0 @@ -3 diff --git a/testsuite/batch_dependencies/init.yml b/testsuite/batch_dependencies/init.yml deleted file mode 100644 index e5a2f1ed8..000000000 --- a/testsuite/batch_dependencies/init.yml +++ /dev/null @@ -1,14 +0,0 @@ -test_cases: -- batched: - - {in: 1.txt, out: 1.txt} - points: 1 -- batched: - - {in: 2.txt, out: 2.txt} - points: 1 -- batched: - - {in: 3.txt, out: 3.txt} - points: 1 - dependencies: [1, 2] -- batched: - - {in: 1.txt, out: 1.txt} - points: 1 diff --git a/testsuite/batch_dependencies/tests/python_ac_all/echo.py b/testsuite/batch_dependencies/tests/python_ac_all/echo.py deleted file mode 100644 index 8475614cf..000000000 --- a/testsuite/batch_dependencies/tests/python_ac_all/echo.py +++ /dev/null @@ -1 +0,0 @@ -print(input()) diff --git a/testsuite/batch_dependencies/tests/python_ac_all/test.yml b/testsuite/batch_dependencies/tests/python_ac_all/test.yml deleted file mode 100644 index 23298b5ba..000000000 --- a/testsuite/batch_dependencies/tests/python_ac_all/test.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: PY3 -time: 2 -memory: 65536 -source: echo.py -cases: [AC, AC, AC, AC] diff --git a/testsuite/batch_dependencies/tests/python_pass_one/allone.py b/testsuite/batch_dependencies/tests/python_pass_one/allone.py deleted file mode 100644 index b917a726c..000000000 --- a/testsuite/batch_dependencies/tests/python_pass_one/allone.py +++ /dev/null @@ -1 +0,0 @@ -print(1) diff --git a/testsuite/batch_dependencies/tests/python_pass_one/test.yml b/testsuite/batch_dependencies/tests/python_pass_one/test.yml deleted file mode 100644 index 47d611a27..000000000 --- a/testsuite/batch_dependencies/tests/python_pass_one/test.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: PY3 -time: 2 -memory: 65536 -source: allone.py -cases: [AC, WA, SC, AC] diff --git a/testsuite/batch_dependencies/tests/python_pass_two/alltwo.py b/testsuite/batch_dependencies/tests/python_pass_two/alltwo.py deleted file mode 100644 index d0e0fd661..000000000 --- a/testsuite/batch_dependencies/tests/python_pass_two/alltwo.py +++ /dev/null @@ -1 +0,0 @@ -print(2) diff --git a/testsuite/batch_dependencies/tests/python_pass_two/test.yml b/testsuite/batch_dependencies/tests/python_pass_two/test.yml deleted file mode 100644 index dc1712b67..000000000 --- a/testsuite/batch_dependencies/tests/python_pass_two/test.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: PY3 -time: 2 -memory: 65536 -source: alltwo.py -cases: [WA, AC, SC, WA] diff --git a/testsuite/dependencies/data.zip b/testsuite/dependencies/data.zip new file mode 100644 index 0000000000000000000000000000000000000000..2928d2e159f8d39e5b06986d0aadfcdae9ef2f3e GIT binary patch literal 1288 zcma*lKS%;$7{~GVJQcNurU(h4C7Q(l=+G1rk%3Y#wZ7aSG#dy-&=M34LCp=7tr0;) z1T8^?Lj}!2P|#S-4gH?H&gbqmO?l;p^TYeT&$m2n`XhoqxBE&iY%IT;c%~H;!y=i8 z*XlJn7ZzsWTv@c1>V3lSzu}FapJXCZc8Fp_$*1_psf)-t#Pg-HXnBboBTm8lqFN~WU$U4CNm9p-zJV2HK%>yNO7YD{T&>lnVLRp{s82A)Q7-V#E=Zph+ zX9w^2^M?-Pu>->wGylqI2;&sOz&c!`r{A~&t++hr;g;SNw!r*L5xO(@onJc8H!wd1NKYwvj6}9 literal 0 HcmV?d00001 diff --git a/testsuite/dependencies/init.yml b/testsuite/dependencies/init.yml new file mode 100644 index 000000000..badb87cc1 --- /dev/null +++ b/testsuite/dependencies/init.yml @@ -0,0 +1,20 @@ +archive: data.zip +pretest_test_cases: +- &p1 {in: 1.txt, out: 4.txt} +- &p2 {in: 2.txt, out: 1.txt} +- &p3 {in: 3.txt, out: 10.txt, depends: [*p1]} +test_cases: +- &m1 {in: 5.txt, out: 16.txt, points: 1, depends: [*p1, *p3]} +- &m2 + batched: + - {in: 4.txt, out: 2.txt} + - {in: 6.txt, out: 3.txt} + points: 1 + depends: [*p2] +- &m3 + batched: + - {in: 5.txt, out: 16.txt} + - {in: 10.txt, out: 5.txt} + points: 1 + depends: [*m1, *m2] +- &m4 {in: 8.txt, out: 4.txt, points: 1, depends: [*m2]} diff --git a/testsuite/dependencies/tests/ac_all/sol.py b/testsuite/dependencies/tests/ac_all/sol.py new file mode 100644 index 000000000..a54ac7c50 --- /dev/null +++ b/testsuite/dependencies/tests/ac_all/sol.py @@ -0,0 +1,5 @@ +x = int(input()) +if x % 2 == 1: + print(x * 3 + 1) +else: + print(x // 2) diff --git a/testsuite/dependencies/tests/ac_all/test.yml b/testsuite/dependencies/tests/ac_all/test.yml new file mode 100644 index 000000000..ec6e37088 --- /dev/null +++ b/testsuite/dependencies/tests/ac_all/test.yml @@ -0,0 +1,5 @@ +language: PY3 +time: 2 +memory: 65536 +source: sol.py +cases: [AC, AC, AC, AC, AC, AC, AC, AC, AC] diff --git a/testsuite/dependencies/tests/hardcode_sample_solve_even/hardcode_samples_solve_even.py b/testsuite/dependencies/tests/hardcode_sample_solve_even/hardcode_samples_solve_even.py new file mode 100644 index 000000000..d0372cd64 --- /dev/null +++ b/testsuite/dependencies/tests/hardcode_sample_solve_even/hardcode_samples_solve_even.py @@ -0,0 +1,7 @@ +x = int(input()) +if x % 2 == 0: + print(x // 2) +elif x == 1: + print(4) +else: + print(10) diff --git a/testsuite/dependencies/tests/hardcode_sample_solve_even/test.yml b/testsuite/dependencies/tests/hardcode_sample_solve_even/test.yml new file mode 100644 index 000000000..c2f73855e --- /dev/null +++ b/testsuite/dependencies/tests/hardcode_sample_solve_even/test.yml @@ -0,0 +1,5 @@ +language: PY3 +time: 2 +memory: 65536 +source: hardcode_samples_solve_even.py +cases: [AC, AC, AC, WA, AC, AC, SC, SC, AC] diff --git a/testsuite/dependencies/tests/hardcode_samples/hardcode_samples.py b/testsuite/dependencies/tests/hardcode_samples/hardcode_samples.py new file mode 100644 index 000000000..15ea2ef01 --- /dev/null +++ b/testsuite/dependencies/tests/hardcode_samples/hardcode_samples.py @@ -0,0 +1,7 @@ +x = int(input()) +if x == 1: + print(4) +elif x == 2: + print(1) +else: + print(10) diff --git a/testsuite/dependencies/tests/hardcode_samples/test.yml b/testsuite/dependencies/tests/hardcode_samples/test.yml new file mode 100644 index 000000000..8ee03297c --- /dev/null +++ b/testsuite/dependencies/tests/hardcode_samples/test.yml @@ -0,0 +1,5 @@ +language: PY3 +time: 2 +memory: 65536 +source: hardcode_samples.py +cases: [AC, AC, AC, WA, WA, SC, SC, SC, SC] diff --git a/testsuite/dependencies/tests/hardcode_samples_solve_odd/hardcode_samples_solve_odd.py b/testsuite/dependencies/tests/hardcode_samples_solve_odd/hardcode_samples_solve_odd.py new file mode 100644 index 000000000..591d2041c --- /dev/null +++ b/testsuite/dependencies/tests/hardcode_samples_solve_odd/hardcode_samples_solve_odd.py @@ -0,0 +1,5 @@ +x = int(input()) +if x % 2 == 1: + print(x * 3 + 1) +else: + print(1) diff --git a/testsuite/dependencies/tests/hardcode_samples_solve_odd/test.yml b/testsuite/dependencies/tests/hardcode_samples_solve_odd/test.yml new file mode 100644 index 000000000..e60d412d3 --- /dev/null +++ b/testsuite/dependencies/tests/hardcode_samples_solve_odd/test.yml @@ -0,0 +1,5 @@ +language: PY3 +time: 2 +memory: 65536 +source: hardcode_samples_solve_odd.py +cases: [AC, AC, AC, AC, WA, SC, SC, SC, SC] diff --git a/testsuite/dependencies/tests/solve_even/solve_even.py b/testsuite/dependencies/tests/solve_even/solve_even.py new file mode 100644 index 000000000..72025f240 --- /dev/null +++ b/testsuite/dependencies/tests/solve_even/solve_even.py @@ -0,0 +1,2 @@ +x = int(input()) +print(x // 2) diff --git a/testsuite/dependencies/tests/solve_even/test.yml b/testsuite/dependencies/tests/solve_even/test.yml new file mode 100644 index 000000000..965d93873 --- /dev/null +++ b/testsuite/dependencies/tests/solve_even/test.yml @@ -0,0 +1,5 @@ +language: PY3 +time: 2 +memory: 65536 +source: solve_even.py +cases: [WA, SC, SC, SC, SC, SC, SC, SC, SC] diff --git a/testsuite/dependencies/tests/solve_odd/solve_odd.py b/testsuite/dependencies/tests/solve_odd/solve_odd.py new file mode 100644 index 000000000..da16c71de --- /dev/null +++ b/testsuite/dependencies/tests/solve_odd/solve_odd.py @@ -0,0 +1,2 @@ +x = int(input()) +print(x * 3 + 1) diff --git a/testsuite/dependencies/tests/solve_odd/test.yml b/testsuite/dependencies/tests/solve_odd/test.yml new file mode 100644 index 000000000..41c1920fd --- /dev/null +++ b/testsuite/dependencies/tests/solve_odd/test.yml @@ -0,0 +1,5 @@ +language: PY3 +time: 2 +memory: 65536 +source: solve_odd.py +cases: [AC, WA, SC, SC, SC, SC, SC, SC, SC]