File: functions.phpt.in

package info (click to toggle)
libvirt-php 0.5.8-7
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 3,140 kB
  • sloc: ansic: 9,352; sh: 4,578; php: 269; makefile: 219; xml: 93
file content (30 lines) | stat: -rw-r--r-- 673 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
	function bail($msg, $error_code = 1)
	{
		printf("[Error $error_code in %s] $msg\n", basename($_SERVER['SCRIPT_NAME']));
		exit($error_code);
	}

	function success($name = false) {
		if ($name == false)
			bail("Invalid test name!");

		printf("Test $name has been completed successfully\n");
		exit(0);
	}

	function skip($name = false) {
		if ($name == false)
			bail("Invalid test name!");

		printf("Test $name SKIPPED\n");
		exit(77);
	}

    $abs_srcdir = '@abs_srcdir@' ?: getcwd();

	if (!extension_loaded('libvirt')) {
		if (!dl('libvirt-php.so'))
			bail('Cannot load libvirt-php extension. Please install libvirt-php first (using `make install`)');
	}
?>