summaryrefslogtreecommitdiff
path: root/mysql-test/t/file_contents.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
commit9809f05199aeb0b67991fac41bd86f38730768dc (patch)
treefa2792ff86d0da014b535d743759810612338042 /mysql-test/t/file_contents.test
parent0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff)
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
downloadmariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz
5.5-merge
Diffstat (limited to 'mysql-test/t/file_contents.test')
-rw-r--r--mysql-test/t/file_contents.test68
1 files changed, 68 insertions, 0 deletions
diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test
new file mode 100644
index 00000000000..33cd65fb2b4
--- /dev/null
+++ b/mysql-test/t/file_contents.test
@@ -0,0 +1,68 @@
+#
+# Testing files that were built to be packaged, both for existence and for contents
+#
+
+#
+# Bug #42969: Create MANIFEST files
+#
+# Use a Perl script to verify that files "docs/INFO_BIN" and "docs/INFO_SRC" do exist
+# and have the expected contents.
+
+--perl
+print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
+$dir_bin = $ENV{'MYSQL_BINDIR'};
+if ($dir_bin =~ m|/usr/|) {
+ # RPM package
+ $dir_docs = $dir_bin;
+ $dir_docs =~ s|/lib|/share/doc|;
+ if(-d "$dir_docs/packages/MySQL-server") {
+ # SuSE
+ $dir_docs = "$dir_docs/packages/MySQL-server";
+ } else {
+ # RedHat: version number in directory name
+ $dir_docs = glob "$dir_docs/MySQL-server*";
+ }
+} elsif ($dir_bin =~ m|/usr$|) {
+ # RPM build during development
+ $dir_docs = "$dir_bin/share/doc";
+ if(-d "$dir_docs/packages/MySQL-server") {
+ # SuSE
+ $dir_docs = "$dir_docs/packages/MySQL-server";
+ } else {
+ # RedHat: version number in directory name
+ $dir_docs = glob "$dir_docs/MySQL-server*";
+ }
+} else {
+ # tar.gz package, Windows, or developer work (in BZR)
+ $dir_docs = $dir_bin;
+ $dir_docs =~ s|/lib||;
+ if(-d "$dir_docs/docs") {
+ $dir_docs = "$dir_docs/docs"; # package
+ } else {
+ $dir_docs = "$dir_docs/Docs"; # development tree
+ }
+}
+$found_version = "No line 'MySQL source #.#.#'";
+$found_revision = "No line 'revision-id: .....'";
+open(I_SRC,"<","$dir_docs/INFO_SRC") or print "Cannot open 'INFO_SRC' in '$dir_docs' (starting from bindir '$dir_bin')\n";
+while(defined ($line = <I_SRC>)) {
+ if ($line =~ m|^MySQL source \d\.\d\.\d+|) {$found_version = "Found MySQL version number";}
+ if ($line =~ m|^revision-id: .*@.*-2\d{13}-\w+$|) {$found_revision = "Found BZR revision id";}
+}
+close I_SRC;
+print "INFO_SRC: $found_version / $found_revision\n";
+$found_compiler = "No line about compiler information";
+$found_features = "No line 'Feature flags'";
+open(I_BIN,"<","$dir_docs/INFO_BIN") or print "Cannot open 'INFO_BIN' in '$dir_docs' (starting from bindir '$dir_bin')\n";
+while(defined ($line = <I_BIN>)) {
+ # "generator" on Windows, "flags" on Unix:
+ if (($line =~ m| Compiler / generator used: |) ||
+ ($line =~ m| Compiler flags used |)) {$found_compiler = "Found 'Compiler ... used' line";}
+ if ($line =~ m| Feature flags used:|) {$found_features = "Found 'Feature flags' line";}
+}
+close I_BIN;
+print "INFO_BIN: $found_compiler / $found_features\n";
+EOF
+
+--echo
+--echo End of tests