model2tex1.gms : model2tex가 tex 파일을 생성하는지 테스트

설명

기고자: Clemens Westphal

소형 모델 유형 :슬롯


카테고리 : 슬롯 테스트 라이브러리


메인 파일 : model2tex1.gms

$title model2tex가 tex 파일(MODEL2TEX1,SEQ=678)을 생성하는지 테스트합니다.
* 기여자: 클레멘스 베스트팔

$ifThenI %system.platform% == WEX $set m2t model2tex.cmd
$else $set m2t model2tex.sh
$endIf

$call gamslib -q trnsport
$if errorlevel 1 $abort가 trnsport를 검색할 수 없습니다.
$call rm -f Transport.tex alloc1.tex alloc1_landscape.tex

$call 슬롯 tnsport lo=%슬롯lo% docFile=운송
$if errorlevel 1 $abort가 trnsport를 컴파일할 수 없습니다.

$call %m2t% 전송 > %system.nullfile%
$if errorlevel 1 $abort가 model2tex를 실행할 수 없습니다.
$ 존재하지 않는 경우 Transport.tex $abort TeX 파일이 생성되지 않습니다.

$call gamslib -q 항공기
$if errorlevel 1 $abort가 항공기를 검색할 수 없습니다.
$call rm -f Aircraft.tex alloc1.tex

$call 슬롯 항공기 lo=%슬롯lo% docFile=항공기
$if errorlevel 1 $abort가 항공기를 컴파일할 수 없습니다.

$call %m2t% -m=alloc1 -o=alloc1.tex 항공기 > %system.nullfile%
$if errorlevel 1 $abort가 model2tex를 실행할 수 없습니다.
$존재하지 않는 경우 alloc1.tex $abort TeX 파일이 생성되지 않습니다.

$onEmbeddedCode 파이썬:
  JSON 가져오기
  jsonFile = 'aircraft.json'
  open(jsonFile, 'r')을 f로 사용:
    s = f.read()
  정보 = json.loads(들)
  info['landscape'] = 참
  s = json.dumps(정보, 들여쓰기 = 4)
  open(jsonFile, 'w')를 f로 사용:
    f.쓰기
$offEmbeddedCode

$ %m2t% -m=alloc1 -o=alloc1_landscape.tex 항공기 호출 > %system.nullfile%
$ 오류 수준 1인 경우 $abort가 model2tex를 실행할 수 없습니다.
$ 존재하지 않는 경우 alloc1_landscape.tex $abort TeX 파일이 생성되지 않습니다.

$onEmbeddedCode 파이썬:
  open('alloc1_landscape.tex', 'r')을 f로 사용:
    s = f.read()
    s에 r'\usepackage[landscape]'가 없으면:
      raise Exception("'alloc1_landscape.tex'에서 'landscape' 패키지를 찾을 수 없습니다.")
$offEmbeddedCode