Skip to content

Commit

Permalink
Add package for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Sep 16, 2023
1 parent 90d1a30 commit f415118
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/packages/undocumented_options/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Package with undocumented sinol-make options
sinol_task_id: und

sinol_undocumented_time_tool: time
sinol_undocumented_test_limits: true

memory_limit: 10240
time_limit: 1000
time_limits:
1a: 5000

sinol_expected_scores:
und.cpp:
expected: {1: OK}
points: 100
und1.cpp:
expected: {1: OK}
points: 100
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions tests/packages/undocumented_options/prog/und.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
int a, b;
cin >> a >> b;
cout << a + b;
}
14 changes: 14 additions & 0 deletions tests/packages/undocumented_options/prog/und1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <bits/stdc++.h>
#include <chrono>

using namespace std;
using namespace std::chrono_literals;

int main() {
int a, b;
cin >> a >> b;
if (a == 1 && b == 1) {
this_thread::sleep_for(3s);
}
cout << a + b << endl;
}
13 changes: 13 additions & 0 deletions tests/packages/undocumented_options/prog/undingen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
ofstream f("und1a.in");
f << "1 1\n";
f.close();

f.open("und1b.in");
f << "2 2\n";
f.close();
}
7 changes: 7 additions & 0 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def get_long_name_package_path():
return os.path.join(os.path.dirname(__file__), "packages", "long_package_name")


def get_undocumented_options_package_path():
"""
Get path to package with undocumented options in config.yml (/test/packages/undoc)
"""
return os.path.join(os.path.dirname(__file__), "packages", "undocumented_options")


def create_ins(package_path):
"""
Create .in files for package.
Expand Down

0 comments on commit f415118

Please sign in to comment.