From 1c944399092ebae2731367f8e04681a078c2b953 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 2 Jul 2014 09:51:59 -0700 Subject: [PATCH] Support running setup.sh out-of-tree --- tests/setup.sh | 13 ++++++++----- tests/tests/access.cpp | 2 +- tests/tests/cajun.cpp | 2 +- tests/tests/color.cpp | 4 ++-- tests/tests/dialogue_lexer.cpp | 4 ++-- tests/tests/format.cpp | 4 ++-- tests/tests/fs.cpp | 4 ++-- tests/tests/hotkey.cpp | 2 +- tests/tests/iconv.cpp | 2 +- tests/tests/ifind.cpp | 2 +- tests/tests/karaoke_matcher.cpp | 4 ++-- tests/tests/keyframe.cpp | 4 ++-- tests/tests/line_iterator.cpp | 4 ++-- tests/tests/line_wrap.cpp | 4 ++-- tests/tests/mru.cpp | 2 +- tests/tests/option.cpp | 4 ++-- tests/tests/path.cpp | 2 +- tests/tests/signals.cpp | 2 +- tests/tests/syntax_highlight.cpp | 2 +- tests/tests/thesaurus.cpp | 4 ++-- tests/tests/util.cpp | 2 +- tests/tests/uuencode.cpp | 2 +- tests/tests/vfr.cpp | 4 ++-- tests/tests/word_split.cpp | 2 +- 24 files changed, 42 insertions(+), 39 deletions(-) diff --git a/tests/setup.sh b/tests/setup.sh index 127ddb827..3e9c993c3 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -1,5 +1,8 @@ -chmod 777 data/* -chmod -R 777 data/ +d=$(dirname $0)/ +if test -d data; then + chmod 777 data/* + chmod -R 777 data/ +fi rm -rf data mkdir -p data @@ -28,7 +31,7 @@ printf %s '1234567890' > data/ten_bytes touch data/touch_mod_time mkdir data/options -cp options/* data/options +cp $d/options/* data/options mkdir data/dir_iterator touch data/dir_iterator/1.a @@ -39,7 +42,7 @@ touch data/dir_iterator/2.b mkdir data/vfr mkdir data/vfr/in mkdir data/vfr/out -cp vfr/* data/vfr/in/ +cp $d/vfr/* data/vfr/in/ mkdir data/keyframe -cp keyframe/* data/keyframe +cp $d/keyframe/* data/keyframe diff --git a/tests/tests/access.cpp b/tests/tests/access.cpp index 82a42b77e..a4791818f 100644 --- a/tests/tests/access.cpp +++ b/tests/tests/access.cpp @@ -12,7 +12,7 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -#include "main.h" +#include #include #include diff --git a/tests/tests/cajun.cpp b/tests/tests/cajun.cpp index f968c6879..ef054c76e 100644 --- a/tests/tests/cajun.cpp +++ b/tests/tests/cajun.cpp @@ -18,7 +18,7 @@ /// @brief Cajun/Json tests. /// @ingroup cajun -#include "main.h" +#include #include #include diff --git a/tests/tests/color.cpp b/tests/tests/color.cpp index d40cd652f..32118973d 100644 --- a/tests/tests/color.cpp +++ b/tests/tests/color.cpp @@ -16,8 +16,8 @@ #include -#include "main.h" -#include "util.h" +#include +#include class lagi_color : public libagi { }; diff --git a/tests/tests/dialogue_lexer.cpp b/tests/tests/dialogue_lexer.cpp index f14ce464e..14db09f29 100644 --- a/tests/tests/dialogue_lexer.cpp +++ b/tests/tests/dialogue_lexer.cpp @@ -14,8 +14,8 @@ #include -#include "main.h" -#include "util.h" +#include +#include class lagi_dialogue_lexer : public libagi { }; diff --git a/tests/tests/format.cpp b/tests/tests/format.cpp index 551dfc572..a0495094a 100644 --- a/tests/tests/format.cpp +++ b/tests/tests/format.cpp @@ -14,8 +14,8 @@ // // Aegisub Project http://www.aegisub.org/ -#include "main.h" -#include "util.h" +#include +#include #include #include diff --git a/tests/tests/fs.cpp b/tests/tests/fs.cpp index 84073f9b6..9ce1c2e1d 100644 --- a/tests/tests/fs.cpp +++ b/tests/tests/fs.cpp @@ -14,8 +14,8 @@ // // Aegisub Project http://www.aegisub.org/ -#include "main.h" -#include "util.h" +#include +#include #include diff --git a/tests/tests/hotkey.cpp b/tests/tests/hotkey.cpp index ffb1800aa..48e3cd6be 100644 --- a/tests/tests/hotkey.cpp +++ b/tests/tests/hotkey.cpp @@ -12,7 +12,7 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -#include "main.h" +#include #include #include diff --git a/tests/tests/iconv.cpp b/tests/tests/iconv.cpp index f1cbf27a2..518e4b44b 100644 --- a/tests/tests/iconv.cpp +++ b/tests/tests/iconv.cpp @@ -15,7 +15,7 @@ #include #include -#include "main.h" +#include using namespace agi::charset; diff --git a/tests/tests/ifind.cpp b/tests/tests/ifind.cpp index baad59913..2b2e7acd0 100644 --- a/tests/tests/ifind.cpp +++ b/tests/tests/ifind.cpp @@ -16,7 +16,7 @@ #include -#include "main.h" +#include #define IFIND(haystack, needle) \ std::pair pos; \ diff --git a/tests/tests/karaoke_matcher.cpp b/tests/tests/karaoke_matcher.cpp index adc30b740..39b5afe6e 100644 --- a/tests/tests/karaoke_matcher.cpp +++ b/tests/tests/karaoke_matcher.cpp @@ -14,8 +14,8 @@ #include -#include "main.h" -#include "util.h" +#include +#include class lagi_karaoke_matcher : public libagi { }; diff --git a/tests/tests/keyframe.cpp b/tests/tests/keyframe.cpp index 97c1f00e8..e664b54b7 100644 --- a/tests/tests/keyframe.cpp +++ b/tests/tests/keyframe.cpp @@ -22,8 +22,8 @@ #include #include -#include "main.h" -#include "util.h" +#include +#include using namespace agi::keyframe; using namespace util; diff --git a/tests/tests/line_iterator.cpp b/tests/tests/line_iterator.cpp index b719e6b7b..d8dd9dec1 100644 --- a/tests/tests/line_iterator.cpp +++ b/tests/tests/line_iterator.cpp @@ -20,8 +20,8 @@ #include #include -#include "main.h" -#include "util.h" +#include +#include using agi::line_iterator; diff --git a/tests/tests/line_wrap.cpp b/tests/tests/line_wrap.cpp index 680371497..f8e82e6a9 100644 --- a/tests/tests/line_wrap.cpp +++ b/tests/tests/line_wrap.cpp @@ -14,8 +14,8 @@ #include -#include "main.h" -#include "util.h" +#include +#include using namespace agi; using namespace util; diff --git a/tests/tests/mru.cpp b/tests/tests/mru.cpp index d727e35b3..4aa0f0c34 100644 --- a/tests/tests/mru.cpp +++ b/tests/tests/mru.cpp @@ -15,7 +15,7 @@ #include #include -#include "main.h" +#include static const char default_mru[] = "{\"Valid\" : []}"; diff --git a/tests/tests/option.cpp b/tests/tests/option.cpp index 334c5b4c4..53b8fde49 100644 --- a/tests/tests/option.cpp +++ b/tests/tests/option.cpp @@ -16,8 +16,8 @@ #include #include -#include "main.h" -#include "util.h" +#include +#include #include diff --git a/tests/tests/path.cpp b/tests/tests/path.cpp index bdeba530e..7d0089d83 100644 --- a/tests/tests/path.cpp +++ b/tests/tests/path.cpp @@ -16,7 +16,7 @@ #include #include -#include "main.h" +#include #include diff --git a/tests/tests/signals.cpp b/tests/tests/signals.cpp index 06e579500..671579125 100644 --- a/tests/tests/signals.cpp +++ b/tests/tests/signals.cpp @@ -14,7 +14,7 @@ #include -#include "main.h" +#include using namespace agi::signal; diff --git a/tests/tests/syntax_highlight.cpp b/tests/tests/syntax_highlight.cpp index eedd4951a..ea3a2cc63 100644 --- a/tests/tests/syntax_highlight.cpp +++ b/tests/tests/syntax_highlight.cpp @@ -15,7 +15,7 @@ #include #include -#include "main.h" +#include class MockSpellChecker : public agi::SpellChecker { void AddWord(std::string const&) override { } diff --git a/tests/tests/thesaurus.cpp b/tests/tests/thesaurus.cpp index def516f4b..0a003a002 100644 --- a/tests/tests/thesaurus.cpp +++ b/tests/tests/thesaurus.cpp @@ -15,8 +15,8 @@ #include #include -#include "main.h" -#include "util.h" +#include +#include #include diff --git a/tests/tests/util.cpp b/tests/tests/util.cpp index 82af8e0d4..14757f8bb 100644 --- a/tests/tests/util.cpp +++ b/tests/tests/util.cpp @@ -16,7 +16,7 @@ #include -#include "main.h" +#include class lagi_util : public libagi { }; diff --git a/tests/tests/uuencode.cpp b/tests/tests/uuencode.cpp index 26c0c4918..09688675c 100644 --- a/tests/tests/uuencode.cpp +++ b/tests/tests/uuencode.cpp @@ -16,7 +16,7 @@ #include -#include "main.h" +#include #include diff --git a/tests/tests/vfr.cpp b/tests/tests/vfr.cpp index 53e12e90d..2664d6d1f 100644 --- a/tests/tests/vfr.cpp +++ b/tests/tests/vfr.cpp @@ -21,8 +21,8 @@ #include #include -#include "main.h" -#include "util.h" +#include +#include using namespace agi::vfr; using namespace util; diff --git a/tests/tests/word_split.cpp b/tests/tests/word_split.cpp index 0b3847757..00ba82fcd 100644 --- a/tests/tests/word_split.cpp +++ b/tests/tests/word_split.cpp @@ -12,7 +12,7 @@ // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -#include "main.h" +#include #include