Skip to content

Commit

Permalink
Fixed a typo in runUnitTests.sh (removed the .py reference in second …
Browse files Browse the repository at this point in the history
…test set).

Added test_Sequences.py logic (set_awg_dir) to invoke config.load_conifg() when config.AWGDir is undefined.
(when running as a stand-alone test, this case was causing failures).
  • Loading branch information
T.J.Rogers committed Dec 4, 2018
1 parent 3c72462 commit e124ef3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion runUnitTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ fi

echo ""
echo "#----- Testing LFS data file dependent QGL modules via ~:"
export CMD="python -m unittest tests.test_QGL tests.test_Sequences.py -v -f"
# Careful -- in this format (tests.moduleName) DON'T cite the .py suffix
# (it will render an odd error regarding missing 'py' attribute)
export CMD="python -m unittest tests.test_QGL tests.test_Sequences -v -f"
echo $CMD
echo ""
$CMD
Expand Down
12 changes: 12 additions & 0 deletions tests/test_Sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
from QGL.Channels import Edge, Measurement, LogicalChannel, LogicalMarkerChannel, PhysicalMarkerChannel, PhysicalQuadratureChannel
from QGL.drivers import APSPattern, APS2Pattern, TekPattern

# Pulled in logger to help debug stand-alone run issue with the config.AWGDir
# (the configuration was NOT gettng loaded when run independently)
#
import logging
logger = logging.getLogger( 'sequences')

class AWGTestHelper(object):
testFileDirectory = './tests/test_data/awg/'
Expand Down Expand Up @@ -93,6 +98,13 @@ def get_qubits(self):
def set_awg_dir(self, footer=""):
cn = self.__class__.__name__

if None == QGL.config.AWGDir:
logger.warning( "\n\r#----- EEE NULL QGL.config.AWGDir {%s} cited; calling load_config()...", QGL.config.AWGDir)
QGL.config.load_config()
logger.warning( "#----- Post load-config QGL.config.AWGDir: {%s}.\n\r", QGL.config.AWGDir)
#else:
# logger.warning( "\n\r#----- Using QGL.config.AWGDir {%s} 8-p", QGL.config.AWGDir)

self.awg_dir = os.path.abspath(QGL.config.AWGDir + os.path.sep + cn)
self.truth_dir = os.path.abspath(self.testFileDirectory + os.path.sep +
cn)
Expand Down

0 comments on commit e124ef3

Please sign in to comment.