Skip to content

Commit 501583e

Browse files
committed
catch bug and update README
1 parent ca2ba33 commit 501583e

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

README.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,72 @@
11
# SweepFlaw demo
2+
3+
## Prerequisites
4+
### System requirement
5+
- git
6+
- make
7+
- clang
8+
- g++
9+
### Python requirement
10+
- `python >= 3.5`
11+
- `setuptools`
12+
- `torch >= 1.0` will be installed during installation process.
13+
214
## Install
315
```
16+
# If 'position-learning' and 'position_learning' directory exists at project root,
17+
# erase them before install.
418
make install
519
```
620
## Run Sample Scenario
721
```
822
make demo
923
```
10-
## Run Custom Scenario
24+
## Custom Scenario
25+
### Testcase Directory Structure
26+
You can see the example at `demodata/TC_1204B/input` and `demodata/TC_1204B/output`.
27+
It should be strictly followed.
28+
```
29+
$ tree demodata/TC_1204B/input
30+
demodata/TC_1204B/input
31+
├── 1
32+
├── 10
33+
├── 11
34+
├── 12
35+
├── 13
36+
├── 14
37+
├── 2
38+
├── 3
39+
├── 4
40+
├── 5
41+
├── 6
42+
├── 7
43+
├── 8
44+
└── 9
45+
46+
0 directories, 14 files
47+
```
48+
```
49+
$ tree demodata/TC_1204B/output
50+
demodata/TC_1204B/output
51+
├── 1
52+
├── 10
53+
├── 11
54+
├── 12
55+
├── 13
56+
├── 14
57+
├── 2
58+
├── 3
59+
├── 4
60+
├── 5
61+
├── 6
62+
├── 7
63+
├── 8
64+
└── 9
65+
66+
0 directories, 14 files
67+
```
68+
As you can see, the corresponding output of the input file `input/1` is `output/1`. You can configure related setting at `src/setting.py`'s `TESTCASE_STARTNUM`, `TESTCASE_PREFIX`, and `TESTCASE_POSTFIX`.
69+
### Run Custom Scenario
1170
```
1271
python3 app.py [Source File] [Input Testcase Directory] [Output Testcase Directory]
1372
```

src/modifyVscm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# 1. sorted vscm
66
# 2. the number of line-column pair from POSLEARN_APPFILE's output.
77
def applyNNResult(vscm, codeFilename):
8-
pr = subprocess.Popen(['python', POSLEARN_APPFILE, codeFilename, POSLEARN_MODE], cwd=POSLEARN_PROJ_DIR, stdout=subprocess.PIPE)
8+
pr = subprocess.Popen(['python3', POSLEARN_APPFILE, codeFilename, POSLEARN_MODE], cwd=POSLEARN_PROJ_DIR, stdout=subprocess.PIPE)
99
pr_out, pr_err = pr.communicate()
1010
pr_out = pr_out.decode("utf-8")
1111
rnnResult = list(set([(x.split(',')[0], x.split(',')[1]) for x in pr_out.split('\n')[1:-1]]))

src/setting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
INFO_PRINT = True
1515

1616
### Testcase Filenames
17-
TESTCASE_STARTNUM=1
17+
TESTCASE_STARTNUM = 1
1818
TESTCASE_PREFIX = ''
1919
TESTCASE_POSTFIX = ''
2020

0 commit comments

Comments
 (0)