Executes a single doc-unit in its own program.

Used for docunits larger than a single block of code (with modules, classes, functions etc.)

Property definitions

nitc $ NitUnitExecutor :: test_single_docunit
	# Executes a single doc-unit in its own program.
	# Used for docunits larger than a single block of code (with modules, classes, functions etc.)
	fun test_single_docunit(du: DocUnit)
	do
		var file = generate_single_docunit(du)

		toolcontext.info("Compile doc-unit {du.full_name} in {file}", 1)

		if toolcontext.opt_noact.value then return

		var res = compile_unitfile(file)
		var content = "{file}.out1".to_path.read_all
		du.raw_output = content

		du.test_file = file

		if res != 0 then
			du.error = "Compilation error in {file}"
			toolcontext.modelbuilder.failed_entities += 1
			return
		end

		du.is_compiled = true
		execute_simple_docunit(du)
	end
src/testing/testing_doc.nit:241,2--265,4