Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.

Commit a9a44f1

Browse files
committed
Testing works (and library is passing)
1 parent 6ba08b3 commit a9a44f1

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

resources/tests/data/library-cross.db

296 KB
Binary file not shown.

resources/tests/runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@ def main():
44
os.system("python3 select.py")
55
num = 1
66
token = ""
7+
db = "library.db"
78
with open("test-queries.txt", "r") as queries:
89
for query in queries:
910
query = query.strip()
1011
if query[0] != "s":
1112
token = query
13+
if query == "CROSS":
14+
db = "library-cross.db"
1215
continue
1316
q = open("query.txt", "w")
1417
q.write(query + "\n")
1518
q.close()
1619
os.system("python3 compose.py")
1720
os.system("g++ -std=c++2a " + "-D" + token + " -O3 -I../../include -o test test.cpp")
1821
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")
2023
stream = os.popen("diff cpp-results.txt sql-results.txt")
2124
res = "Passed"
2225
for line in stream:

resources/tests/select.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def main():
1111
if random.random() < h:
1212
outfile.write(line)
1313
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)
1914
outfile.write("NATURAL\n")
2015
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:
2121
for line in infile:
2222
if random.random() < h:
2323
outfile.write(line)

0 commit comments

Comments
 (0)