Skip to content

Commit 6d29b9e

Browse files
[Testing:Developer] Rework test suite to use pytest (#11)
Co-authored-by: William Allen <16820599+williamjallen@users.noreply.github.com>
1 parent d3dc844 commit 6d29b9e

15 files changed

Lines changed: 91 additions & 83 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test/data/**/* -linguist-detectable
1+
tests/fixtures/**/* -linguist-detectable

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- name: Build executable
1414
run: bash ./build.sh
15+
- name: install dev dependencies
16+
run: python3 -m pip install -r requirements_dev.txt
1517
- name: run tests
16-
run: python3 testRunner.py
18+
run: pytest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include/
22
build/
3+
__pycache__/

requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest

testRunner.py

Lines changed: 0 additions & 30 deletions
This file was deleted.

testSuite/commands.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

tests/__init__.py

Whitespace-only changes.

tests/fixtures/commands.json

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"🔥.py": [
3+
["call", "print", 1],
4+
["node", "for", 2],
5+
["node", "continue", 1],
6+
["node", "break", 1],
7+
["node", "if", 1],
8+
["node", "elif", 1]
9+
],
10+
"max.c": [
11+
["identifier", "num1", 5],
12+
["call", "max", 1],
13+
["call", "printf", 1],
14+
["node", "return", 3],
15+
["node", "if", 1],
16+
["node", "else", 1],
17+
["function", "max", 1]
18+
],
19+
"solution.cpp": [
20+
["call", "cout", 1],
21+
["call", "erase", 1],
22+
["call", "begin", 1],
23+
["identifier", "numbers", 4]
24+
],
25+
"solution.py": [
26+
["call", "print", 2],
27+
["call", "age", 1],
28+
["function", "age", 1],
29+
["call", "dog", 1],
30+
["node", "class", 1],
31+
["identifier", "dog", 6]
32+
],
33+
"oop.java": [
34+
["node", "interface", 1],
35+
["node", "abstract", 1],
36+
["node", "extends", 1],
37+
["function", "sound", 2],
38+
["call", "println", 2],
39+
["call", "sound", 1],
40+
["identifier", "Dog", 3]
41+
],
42+
"fibonacci.java": [
43+
["node", "if", 1],
44+
["node", "for", 1],
45+
["node", "+", 4],
46+
["function", "printFibonacci", 1],
47+
["call", "print", 2],
48+
["identifier", "fibonacci", 2],
49+
["identifier", "Fibonacci", 4]
50+
]
51+
}
File renamed without changes.

0 commit comments

Comments
 (0)