Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't use /etc/tmtest.conf and ~/.tmtestrc anymore

  • Loading branch information...
commit 4e7e2e2bcc928197e365c623996aa6db3b106619 1 parent 814a48a
Scott Bronson authored
5 Makefile
View
@@ -66,11 +66,6 @@ endif
# NOTE: This will remove the configuration file too!
uninstall: tmtest
rm $(bindir)/tmtest
-ifeq ($(prefix), $(HOME))
- rm $(HOME)/.tmtestrc
-else
- rm /etc/tmtest.conf
-endif
clean:
rm -f tmtest template.c tags
5 TODO
View
@@ -1,8 +1,7 @@
0.960:
-- git rid of /etc/tmtestrc and ~/.tmtestrc
-- Munge diff file to have a/file and b/file so there's no need to pass -p0
- Run in print failures only mode by default, -v to get every result.
- Can we sense a terminal and print a running count statusline?
+ Print a dot for each success, F for failure, A for abort, and ? for disabled.
+- Munge diff file to have a/file and b/file so there's no need to pass -p0
- Config file runs all tests with -e. Fix and remove all "set +e" from tests.
0.962:
3  test.h
View
@@ -47,8 +47,7 @@ typedef enum {
// (only print results, no statistics or other useful conversation).
extern int quiet;
-// If this is set, then we should use it as the config file rather than
-// checking /etc/tmtest.conf, ~/.tmtestrc, etc.
+// if set then read this config file before scanning through directories
extern char *config_file;
// all strings are malloc'd and need to be freed when the test is finished.
6 tmtest.conf
View
@@ -4,8 +4,6 @@
# This file tells how to run tests on tmtest itself.
-# See tmtestetc or tmtestrc for examples of globally-installed
-# configuration files.
# This can be a little confusing because one copy of tmtest runs another
@@ -15,10 +13,6 @@
# Because the user launched the superexec, we have no control over which
# executable is used to run the tests. Hopefully it's reasonably stable.
#
-# This configuration file, tmtest.conf, tells the superexec how to run the
-# test battery. Local settings are read from /etc/tmtest.conf, ~/.tmtestrc,
-# etc., then this file is loaded.
-#
# The subtests do not read any configuration files outside of the test
# directory except for one, tmtest.sub.conf.
14 tmtest.pod
View
@@ -14,10 +14,10 @@ B<tmtest> [B<-d>|B<-o>] [I<dir>|I<testfile>...]
=item B<-c> B<--config>
-Specifies the config file to be read before running the test file.
-Prevents the standard config files (/etc/tmtest.conf, /etc/tmtest/tmtest.conf,
-~/.tmtestrc) from being read. Also doesn't read config files unless they
-are below the directory that contains the specified file.
+Specifies a config file to be read before running the test file.
+tmtest will still look upward in the file hierarchy for tmtest.conf
+files. Settings in tmtest.conf files override files specified by
+--config.
=item B<-d> B<--diff>
@@ -61,12 +61,12 @@ quieter than it normally is but it certainly isn't silent.
=head1 CONFIGURATION
-tmtest reads its configuration first from F</etc/tmtest.conf> and
-F<~/.tmtest.conf>. Then it starts at the root directory and works
+tmtest first reads the file specified by --config if supplied.
+Then it starts at the root directory and works
its way up to the current directory looking for files named "tmtest.conf"
Therefore, /home/test/a/b/tmtest.conf overrides /home/test/tmtest.conf
(because the latter is read and executed before the former).
-It executes each config files every time it runs a test. If you're
+It executes each config file every time it runs a test. If you're
running 40 tests, your config files will each get executed 40 times.
Any output produced by the config files goes straight to the screen.
38 vars.c
View
@@ -21,7 +21,6 @@
#include "vars.h"
#define CONFIG_FILE "tmtest.conf"
-#define HOME_CONFIG_FILE ".tmtestrc"
/** @file vars.c
@@ -80,30 +79,6 @@ static int var_statusfd(struct test *test, FILE *fp, const char *var)
}
-/** Returns the full path to the user's home directory.
- */
-
-static char* get_home_dir(struct test *test)
-{
- char *cp;
- struct passwd *entry;
-
- cp = getenv("HOME");
- if(cp) return cp;
- cp = getenv("LOGDIR");
- if(cp) return cp;
-
- entry = getpwuid(getuid());
- if(entry) {
- cp = entry->pw_dir;
- if(cp) return cp;
- }
-
- test_abort(test, "Could not locate your home directory! Please set $HOME.\n");
- return NULL; // will never be executed
-}
-
-
/** Returns true if the given file exists, false if not.
*/
@@ -164,15 +139,6 @@ static void check_config(struct test *test, FILE *fp,
/** Prints the shell commands needed to read in all available config files.
- *
- * for instance:
- *
- * echo 'CONFIG: /etc/tmtest' >&5
- * . '/etc/tmtest'
- * echo 'CONFIG: /home/bronson/tmtest/tmtest.conf' >&5
- * . '/home/bronson/tmtest/tmtest.conf'
- *
- * and so on...
*/
static int var_config_files(struct test *test, FILE *fp, const char *var)
@@ -197,10 +163,6 @@ static int var_config_files(struct test *test, FILE *fp, const char *var)
*cp = '\0';
check_config_str(test, fp, buf, cp+1);
config_file = oldcfg;
- } else {
- check_config_str(test, fp, "/etc", CONFIG_FILE);
- check_config_str(test, fp, "/etc/tmtest", CONFIG_FILE);
- check_config_str(test, fp, get_home_dir(test), HOME_CONFIG_FILE);
}
// check config files in the current hierarchy
Please sign in to comment.
Something went wrong with that request. Please try again.