Skip to content

Commit 947dffa

Browse files
[Testing:Plagiarism] basic tokenizer tests (#40)
* Initial rewrite of process_all.sh * Update process_all.sh * Make modifications to file paths and add timers * Overhaul concatenate_all.py * Fix python errors * Progress: everything through tokenization finished * Everything works * Add timers * remove unnecessary code * little python changes * William made an oopsie (forgot to deal with provided code) * Fix minor bugs Fix process_all.sh script plus fix spelling issue and prevent hash_all.py from breaking when empty tokenized files are written * Fix permissions issue with provided code editing * Add initial script * Update lichen_run.yml * Update lichen_run.yml * Update lichen_run.yml * Update lichen_run.yml * Update lichen_run.yml * add boost * add testing file * forgot that paths are important * Make separate setup.sh script * Update lichen_run.yml * Adjust file structure, add setup script * need sudo for test * Update tests.py * fix path * fix path * Update tests.py * add assertion to implement test * fix more paths * fix another path issue * Add second test * Update tests.py * it's important to run the right command to get the right results... * Add third test * Add remaining plaintext tokenizer tests * Add C tokenizer tests * Update lichen_run.yml * Update lichen_run.yml * Update lichen_run.yml * Add MIPS tokenizer * Update tests.py * Update tests.py * Fix paths in tests.py such that it can be run in vagrant * Fix github actions * Remove old code Co-authored-by: sbelsk <[email protected]>
1 parent 301a76d commit 947dffa

File tree

15 files changed

+192
-12
lines changed

15 files changed

+192
-12
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ exclude=
55

66
per-file-ignores =
77
tokenizer/mips/mips_tokenizer.py:W605
8+
tests/tests.py:E501

.github/workflows/lichen_run.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test Lichen
2+
3+
on: [push]
4+
5+
jobs:
6+
test-lichen:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
with:
12+
python-version: '3.6'
13+
- name: Install Dependencies
14+
run: |
15+
sudo apt install libboost-all-dev
16+
- name: Create Directory Structure
17+
run: |
18+
sudo bash ./tests/setup.sh
19+
- name: Run Tests
20+
run: |
21+
cd /usr/local/submitty/GIT_CHECKOUT/Lichen/tests
22+
sudo python3 -m unittest discover

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*~
22
tools/assignments/*
3+
tests/__pycache__
File renamed without changes.
File renamed without changes.

tokenizer/plaintext/expected_output/output.json renamed to tests/data/tokenizer/plaintext/expected_output/output.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"char": 20,
5252
"line": 3,
5353
"type": "number",
54-
"value": "1"
54+
"value": 1
5555
},
5656
{
5757
"char": 22,
@@ -159,7 +159,7 @@
159159
"char": 26,
160160
"line": 4,
161161
"type": "number",
162-
"value": "1"
162+
"value": 1
163163
},
164164
{
165165
"char": 27,
@@ -171,7 +171,7 @@
171171
"char": 28,
172172
"line": 4,
173173
"type": "number",
174-
"value": "2"
174+
"value": 2
175175
},
176176
{
177177
"char": 29,

tokenizer/plaintext/expected_output/output_ignore_newlines.json renamed to tests/data/tokenizer/plaintext/expected_output/output_ignore_newlines.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"char": 20,
4040
"line": 3,
4141
"type": "number",
42-
"value": "1"
42+
"value": 1
4343
},
4444
{
4545
"char": 22,
@@ -141,7 +141,7 @@
141141
"char": 26,
142142
"line": 4,
143143
"type": "number",
144-
"value": "1"
144+
"value": 1
145145
},
146146
{
147147
"char": 27,
@@ -153,7 +153,7 @@
153153
"char": 28,
154154
"line": 4,
155155
"type": "number",
156-
"value": "2"
156+
"value": 2
157157
},
158158
{
159159
"char": 29,

0 commit comments

Comments
 (0)