def test_wafwithstpl(wafbuildwithstpl): ''' Run Waf for the case when a main file exists as template (``.stpl``). ''' target=wafbuildwithstpl[1] if target=='docx': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─docx │ ├─dd.docx │ ├─ra.docx │ ├─sr.docx │ └─tp.docx └─config.log""" elif target=='pdf': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─pdf │ ├─dd.pdf │ ├─ra.pdf │ ├─sr.pdf │ └─tp.pdf └─config.log""" elif target=='html': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─html │ ├─.doctrees │ ├─_images │ ├─_sources │ ├─_static │ ├─dd.html │ ├─genindex.html │ ├─index.html │ ├─objects.inv │ ├─ra.html │ ├─search.html │ ├─searchindex.js │ ├─sr.html │ └─tp.html └─config.log""" assert tree(wafbuildwithstpl[0],with_dot_files=False,max_depth=3)==expected
def test_makenostpl(makebuild): ''' Run make with the sample Makefile. ''' target=makebuild[1] if target=='docx': expected="""\ ├─code │ └─some_tst.c └─doc └─docx ├─dd.docx ├─ra.docx ├─sr.docx └─tp.docx""" elif target=='pdf': expected="""\ ├─code │ └─some_tst.c └─doc └─pdf ├─dd.pdf ├─ra.pdf ├─sr.pdf └─tp.pdf""" elif target=='html': expected="""\ ├─code │ └─some_tst.c └─doc ├─doctrees │ ├─dd.doctree │ ├─environment.pickle │ ├─index.doctree │ ├─ra.doctree │ ├─sr.doctree │ └─tp.doctree └─html ├─_sources ├─_static ├─dd.html ├─genindex.html ├─index.html ├─objects.inv ├─ra.html ├─search.html ├─searchindex.js ├─sr.html └─tp.html""" assert tree(makebuild[0],with_dot_files=False,max_depth=3)==expected
def test_wafrststpl(wafrststpl): ''' Run Waf for the case when an included file exists as template (``.stpl``). ''' target=wafrststpl[1] if target=='docx': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─docx │ ├─dd.docx │ ├─is.docx │ ├─ra.docx │ ├─sr.docx │ └─tp.docx └─config.log""" elif target=='pdf': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─pdf │ ├─dd.pdf │ ├─is.pdf │ ├─ra.pdf │ ├─sr.pdf │ └─tp.pdf └─config.log""" elif target=='html': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─html │ ├─.doctrees │ ├─_images │ ├─_sources │ ├─_static │ ├─dd.html │ ├─genindex.html │ ├─index.html │ ├─is.html │ ├─objects.inv │ ├─ra.html │ ├─search.html │ ├─searchindex.js │ ├─sr.html │ └─tp.html └─config.log""" assert tree(wafrststpl[0],with_dot_files=False,max_depth=3)==expected assert sys.platform in open(glob.glob(os.path.join('..','src','doc','is1.rst'))[0],encoding='utf-8').read() if target=='html': assert sys.platform in open(glob.glob(os.path.join('doc',target,'is.*'))[0],encoding='utf-8').read()
def test_wafnostpl(wafbuild): ''' Run Waf on the sample project. Waf needs to be installed - either in the system or - added manually to the root folder of the project ''' target=wafbuild[1] if target=='docx': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─docx │ ├─dd.docx │ ├─ra.docx │ ├─sr.docx │ └─tp.docx └─config.log""" elif target=='pdf': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─pdf │ ├─dd.pdf │ ├─ra.pdf │ ├─sr.pdf │ └─tp.pdf └─config.log""" elif target=='html': expected="""\ ├─c4che │ ├─_cache.py │ └─build.config.py ├─code │ └─some_tst.c ├─doc │ └─html │ ├─.doctrees │ ├─_images │ ├─_sources │ ├─_static │ ├─dd.html │ ├─genindex.html │ ├─index.html │ ├─objects.inv │ ├─ra.html │ ├─search.html │ ├─searchindex.js │ ├─sr.html │ └─tp.html └─config.log""" assert tree(wafbuild[0],with_dot_files=False,max_depth=3)==expected
def test_init(rstsamples): ''' Tests |dcx.mktree|. Check tree created by ``rstdcx --init smpl`` ''' assert tree('.')=="""\