From aaee78c061802f9b6fae92c9ceb816fd29348ed2 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Thu, 16 Mar 2017 20:51:12 -0700 Subject: [PATCH] Tweaks for 'make check': Don't assume location of perl, or existence of /etc/hosts --- Makefile.am | 2 +- Makefile.in | 2 +- src/twtest/fileutil_t.cpp | 20 +++++++++----------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile.am b/Makefile.am index e72b1ee..bfcd93a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,5 +14,5 @@ uninstall-hook: check: rm -Rf $(top_srcdir)/src/test-harness/twtest - cd $(top_srcdir)/src/test-harness && ./twtest.pl + cd $(top_srcdir)/src/test-harness && perl ./twtest.pl $(top_srcdir)/bin/twtest all diff --git a/Makefile.in b/Makefile.in index 5586cce..3bb6176 100644 --- a/Makefile.in +++ b/Makefile.in @@ -810,7 +810,7 @@ uninstall-hook: check: rm -Rf $(top_srcdir)/src/test-harness/twtest - cd $(top_srcdir)/src/test-harness && ./twtest.pl + cd $(top_srcdir)/src/test-harness && perl ./twtest.pl $(top_srcdir)/bin/twtest all # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/src/twtest/fileutil_t.cpp b/src/twtest/fileutil_t.cpp index e478fc0..50a98c5 100644 --- a/src/twtest/fileutil_t.cpp +++ b/src/twtest/fileutil_t.cpp @@ -47,17 +47,15 @@ using namespace std; void TestFileUtil() { + if(cFileUtil::FileExists("/etc/hosts")) + { + TSTRING source, dest; - TSTRING source, dest; - - source = _T("/etc/hosts"); - dest = _T("/tmp/dest"); - bool blah = cFileUtil::Copy(source, dest); - (void)blah; - - -// TCOUT << _T("<") << wstr3 << _T(">") << std::endl; - - + source = _T("/etc/hosts"); + dest = _T("/tmp/dest"); + bool blah = cFileUtil::Copy(source, dest); + (void)blah; + // TCOUT << _T("<") << wstr3 << _T(">") << std::endl; + } }