

def test_stage_script(qibuild_action, tmpdir):
    qibuild_action.add_test_project('world')
    project = qibuild_action.add_test_project('stagescript')
    qibuild_action('configure', 'stagescript')
    qibuild_action('make', 'stagescript')
    run_python_script(os.path.join(project.sdk_directory, 'bin', 'check_qipath'))
    run_python_script(os.path.join(project.sdk_directory, 'bin', 'dlopenfoo'))
    run_python_script(os.path.join(project.sdk_directory, 'bin', 'dlopenbar'))
    run_python_script(os.path.join(project.sdk_directory, 'bin', 'dlopenworlduser'))
    qibuild_action('install', 'stagescript', tmpdir.strpath)
    with pytest.raises(qisys.error.Error):
        run_python_script(os.path.join(tmpdir.strpath, 'bin', 'check_qipath'))
    run_python_script(os.path.join(tmpdir.strpath, 'bin', 'dlopenfoo'))
    run_python_script(os.path.join(tmpdir.strpath, 'bin', 'dlopenbar'))
    run_python_script(os.path.join(tmpdir.strpath, 'bin', 'dlopenworlduser'))
    qibuild_action.add_test_project('stagescript-user')
    qibuild_action('configure', 'stagescript-user')
    qibuild_action('make', 'stagescript-user')
    os.chdir('..')
    run_python_script(os.path.join(tmpdir.strpath, 'bin', 'dlopenfoo'))
    run_python_script(os.path.join(tmpdir.strpath, 'bin', 'dlopenbar'))
    run_python_script(os.path.join(tmpdir.strpath, 'bin', 'dlopenworlduser'))

dataset/ETHPy150Open aldebaran/qibuild/python/qibuild/test/test_qibuild_stage_script.py test_stage_script/original