Esempio n. 1
0
def test_xcpp_matlab():
    """[XCPP-MATLAB]: """
    exec_cmd('excentury xc_test.xcpp to matlab --force')
    cmd = 'matlab -nodisplay -nosplash'
    run_cmd("%s < matlab/xc_test.m > /dev/null" % cmd, "", "")
    data = load_file('tmp.xc')
    eq_(data['x'], 4, "Failed...")
    eq_(data['y'], 27, "Failed...")
Esempio n. 2
0
def test_xcpp_cpp():
    """[XCPP-CPP]: """
    exec_cmd('excentury xc_test.xcpp to cpp --force')
    cmd = 'xc_test-timestwo.run "%s"' % to_text(x=2.0)
    exp_out = '0 1\nresult R 8 4.000000 \n'
    exp_err = ''
    run_cmd(cmd, exp_err, exp_out)
    cmd = 'xc_test-cube.run "%s"' % to_text(x=3)
    exp_out = '0 1\nresult I 4 27 \n'
    exp_err = ''
    run_cmd(cmd, exp_err, exp_out)
Esempio n. 3
0
def test_xcpp_python():
    """[XCPP-PYTHON]: """
    exec_cmd('excentury xc_test.xcpp to python --force')
    xc = __import__("xc_test")
    eq_(xc.timestwo(2.0), 4, "Failed...")
    eq_(xc.cube(3), 27, "Failed...")