Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Restructure tests directory #426

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,453 changes: 1,453 additions & 0 deletions tests/cc/config_cc_s17_direct_iq_cqasm1.2.json

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions tests/cc/test_cc_cqasm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# File: test_rus_private.py
# Purpose: test RUS using cQASM1.2
# Based on: test_structure_decomposition.py

import os
import unittest
#from utils import file_compare

import openql as ql


curdir = os.path.dirname(os.path.realpath(__file__))
output_dir = os.path.join(curdir, 'test_output')


class Test_cQASM(unittest.TestCase):

def run_test_case(self, name):
old_wd = os.getcwd()
try:
os.chdir(curdir)

in_fn = 'test_' + name + '.cq'
out_fn = 'test_output/' + name + '_out.cq'
gold_fn = 'golden/' + name + '_out.cq'

ql.initialize()
# ql.set_option('log_level', 'LOG_INFO')
ql.set_option('log_level', 'LOG_DEBUG')

if 0:
ql.set_option("write_qasm_files", "yes")
ql.set_option("write_report_files", "yes")
#ql.Pass.set_option()
# ql.Pass.set_option("ALL", "debug", "yes")
c = ql.Compiler()
if 0:
p = c.get_pass("sch.ListSchedule")
print(p.get_name())
p.set_option("debug", "yes")
if 0:
c.set_option('sch.ListSchedule.debug', 'yes')

# ql.compile(in_fn, {"debug": "yes"})
ql.compile(in_fn)

# self.assertTrue(file_compare(out_fn, gold_fn))

finally:
os.chdir(old_wd)

def test_rus_elements(self):
self.run_test_case('rus_elements')


if __name__ == '__main__':
unittest.main()
Loading