Skip to content

Commit

Permalink
fix config option, AUTOTEST_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyesh Padmavilasom committed Mar 25, 2016
1 parent 848a4b6 commit 6a8a62e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
5 changes: 3 additions & 2 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ EXTRA_DIST += $(TESTSUITE_AT)
DISTCLEANFILES = atconfig testsuite

check-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(abs_top_srcdir)/tools/cli' \
$(TESTSUITEFLAGS)

installcheck-local: atconfig $(TESTSUITE)
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(abs_top_srcdir)/tools/cli' \
$(TESTSUITEFLAGS)

clean-local:
Expand Down
2 changes: 1 addition & 1 deletion tests/init.at
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ m4_define([TDNF_CLI],[[$abs_top_builddir/tools/cli/tdnf]])

m4_define([TDNF_CHROOT],[[$abs_top_builddir/tests/testroot]])

m4_define([TDNF_CLI_W_CHROOT],[[$abs_top_builddir/tools/cli/tdnf --setopt "tdnf.conf=$abs_top_builddir/tests/testroot/etc/tdnf/tdnf.conf" --installroot $abs_top_builddir/tests/testroot]])
m4_define([TDNF_CLI_W_CHROOT],[[$abs_top_builddir/tools/cli/tdnf --config "$abs_top_builddir/tests/testroot/etc/tdnf/tdnf.conf" --installroot $abs_top_builddir/tests/testroot]])

m4_define([TDNF_CHROOT_INIT],[[
rm -rf $abs_top_builddir/tests/testroot
Expand Down
26 changes: 23 additions & 3 deletions tools/cli/parseargs.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ TDNFCliParseArgs(
nOption = getopt_long (
argc,
argv,
"46bCc:d:e:hiqvxy",
"46bCc:d:e:hi:qvxy",
pstOptions,
&nOptionIndex);
if (nOption == -1)
Expand All @@ -94,7 +94,6 @@ TDNFCliParseArgs(
switch (nOption)
{
case 0:
case 'i':
dwError = ParseOption(
pstOptions[nOptionIndex].name,
optarg,
Expand All @@ -104,6 +103,13 @@ TDNFCliParseArgs(
case 'b':
_opt.nBest = 1;
break;
case 'c':
dwError = ParseOption(
"config",
optarg,
pCmdArgs);
BAIL_ON_CLI_ERROR(dwError);
break;
case 'e':
break;
case 'C':
Expand All @@ -112,6 +118,13 @@ TDNFCliParseArgs(
case 'h':
_opt.nShowHelp = 1;
break;
case 'i':
dwError = ParseOption(
"installroot",
optarg,
pCmdArgs);
BAIL_ON_CLI_ERROR(dwError);
break;
case 'r':
break;
case 'y':
Expand Down Expand Up @@ -296,7 +309,14 @@ ParseOption(
dwError = TDNFCliValidateOptions(pszName, pszArg, pstOptions);
BAIL_ON_CLI_ERROR(dwError);

if(!strcasecmp(pszName, "rpmverbosity"))
if(!strcasecmp(pszName, "config"))
{
dwError = TDNFAllocateString(
optarg,
&pCmdArgs->pszConfFile);
BAIL_ON_CLI_ERROR(dwError);
}
else if(!strcasecmp(pszName, "rpmverbosity"))
{
dwError = ParseRpmVerbosity(
pszArg,
Expand Down

0 comments on commit 6a8a62e

Please sign in to comment.