MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
have_ndbjtie_junit.inc
1 --perl
2 use strict;
3 
4 use File::Basename;
5 use IO::File;
6 use lib "lib/";
7 use My::Find;
8 
9 #
10 # Look for ndbjtie JUnit tests, if not found: skip test.
11 #
12 
13 #
14 # Set up paths
15 #
16 my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR";
17 my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR";
18 my $basedir = dirname($mysql_test_dir);
19 
20 #
21 # Check if the needed tests are available
22 #
23 my $jtie_junit = my_find_file($basedir,
24  ["storage/ndb/src/ndbjtie/test", "share/mysql/java"],
25  "ndbjtie-test-*.jar", NOT_REQUIRED);
26 
27 my $jtie_unload_junit = my_find_file($basedir,
28  ["storage/ndb/src/ndbjtie/jtie/test/unload", "share/mysql/java"],
29  "jtie-test-unload-*.jar", NOT_REQUIRED);
30 
31 my $F = IO::File->new("$vardir/tmp/have_ndbjtie_junit_result.inc", "w") or die;
32 if ($jtie_junit) {
33  my $jtie_junit_dir = dirname($jtie_junit);
34  print $F "--let \$NDBJTIE_JUNIT= $jtie_junit_dir\n";
35  print $F "--let \$NDBJTIE_JUNIT_JAR= $jtie_junit\n";
36  print $F "--let \$NDBJTIE_UNLOAD_JUNIT_JAR= $jtie_unload_junit\n";
37  print $F "--echo Found NDB JTie JUnit tests: '\$NDBJTIE_JUNIT_JAR'\n"
38 } else {
39  print $F "skip Could not find NDB JTie JUnit tests\n";
40 }
41 $F->close();
42 
43 EOF
44 
45 --source $MYSQLTEST_VARDIR/tmp/have_ndbjtie_junit_result.inc