summaryrefslogtreecommitdiffstats
path: root/test/check.pl
diff options
context:
space:
mode:
Diffstat (limited to 'test/check.pl')
-rwxr-xr-xtest/check.pl42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/check.pl b/test/check.pl
new file mode 100755
index 0000000..a09d143
--- /dev/null
+++ b/test/check.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use lib qw(/usr/lib/libDrakX);
+use Xconfig::glx;
+use Data::Dumper;
+
+my %free = (
+ r300 => [ qw(direct_rendering native) ],
+ i810 => [ qw(direct_rendering native Xgl) ],
+ nv => [],
+);
+my %proprietary = (
+ nvidia => [ qw(direct_rendering Xgl) ],
+ nvidia_legacy => [ qw(direct_rendering Xgl) ],
+ nvidia_native => [ qw(direct_rendering native Xgl) ],
+ fglrx => [ qw(direct_rendering Xgl) ],
+);
+
+sub check_driver {
+ my ($driver, $proprietary) = @_;
+ foreach my $server (qw(Xorg Xgl)) {
+ my $mesa_file = "glxinfo.$driver-mesa-$server.txt";
+ -f $mesa_file or warn "unable to read $mesa_file", next;
+ my $proprietary_file;
+ if ($proprietary) {
+ $proprietary_file = "glxinfo.$driver-$driver-$server.txt";
+ -f $proprietary_file or die "unable to read $proprietary_file";
+ }
+ my $glx_status = Xconfig::glx::get_glx_status($mesa_file, $proprietary_file);
+ print join("\n",
+ "* $driver, $server",
+ "detected Mesa: $glx_status->{context}{Mesa}",
+ "detected Xgl: $glx_status->{context}{Xgl}",
+ "capabilities: " . join(", ", grep { $glx_status->{capabilities}{$_} } keys %{$glx_status->{capabilities}}),
+ "",
+ );
+ ($server eq 'Xgl') == $glx_status->{context}{Xgl} or die Dumper($glx_status) . "Xgl detection mismatch for $driver-$server";
+ }
+}
+
+check_driver($_) foreach sort(keys %free);
+check_driver($_, 1) foreach sort(keys %proprietary);