File: functions.phpt.in

package info (click to toggle)
libvirt-php 0.5.4-3%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,504 kB
  • sloc: cpp: 11,159; ansic: 8,629; sh: 4,345; makefile: 184; xml: 93
file content (38 lines) | stat: -rw-r--r-- 849 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
<?php
	function bail($msg, $error_code = 1)
	{
		printf("[Error $error_code in %s] $msg\n", basename($_SERVER['SCRIPT_NAME']));
		exit($error_code);
	}

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

		printf("Test $name skipped. Possibly not supported by hypervisor\n");
		exit(0);
	}

	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(1);
	}

    $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`)');
	}
?>