diff options
author | 2011-04-21 16:53:03 +0800 | |
---|---|---|
committer | 2011-04-26 15:13:52 +0800 | |
commit | 3174d0646b5f1a3d21a0661d8e87fc8380d73da9 (patch) | |
tree | eb68f93b1f45dfb3a887b1487d1259da39f203e5 /test | |
parent | Test: rename *ebuild* to *bash* (diff) | |
download | libbash-3174d0646b5f1a3d21a0661d8e87fc8380d73da9.tar.gz libbash-3174d0646b5f1a3d21a0661d8e87fc8380d73da9.tar.bz2 libbash-3174d0646b5f1a3d21a0661d8e87fc8380d73da9.zip |
Core: support DEFINED_PHASES for metadata generation
We need to retrieve names of defined functions in order to generate
DEFINED_PHASES. The public API is modified a bit to support it. A
custom test is added for metadata generation.
Diffstat (limited to 'test')
-rw-r--r-- | test/api_test.cpp | 3 | ||||
-rwxr-xr-x | test/ebuild_compiler.sh | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/test/api_test.cpp b/test/api_test.cpp index 14ab059..813c3b0 100644 --- a/test/api_test.cpp +++ b/test/api_test.cpp @@ -31,6 +31,7 @@ using namespace std; TEST(libbashapi, bad_path) { std::unordered_map<std::string, std::vector<std::string>> variables; - EXPECT_THROW(libbash::interpret("not exist", variables), + std::vector<std::string> functions; + EXPECT_THROW(libbash::interpret("not exist", variables, functions), interpreter_exception); } diff --git a/test/ebuild_compiler.sh b/test/ebuild_compiler.sh new file mode 100755 index 0000000..5930b62 --- /dev/null +++ b/test/ebuild_compiler.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +declare -i error=0 + +for ebuild in $@ +do + ./metadata_generator $ebuild | diff -u $ebuild.result - + error+=$? +done + +exit $error |