-
Notifications
You must be signed in to change notification settings - Fork 0
/
homework.yml
149 lines (147 loc) Β· 6.07 KB
/
homework.yml
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
folder: homeworks/
homeworks:
- name: "Example homework"
folder: "example_homework"
tasks:
- name: Example task
folder: example_task
tests:
- name: Ls output test
cmd: bash commands.sh
expected_output: commands.sh
- name: Copy of the example (fill me)
folder: example_task_copy
tests:
- name: Ls output test
cmd: bash commands.sh
expected_output: commands.sh
- name: Homework 1
folder: homework_1
tasks:
- name: Print hello world
folder: hello_world
tests:
- name: Build binary
cmd: c++ -std=c++17 hello.cpp -o hello
- name: Output is correct
cmd: ./hello
expected_output: Hello World!
- name: Homework 2
folder: homework_2
tasks:
- name: Fortune teller
folder: fortune_teller
tests:
- name: Build binary
cmd: c++ -std=c++17 fortune_teller.cpp -o fortune_teller
- name: Fortune telling checks out for you in spring
cmd: echo You spring fearless clever | ./fortune_teller
expected_output: |
Welcome to the fortune teller program!
Please enter your name:
Please enter the time of year when you were born:
(pick from 'spring', 'summer', 'autumn', 'winter')
Please enter an adjective:
Please enter another adjective:
Here is your description:
You, the clever STL guru that eats UB for breakfast
- name: Fortune telling checks out for me in autumn
cmd: echo I autumn fearless clever | ./fortune_teller
expected_output: |
Welcome to the fortune teller program!
Please enter your name:
Please enter the time of year when you were born:
(pick from 'spring', 'summer', 'autumn', 'winter')
Please enter an adjective:
Please enter another adjective:
Here is your description:
I, the clever coding beast that finds errors quicker than the compiler
- name: Homework 3
folder: homework_3
tasks:
- name: Guessing game
folder: guessing_game
tests:
- name: Build binary
cmd: c++ -std=c++17 guessing_game.cpp -o guessing_game
- name: Guess 1 out of 1 numbers
cmd: echo 1 1 1 | ./guessing_game
timeout: 5.0
expected_output: |
Welcome to the GUESSING GAME!
I will generate a number and you will guess it!
Please provide the smallest number:
Please provide the largest number:
I've generated a number. Try to guess it!
Please provide the next guess: You've done it! You guessed the number 1 in 1 guesses!
- name: Guess after some searching
cmd: echo 1 1 0 2 1 | ./guessing_game
timeout: 5.0
expected_output: |
Welcome to the GUESSING GAME!
I will generate a number and you will guess it!
Please provide the smallest number:
Please provide the largest number:
I've generated a number. Try to guess it!
Please provide the next guess: Your number is too small. Try again!
Please provide the next guess: Your number is too big. Try again!
Please provide the next guess: You've done it! You guessed the number 1 in 3 guesses!
- name: Homework 4
folder: homework_4
tasks:
- name: Strings processing library
folder: no_strings_attached
tests:
- name: Configure CMake
cmd: cmake -D UPDATE_SUBMODULES=NO -D CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" -S . -B build
- name: Build code
cmd: cmake --build build -j 2
- name: Run your tests
cmd: ctest --test-dir build --output-on-failure -j 2
- name: Inject and build validation tests
cmd: |
cp -r ${JOB_ROOT}/inject/homework_4/validation_tests validation_tests &&
echo "add_subdirectory(validation_tests)" >> CMakeLists.txt &&
cmake --build build -j 2
- name: Run your and validation tests
cmd: ctest --test-dir build --output-on-failure -j 2
- name: Strings processing binaries
folder: no_strings_attached
tests:
- name: Configure CMake
cmd: cmake -D UPDATE_SUBMODULES=NO -D CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" -S . -B build
- name: Build code
cmd: cmake --build build -j 2
- name: Split string
cmd: echo "hello world" | ./build/examples/split_strings
expected_output: |
Example program that splits strings.
Please enter a string:
Your split string: 'hello' 'world'
- name: Trim string
cmd: echo " hello world " | ./build/examples/trim_strings
expected_output: |
Example program that trims strings.
Please enter a string:
Your trimmed string: 'hello world'
- name: Homework 5
folder: homework_5
tasks:
- name: Pixelator build
folder: pixelator
tests:
- name: Configure CMake
cmd: cmake -D UPDATE_SUBMODULES=NO -D CMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" -S . -B build
- name: Build code
cmd: cmake --build build -j 2
- name: Run your tests
cmd: ctest --test-dir build --output-on-failure -j 2
- name: Inject and build validation tests
cmd: |
cp -r ${JOB_ROOT}/inject/homework_5/validation_tests validation_tests &&
echo "add_subdirectory(validation_tests)" >> CMakeLists.txt &&
cmake --build build -j 2
- name: Run your and validation tests
cmd: ctest --test-dir build --output-on-failure -j 2
- name: Pixelate an image
cmd: ./build/examples/pixelate pixelator/test_data/test.png