Compare commits

...

22 Commits

Author SHA1 Message Date
drunkendog 881c9814f7 Add rstrip to output
Tests / Run-Tests (push) Successful in 21s Details
Benchmarks / Run-Benchmarks (push) Successful in 25s Details
2023-09-26 18:49:55 +01:00
drunkendog b3886eebc6 Add a2/functions-main.cases
Tests / Run-Tests (push) Successful in 6s Details
Benchmarks / Run-Benchmarks (push) Successful in 19s Details
2023-09-26 18:41:57 +01:00
drunkendog e4928c4401 Add splitlines to prevent newlines from messing up multiline output
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 22s Details
2023-09-26 17:48:45 +01:00
drunkendog 1941de0ded Fix issue with differ print
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Successful in 37s Details
2023-09-26 17:41:50 +01:00
drunkendog d62a817ea6 Add a2/snake.cases
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Successful in 36s Details
2023-09-26 17:32:50 +01:00
drunkendog 56b479abb8 Add throughput badge to readme
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 20s Details
2023-09-26 02:29:23 +01:00
drunkendog abdb5a1760 Replace space with uri safe equivalent
Tests / Run-Tests (push) Successful in 5s Details
Benchmarks / Run-Benchmarks (push) Successful in 37s Details
2023-09-26 01:50:51 +01:00
drunkendog f7b08754e2 Fix quotes issue in bc calculation
Tests / Run-Tests (push) Successful in 5s Details
Benchmarks / Run-Benchmarks (push) Failing after 38s Details
2023-09-26 01:48:05 +01:00
drunkendog fe59d693f8 Work on benchmark badge
Tests / Run-Tests (push) Successful in 6s Details
Benchmarks / Run-Benchmarks (push) Failing after 37s Details
2023-09-26 01:38:13 +01:00
drunkendog f79b6c3624 Add throughput badge
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Failing after 38s Details
2023-09-25 20:58:33 +01:00
drunkendog 989a93a68c Add bc to dependencies in benchmark
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 17s Details
2023-09-25 20:26:17 +01:00
drunkendog b2dbc01c9f Update benchmark/benchmark-throughput.sh
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Failing after 36s Details
2023-09-25 20:24:53 +01:00
drunkendog ff1f7d41f6 Update benchmark/benchmark-throughput.sh
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Successful in 38s Details
2023-09-25 20:16:46 +01:00
drunkendog 4eaa3554e2 Update benchmark/benchmark-throughput.sh
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Successful in 37s Details
2023-09-25 20:15:47 +01:00
drunkendog 3de8d66547 Fix bug again
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 18s Details
2023-09-25 20:07:52 +01:00
drunkendog 1eea2a74eb Fix bug
Tests / Run-Tests (push) Failing after 3s Details
Benchmarks / Run-Benchmarks (push) Failing after 11s Details
2023-09-25 20:05:49 +01:00
drunkendog f36cb77326 Fix typo in filename
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 48s Details
2023-09-25 20:04:41 +01:00
drunkendog d565117116 Reduce benchmark-throughtput size
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Successful in 22s Details
2023-09-25 20:03:51 +01:00
drunkendog e139066905 Reduce benchmark size
Benchmarks / Run-Benchmarks (push) Has been cancelled Details
Tests / Run-Tests (push) Successful in 7s Details
2023-09-25 20:03:31 +01:00
drunkendog 61c6e8a290 Add tests/cases/f-echo-multiline.c
Tests / Run-Tests (push) Successful in 3s Details
Benchmarks / Run-Benchmarks (push) Has been cancelled Details
2023-09-25 20:01:48 +01:00
drunkendog f60fe2625d Add tests/fail/f-echo-multiline.c
Benchmarks / Run-Benchmarks (push) Has been cancelled Details
Tests / Run-Tests (push) Successful in 7s Details
2023-09-25 20:01:04 +01:00
drunkendog c458f4e134 Merge pull request 'Enable multiline output in test checker' (#1) from multiline-output into main
Tests / Run-Tests (push) Successful in 7s Details
Benchmarks / Run-Benchmarks (push) Has been cancelled Details
Reviewed-on: #1
2023-09-25 19:59:09 +01:00
9 changed files with 243 additions and 12 deletions

View File

@ -6,10 +6,10 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Install time
- name: Install dependencies
run: |
apt-get update -y
apt-get install -y time
apt-get install -y time bc
- name: Check out repository code
uses: actions/checkout@v3
- run: cd ${{ github.workspace }}
@ -24,4 +24,13 @@ jobs:
- name: Run throughput benchmark
run: |
cd benchmark/
bash benchmark-throughput.sh python3 ../../run-tests.py
BENCHMARK_THROUGHPUT=$(bash benchmark-throughput.sh python3 ../../run-tests.py)
echo "BENCHMARK_THROUGHPUT=$BENCHMARK_THROUGHPUT" >> $GITHUB_ENV
echo "$BENCHMARK_THROUGHPUT"
- name: Update benchmark badge
if: needs.pr-check.outputs.number != 'null' && github.ref == 'refs/heads/main' && success()
run: |
curl -f -X 'GET' \
"https://badgeapi.docker.162536.xyz/set_badge/?repo=marmoset-test-cases&branch=main&action=throughput&new_badge=Throughput-$(echo "scale=2; $BENCHMARK_THROUGHPUT / 1024" | bc)%20kB/s-blue" \
-H 'accept: application/json' \
-H 'X-API-Key: ${{ secrets.BADGE_API_KEY }}'

View File

@ -1,6 +1,6 @@
# marmoset-test-cases
![](https://badgeapi.docker.162536.xyz/get_badge/?repo=marmoset-test-cases)
![](https://badgeapi.docker.162536.xyz/get_badge/?repo=marmoset-test-cases) ![](https://badgeapi.docker.162536.xyz/get_badge/?repo=marmoset-test-cases&branch=main&action=throughput)
## Setup

61
a2/functions-main.cases Normal file
View File

@ -0,0 +1,61 @@
1
1
1
1
2
1 2
3 4
1 2 4 3
1 2 4 3
3
1 2 3
4 5 6
7 8 9
1 2 3 6 9 8 7 4 5
1 3 9 7 2 6 8 4 5
4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
1 2 3 4 8 12 16 15 14 13 9 5 6 7 11 10
1 4 16 13 2 8 15 9 3 12 14 5 6 7 11 10
5
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
16 17 18 19 20
21 22 23 24 25
1 2 3 4 5 10 15 20 25 24 23 22 21 16 11 6 7 8 9 14 19 18 17 12 13
1 5 25 21 2 10 24 16 3 15 23 11 4 20 22 6 7 9 19 17 8 14 18 12 13
8
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16
17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48
49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64
1 2 3 4 5 6 7 8 16 24 32 40 48 56 64 63 62 61 60 59 58 57 49 41 33 25 17 9 10 11 12 13 14 15 23 31 39 47 55 54 53 52 51 50 42 34 26 18 19 20 21 22 30 38 46 45 44 43 35 27 28 29 37 36
1 8 64 57 2 16 63 49 3 24 62 41 4 32 61 33 5 40 60 25 6 48 59 17 7 56 58 9 10 15 55 50 11 23 54 42 12 31 53 34 13 39 52 26 14 47 51 18 19 22 46 43 20 30 45 35 21 38 44 27 28 29 37 36
11
1 2 3 4 5 6 7 8 9 10 11
12 13 14 15 16 17 18 19 20 21 22
23 24 25 26 27 28 29 30 31 32 33
34 35 36 37 38 39 40 41 42 43 44
45 46 47 48 49 50 51 52 53 54 55
56 57 58 59 60 61 62 63 64 65 66
67 68 69 70 71 72 73 74 75 76 77
78 79 80 81 82 83 84 85 86 87 88
89 90 91 92 93 94 95 96 97 98 99
100 101 102 103 104 105 106 107 108 109 110
111 112 113 114 115 116 117 118 119 120 121
1 2 3 4 5 6 7 8 9 10 11 22 33 44 55 66 77 88 99 110 121 120 119 118 117 116 115 114 113 112 111 100 89 78 67 56 45 34 23 12 13 14 15 16 17 18 19 20 21 32 43 54 65 76 87 98 109 108 107 106 105 104 103 102 101 90 79 68 57 46 35 24 25 26 27 28 29 30 31 42 53 64 75 86 97 96 95 94 93 92 91 80 69 58 47 36 37 38 39 40 41 52 63 74 85 84 83 82 81 70 59 48 49 50 51 62 73 72 71 60 61
1 11 121 111 2 22 120 100 3 33 119 89 4 44 118 78 5 55 117 67 6 66 116 56 7 77 115 45 8 88 114 34 9 99 113 23 10 110 112 12 13 21 109 101 14 32 108 90 15 43 107 79 16 54 106 68 17 65 105 57 18 76 104 46 19 87 103 35 20 98 102 24 25 31 97 91 26 42 96 80 27 53 95 69 28 64 94 58 29 75 93 47 30 86 92 36 37 41 85 81 38 52 84 70 39 63 83 59 40 74 82 48 49 51 73 71 50 62 72 60 61

126
a2/snake.cases Normal file
View File

@ -0,0 +1,126 @@
5
_XXH_
__XXH
6
_XXH_.
__XXH.
__XXXH
7
_XXH_._
__XXH._
__XXXH_
___XXXH
15
_XXH_._._._._._
__XXH._._._._._
__XXXH_._._._._
___XXXH._._._._
___XXXXH_._._._
____XXXXH._._._
____XXXXXH_._._
_____XXXXXH._._
_____XXXXXXH_._
______XXXXXXH._
______XXXXXXXH_
_______XXXXXXXH
99
_XXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__XXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__XXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
___XXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
___XXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
____XXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
____XXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_____XXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_____XXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
______XXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
______XXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_______XXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_______XXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
________XXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
________XXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_________XXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_________XXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__________XXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__________XXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
___________XXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
___________XXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
____________XXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
____________XXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_____________XXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_____________XXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
______________XXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
______________XXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_______________XXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_______________XXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
________________XXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
________________XXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_________________XXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_________________XXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__________________XXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
__________________XXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
___________________XXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
___________________XXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
____________________XXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
____________________XXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_____________________XXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._._
_____________________XXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._._
______________________XXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._._
______________________XXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._._
_______________________XXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._._
_______________________XXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._._
________________________XXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._._
________________________XXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._._
_________________________XXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._._
_________________________XXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._._
__________________________XXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._._
__________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._._
___________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._._
___________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._._
____________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._._
____________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._._
_____________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._._
_____________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._._
______________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._._
______________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._._
_______________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._._
_______________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._._
________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._._
________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._._
_________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._._
_________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._._
__________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._._
__________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._._
___________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._._
___________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._._
____________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._._
____________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._._
_____________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._._
_____________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._._
______________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._._
______________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._._
_______________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._._
_______________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._._
________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._._
________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._._
_________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._._
_________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._._
__________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._._
__________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._._
___________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._._
___________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._._
____________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._._
____________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._._
_____________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._._
_____________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._._
______________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._._
______________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._._
_______________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._._
_______________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_._
________________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH._
________________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH_
_________________________________________________XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXH

View File

@ -6,13 +6,13 @@ cd temp
cp "../benchmark-program-2.c" "benchmark-program-2.c"
for _ in {1..100000}
for _ in {1..5000}
do
int_get=$RANDOM
echo -e "${int_get}\n$((int_get))\n" >> "benchmark-program-2.cases"
done
export DEBIAN_FRONTEND=noninteractive
echo "$(($(stat -c '%s' benchmark-program-2.cases) / $(/usr/bin/time -f '%e' ${@:1} > /dev/null)))"
bc <<< "$(stat -c '%s' benchmark-program-2.cases) / $(/usr/bin/time -f '%e' ${@:1} 2>&1 > /dev/null)"
cd ../ && rm -rf temp/

View File

@ -4,14 +4,14 @@ set -e
mkdir temp
cd temp
for i in {1..10}
for i in {1..5}
do
cp "../benchmark-program-1.c" "benchmark-program-1-${i}.c"
done
for i in {1..10}
for i in {1..5}
do
for _ in {1..10000}
for _ in {1..1000}
do
int_get=$RANDOM
echo -e "${int_get}\n$((int_get + 123))\n" >> "benchmark-program-1-${i}.cases"

View File

@ -24,17 +24,17 @@ for file_name in glob.glob("*.c", recursive=False):
if should_continue != "y":
continue
subprocess.run(["gcc", "-o", "a.out", "-std=c11", "-Wall", "-g", file_name], check=True)
with open(next(x for x in file_list if os.path.splitext(file_name)[0] in x)) as f:
with open(next(x for x in file_list if os.path.splitext(file_name)[0] == os.path.basename(os.path.splitext(x)[0]))) as f:
to_run = f.read().strip().split("\n\n")
total_tests, passed_tests = 0, 0
for x in to_run:
x_split = x.split("\n", 1)
return_data = subprocess.run(["./a.out"], input=x_split[0].rstrip().encode(), capture_output=True).stdout.decode().rstrip()
test_passed_int = int(return_data == x_split[1].rstrip())
test_passed_int = int([z.rstrip() for z in return_data.rstrip().splitlines()] == [z.rstrip() for z in x_split[1].rstrip().splitlines()])
total_tests += 1
passed_tests += test_passed_int
print(f"\u001b[{31 + test_passed_int}m({x_split[0]})\u001b[0m")
if not passed_tests:
if not test_passed_int:
[print(x) for x in difflib.Differ().compare(x_split[1].splitlines(), return_data.splitlines())]
else:
[print(x) for x in return_data.splitlines()]

View File

@ -0,0 +1,24 @@
1
2
3
4
5
2
-2
2
-1
1
2
-1
10
10
10
10
12
12
12
12

View File

@ -0,0 +1,11 @@
#include <stdio.h>
int main(void) {
int input;
scanf("%d", &input);
printf("%d\n", input);
printf("%d\n", input);
printf("%d\n", input);
return 0;
}