aboutsummaryrefslogtreecommitdiffstats
path: root/runm3uatest.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-05-14 22:12:52 +0200
committerHarald Welte <laforge@gnumonks.org>2017-05-14 22:16:25 +0200
commit5e70f7f9054729612b998e4e55bd8827e89a9603 (patch)
treecbe14d0d82a6857ba87db38c989c85681767a416 /runm3uatest.c
parentc1f566cc857fdc74a56c793370d3780b2d184e5f (diff)
runm3uatest: Avoid having to use a ~/.guile script
Rather, we can specify the path in which the m3ua-testtool files are located using the '-d ...' command line argument of runm3uatest
Diffstat (limited to 'runm3uatest.c')
-rw-r--r--runm3uatest.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/runm3uatest.c b/runm3uatest.c
index 8b7773e..863759a 100644
--- a/runm3uatest.c
+++ b/runm3uatest.c
@@ -71,10 +71,11 @@ main(int argc, char *argv[]) {
unsigned int timeout;
int status, c;
char command[COMMAND_LENGTH];
+ char *dir = getenv("HOME");
timeout = TIMEOUT;
- while ((c = getopt(argc, argv, "t:")) != -1) {
+ while ((c = getopt(argc, argv, "t:d:")) != -1) {
switch(c) {
case 'h':
print_usage();
@@ -83,6 +84,9 @@ main(int argc, char *argv[]) {
case 't':
timeout = (unsigned int)atoi(optarg);
break;
+ case 'd':
+ dir = optarg;
+ break;
default:
print_usage();
return (1);
@@ -90,7 +94,7 @@ main(int argc, char *argv[]) {
}
if (optind == argc - 1) {
- snprintf(command, COMMAND_LENGTH, command_skel, getenv("HOME"), argv[optind]);
+ snprintf(command, COMMAND_LENGTH, command_skel, dir, argv[optind]);
} else {
print_usage();
return (1);
@@ -98,9 +102,9 @@ main(int argc, char *argv[]) {
if ((pid = fork()) == 0) {
#if defined(__APPLE__) || defined(__FreeBSD__)
- execlp("/usr/local/bin/guile", "guile", "-c", command, NULL);
+ execlp("/usr/local/bin/guile", "guile", "-L", dir, "-c", command, NULL);
#else
- execlp("/usr/bin/guile", "guile", "-c", command, NULL);
+ execlp("/usr/bin/guile", "guile", "-L", dir, "-c", command, NULL);
#endif
return (255);
}