Commit 95bcdbac authored by Marco Buttu's avatar Marco Buttu
Browse files

Added derotator simulator to SRT/Simulators/Components

parent bcbf014e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
PY_PACKAGES = DewarPositionerMockers DerotatorSimulator
PY_PACKAGES = DewarPositionerMockers

# CPP UNIT TESTING SETUP
#--------------
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              
    Name="SRTKBandDerotator"    
    Code="DerotatorSimulator.DerotatorSimulatorImpl"
    Code="SRTDerotatorSimImpl.SRTDerotatorSimImpl"
    Type="IDL:alma/Receivers/SRTKBandDerotator:1.0"
    ImplLang="py"
    Container="DerotatorContainer"
+24 −0
Original line number Diff line number Diff line
import os
import sys
import time
import unittest2
import subprocess

def run(test_case):
    # Use the simulators and the testing CDB
    server_name = 'receiverboard-sim' if test_case.telescope == 'SRT' else ''
    if not server_name:
        sys.exit(0) 

    FNULL = open(os.devnull, 'w')
    try:
        subprocess.Popen(['%s start' %server_name], stdout=FNULL, stderr=FNULL)
        time.sleep(1) # Give the server the time to start
        suite = unittest2.TestSuite()
        tests = unittest2.TestLoader().loadTestsFromTestCase(test_case)
        suite.addTests(tests)
        print 'Running the tests using the antenna simulators...'
        unittest2.TextTestRunner(verbosity=2).run(suite)
    finally:
        subprocess.Popen(['%s stop' %server_name], stdout=FNULL, stderr=FNULL)
        time.sleep(2) # Give the server the time to stop
+35 −0
Original line number Diff line number Diff line
#*****************************************
#-----------------------------------------
# Marco Buttu <mbuttu@oa-cagliari.inaf.it>
#-----------------------------------------
#*****************************************

PY_PACKAGES = SRTDerotatorSimImpl
PY_SCRIPTS = 

# -----------------
# Include Standards
# -----------------

MAKEDIRTMP := $(shell searchFile include/acsMakefile)
ifneq ($(MAKEDIRTMP),\#error\#)
   MAKEDIR := $(MAKEDIRTMP)/include
   include $(MAKEDIR)/acsMakefile
endif


# TARGETS
all:	do_all
	@echo " . . . 'all' done" 

clean : clean_all 
	$(RM) *.pyc SRTDerotatorSimImpl/*.pyc
	$(RM) ../lib ../bin ../config ../doc ../idl ../include \
		  ../object ../rtai ../test
	$(RM) $(INTROOT)/lib/python/site-packages/SRTDerotatorSimImpl*
	@echo " . . . clean done"

install : install_all
	@echo " . . . installation done"

#___oOo___
Loading