<s> import unittest <EOL> from conans . test . tools import TestClient <EOL> from conans . model . ref import ConanFileReference , PackageReference <EOL> import os <EOL> from conans . paths import CONANFILE <EOL> import platform <EOL> import time <EOL> from conans . test . utils . cpp_test_files import cpp_hello_conan_files <EOL> from nose . plugins . attrib import attr <EOL> from conans . test . utils . test_files import temp_folder <EOL> @ attr ( "<STR_LIT>" ) <EOL> class MultiBuildTest ( unittest . TestCase ) : <EOL> def reuse_test ( self ) : <EOL> conan_reference = ConanFileReference . loads ( "<STR_LIT>" ) <EOL> files = cpp_hello_conan_files ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> client = TestClient ( ) <EOL> client . save ( files ) <EOL> client . run ( "<STR_LIT>" ) <EOL> configs = [ ] <EOL> if platform . system ( ) == "<STR_LIT>" : <EOL> configs . append ( ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> for compiler , compiler_version in configs : <EOL> client . default_settings ( compiler , compiler_version ) <EOL> client . run ( "<STR_LIT>" % str ( conan_reference ) ) <EOL> package_ids = client . paths . conan_packages ( conan_reference ) <EOL> self . assertEquals ( len ( package_ids ) , len ( configs ) ) <EOL> for package_id in package_ids : <EOL> package_ref = PackageReference ( conan_reference , package_id ) <EOL> self . _assert_library_exists ( package_ref , client . paths ) <EOL> conan_reference = ConanFileReference . loads ( "<STR_LIT>" ) <EOL> files3 = cpp_hello_conan_files ( "<STR_LIT>" , "<STR_LIT>" , [ "<STR_LIT>" ] ) <EOL> client . current_folder = temp_folder ( ) <EOL> client . save ( files3 ) <EOL> for compiler , compiler_version in configs : <EOL> client . default_settings ( compiler , compiler_version ) <EOL> client . run ( '<STR_LIT>' ) <EOL> client . run ( '<STR_LIT>' ) <EOL> command = os . sep . join ( [ "<STR_LIT:.>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> client . runner ( command , cwd = client . current_folder ) <EOL> self . assertIn ( "<STR_LIT>" , client . user_io . out ) <EOL> self . assertIn ( "<STR_LIT>" , client . user_io . out ) <EOL> new_conanfile = files3 [ CONANFILE ] . replace ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> for compiler , compiler_version in configs : <EOL> client . default_settings ( compiler , compiler_version ) <EOL> client . save ( { CONANFILE : new_conanfile } ) <EOL> client . run ( '<STR_LIT>' ) <EOL> client . run ( '<STR_LIT>' ) <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> client . runner ( command , cwd = client . current_folder ) <EOL> self . assertIn ( "<STR_LIT>" , client . user_io . out ) <EOL> self . assertIn ( "<STR_LIT>" , client . user_io . out ) <EOL> def _assert_library_exists ( self , package_ref , paths ) : <EOL> package_path = paths . package ( package_ref ) <EOL> self . assertTrue ( os . path . exists ( os . path . join ( package_path , "<STR_LIT>" ) ) ) <EOL> libraries = os . listdir ( os . path . join ( package_path , "<STR_LIT>" ) ) <EOL> self . assertEquals ( len ( libraries ) , <NUM_LIT:1> ) <EOL> self . assertTrue ( os . path . basename ( libraries [ <NUM_LIT:0> ] ) . startswith ( "<STR_LIT>" ) ) </s>
