This repository was archived by the owner on Apr 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -4,19 +4,22 @@ def main():
4
4
os .system ("python3 select.py" )
5
5
num = 1
6
6
token = ""
7
+ db = "library.db"
7
8
with open ("test-queries.txt" , "r" ) as queries :
8
9
for query in queries :
9
10
query = query .strip ()
10
11
if query [0 ] != "s" :
11
12
token = query
13
+ if query == "CROSS" :
14
+ db = "library-cross.db"
12
15
continue
13
16
q = open ("query.txt" , "w" )
14
17
q .write (query + "\n " )
15
18
q .close ()
16
19
os .system ("python3 compose.py" )
17
20
os .system ("g++ -std=c++2a " + "-D" + token + " -O3 -I../../include -o test test.cpp" )
18
21
os .system ("./test | sort > cpp-results.txt" )
19
- os .system ("sqlite3 data/library.db \" " + query + ";\" | sort > sql-results.txt" )
22
+ os .system ("sqlite3 data/" + db + " \" " + query + ";\" | sort > sql-results.txt" )
20
23
stream = os .popen ("diff cpp-results.txt sql-results.txt" )
21
24
res = "Passed"
22
25
for line in stream :
Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ def main():
11
11
if random .random () < h :
12
12
outfile .write (line )
13
13
h = 500 / 700000
14
- outfile .write ("CROSS\n " )
15
- with open ("cross-queries.txt" , "r" ) as infile :
16
- for line in infile :
17
- if random .random () < h :
18
- outfile .write (line )
19
14
outfile .write ("NATURAL\n " )
20
15
with open ("natural-queries.txt" , "r" ) as infile :
16
+ for line in infile :
17
+ if random .random () < h :
18
+ outfile .write (line )
19
+ outfile .write ("CROSS\n " )
20
+ with open ("cross-queries.txt" , "r" ) as infile :
21
21
for line in infile :
22
22
if random .random () < h :
23
23
outfile .write (line )
You can’t perform that action at this time.
0 commit comments