Index: src/libbn/tests/CMakeLists.txt
===================================================================
--- src/libbn/tests/CMakeLists.txt	(revision 63669)
+++ src/libbn/tests/CMakeLists.txt	(working copy)
@@ -18,6 +18,7 @@
 BRLCAD_ADDEXEC(tester_bn_complex bn_complex.c "libbu;libbn" NO_INSTALL)
 BRLCAD_ADDEXEC(tester_bn_mat bn_mat.c "libbu;libbn" NO_INSTALL)
 BRLCAD_ADDEXEC(tester_bn_tabdata bn_tabdata.c "libbu;libbn" NO_INSTALL)
+BRLCAD_ADDEXEC(tester_bn_axis bn_axis.c "libbu;libbn" NO_INSTALL)
 CMAKEFILES(bn_chull_test003_bot.asc)
 CMAKEFILES(bn_chull_test004_bot.asc)
 CMAKEFILES(bn_poly_cubic_roots.c bn_poly_quartic_roots.c bn_obr.c)
@@ -999,8 +1000,30 @@
 
 add_test(bn_tabdata_get_constval tester_bn_tabdata 20 5,0,20,40,60,80,100 3 3,3,3,3,3)
 
+#
+#  *************** axis.c tests ***************
+#
+# For tester_bn_axis, input is as follows:
+# tester_bn_axis <function_number> <args>
+
+# For function #1 (tp_3axis), the <args> format is as follows:
+#
+# title, origin, rot, length, ccw, ndigits, label_start, label_incr, tick_separation, char_width, expected_file
+#
+# where each argument up to expected_file is used as the corresponding
+# input to tp_3axis, and expected_file is a file containing the
+# expected output of tp_3axis.  origin and rot are given by lists of
+# doubles separated by ',' characters, 3 for origin and 16 for rot.
+
+BRLCAD_MANAGE_FILES(bn_tp_3axis_1.3d.pl src/libbn/tests/)
+add_test(bn_tp_3axis_1 tester_bn_axis 1 "test" 0,0,0 1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1 120 1 2 0 2 20 10 "bn_tp_3axis_1.3d.pl")
+BRLCAD_MANAGE_FILES(bn_tp_3axis_2.3d.pl src/libbn/tests/)
+add_test(bn_tp_3axis_2 tester_bn_axis 1 "test" 0,0,0 0,1,0,0,-1,0,0,0,0,0,1,0,0,0,0,1 120 1 2 0 2 20 10 "bn_tp_3axis_2.3d.pl")
+
 CMAKEFILES(bntester.dat)
 
+
+
 # Local Variables:
 # tab-width: 8
 # mode: cmake
Index: src/libbn/tests/bn_axis.c
===================================================================
--- src/libbn/tests/bn_axis.c	(revision 0)
+++ src/libbn/tests/bn_axis.c	(working copy)
@@ -0,0 +1,121 @@
+/*                      B N _ A X I S . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2014 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "bu/log.h"
+#include "bu/str.h"
+#include "bu/vls.h"
+#include "bu/malloc.h"
+#include "plot3.h"
+
+int
+test_tp_3axis(int argc, const char *argv[])
+{
+    char *plot_name;
+    point_t origin;
+    mat_t rot;
+    double length;
+    int ccw, ndigits;
+    double label_start, label_incr, tick_separation, char_width;
+    struct bu_vls output_filename;
+    FILE *out;
+    FILE *expected_out;
+    char *out_buf;
+    char *expected_out_buf;
+    long out_len;
+    long expected_out_len;
+    int result;
+    if (argc != 11) {
+	bu_exit(1, "ERROR: input format is: title, origin, rot, length, ccw, ndigits, label_start, label_incr, tick_separation, char_width, expected_file");
+    }
+    printf("argv[10]:%s\n", argv[10]);
+    plot_name = bu_strdup(argv[0]);
+    bu_scan_fastf_t(NULL, argv[1], ",", 3, &origin[0], &origin[1], &origin[2]);
+    bu_scan_fastf_t(NULL, argv[2], ",", 16, &rot[0], &rot[1], &rot[2], &rot[3], &rot[4], &rot[5], &rot[6], &rot[7], &rot[8], &rot[9], &rot[10], &rot[11], &rot[12], &rot[13], &rot[14], &rot[15]);
+    sscanf(argv[3], "%lf", &length);
+    sscanf(argv[4], "%d", &ccw);
+    sscanf(argv[5], "%d", &ndigits);
+    sscanf(argv[6], "%lf", &label_start);
+    sscanf(argv[7], "%lf", &label_incr);
+    sscanf(argv[8], "%lf", &tick_separation);
+    sscanf(argv[9], "%lf", &char_width);
+    bu_vls_init(&output_filename);
+    bu_vls_printf(&output_filename, "%s.out", argv[10]);
+    out = fopen(bu_vls_addr(&output_filename), "w");
+
+    tp_3axis(out, plot_name, origin, rot, length, ccw, ndigits, label_start, label_incr, tick_separation, char_width);
+    fclose(out);
+
+    out = fopen(bu_vls_addr(&output_filename), "rb");
+    fseek(out, 0L, SEEK_END);
+    out_len = ftell(out);
+    fseek(out, 0L, SEEK_SET);
+    expected_out = fopen(argv[10], "rb");
+    fseek(expected_out, 0L, SEEK_END);
+    expected_out_len = ftell(expected_out);
+    fseek(expected_out, 0L, SEEK_SET);
+    if (out_len != expected_out_len) {
+	fclose(out);
+	fclose(expected_out);
+	return 1;
+    }
+    out_buf = (char *)bu_calloc(sizeof(char), out_len, "test_tp_3axis");
+    fread(out_buf, sizeof(char), out_len, out);
+    expected_out_buf = (char *)bu_calloc(sizeof(char), expected_out_len, "test_tp_3axis");
+    fread(expected_out_buf, sizeof(char), expected_out_len, expected_out);
+    result = memcmp(out_buf, expected_out_buf, out_len);
+    fclose(out);
+    fclose(expected_out);
+    return result;
+}
+
+int
+main(int argc, const char *argv[])
+{
+    int function_num = 0;
+
+    if (argc < 3) {
+	bu_exit(1, "ERROR: input format is function_num function_test_args [%s]\n", argv[0]);
+    }
+
+    sscanf(argv[1], "%d", &function_num);
+
+    switch (function_num) {
+	case 1:
+	    return test_tp_3axis(argc - 2, argv + 2);
+	default:
+	    bu_exit(1, "ERROR: Unrecognized function_num\n");
+  }
+  return 1;
+}
+
+
+/** @} */
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Index: src/libbn/tests/bn_tp_3axis_1.3d.pl
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: src/libbn/tests/bn_tp_3axis_1.3d.pl
===================================================================
--- src/libbn/tests/bn_tp_3axis_1.3d.pl	(revision 0)
+++ src/libbn/tests/bn_tp_3axis_1.3d.pl	(working copy)

Property changes on: src/libbn/tests/bn_tp_3axis_1.3d.pl
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: src/libbn/tests/bn_tp_3axis_2.3d.pl
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: src/libbn/tests/bn_tp_3axis_2.3d.pl
===================================================================
--- src/libbn/tests/bn_tp_3axis_2.3d.pl	(revision 0)
+++ src/libbn/tests/bn_tp_3axis_2.3d.pl	(working copy)

Property changes on: src/libbn/tests/bn_tp_3axis_2.3d.pl
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
