Ejemplo n.º 1
0
import sys

### LOAD GSLAB MAKE
ROOT = '..'
gslm_path = os.path.join(ROOT, 'lib', 'gslab_make')

sys.path.append(gslm_path)
import gslab_make as gs

### PULL PATHS FROM CONFIG
PATHS = {'root': ROOT, 'config': os.path.join(ROOT, 'config.yaml')}
PATHS = gs.update_internal_paths(PATHS)

### LOAD CONFIG USER
PATHS = gs.update_external_paths(PATHS)
gs.update_executables(PATHS)

############
### MAKE ###
############

### START MAKE
gs.remove_dir(['input', 'external'])
gs.clear_dir(['output', 'log'])
gs.start_makelog(PATHS)

### MAKE LINKS TO INPUT AND EXTERNAL FILES
inputs = gs.link_inputs(PATHS, ['input.txt'])
externals = gs.link_externals(PATHS, ['external.txt'])
gs.write_source_logs(PATHS, inputs + externals)
gs.get_modified_sources(PATHS, inputs + externals)
Ejemplo n.º 2
0
 def test_error_bad_os(self):
     PATHS = {'config_user': '******'}
     with self.assertRaises(Exception):
         update_executables(PATHS, osname='bad_os')
Ejemplo n.º 3
0
 def test_error_bad_paths(self):
     PATHS = {}
     with self.assertRaises(Exception):
         update_executables(PATHS)
Ejemplo n.º 4
0
 def test_error_config_missing(self):
     PATHS = {'config_user': '******'}
     with self.assertRaises(Exception):
         update_executables(PATHS)
Ejemplo n.º 5
0
 def test_config_empty(self):
     PATHS = {'config_user': '******'}
     update_executables(PATHS)
Ejemplo n.º 6
0
 def test_config_character(self):
     PATHS = {'config_user': '******'}
     update_executables(PATHS)