aboutsummaryrefslogtreecommitdiffstats
path: root/tests/blogc-make
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-04-03 00:39:56 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-04-03 00:40:03 +0200
commit3afa72febc3d6ed7003d10f3a5c4211bf761d746 (patch)
treeb102b9fa81ce90c99a251156635aee74dfd012e9 /tests/blogc-make
parentadc3e6d77117d095e485ec64a93f1b64ffbf2cea (diff)
downloadblogc-3afa72febc3d6ed7003d10f3a5c4211bf761d746.tar.gz
blogc-3afa72febc3d6ed7003d10f3a5c4211bf761d746.tar.bz2
blogc-3afa72febc3d6ed7003d10f3a5c4211bf761d746.zip
make: added support for `blogc -e`
must still add tests
Diffstat (limited to 'tests/blogc-make')
-rw-r--r--tests/blogc-make/check_exec.c54
1 files changed, 42 insertions, 12 deletions
diff --git a/tests/blogc-make/check_exec.c b/tests/blogc-make/check_exec.c
index 32c7fae..8193ad7 100644
--- a/tests/blogc-make/check_exec.c
+++ b/tests/blogc-make/check_exec.c
@@ -88,20 +88,27 @@ test_build_blogc_cmd_with_settings(void **state)
settings->tags = NULL;
char *rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true,
- "main.tmpl", "foo.html", false, true);
+ NULL, "main.tmpl", "foo.html", false, true);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' "
"-D ASD='QWE' -l -t 'main.tmpl' -o 'foo.html' -i");
free(rv);
+ rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true,
+ "foo.txt", "main.tmpl", "foo.html", false, true);
+ assert_string_equal(rv,
+ "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' "
+ "-D ASD='QWE' -l -e 'foo.txt' -t 'main.tmpl' -o 'foo.html' -i");
+ free(rv);
+
rv = bm_exec_build_blogc_cmd("blogc", settings, variables, NULL, false, NULL,
- NULL, false, false);
+ NULL, NULL, false, false);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE'");
free(rv);
rv = bm_exec_build_blogc_cmd("blogc", settings, NULL, NULL, false, NULL, NULL,
- false, false);
+ NULL, false, false);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ'");
free(rv);
@@ -130,22 +137,30 @@ test_build_blogc_cmd_with_settings_and_dev(void **state)
settings->tags = NULL;
char *rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true,
- "main.tmpl", "foo.html", true, true);
+ NULL, "main.tmpl", "foo.html", true, true);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' "
"-D ASD='QWE' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev' -l -t 'main.tmpl' "
"-o 'foo.html' -i");
free(rv);
+ rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true,
+ "foo.txt", "main.tmpl", "foo.html", true, true);
+ assert_string_equal(rv,
+ "LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' "
+ "-D ASD='QWE' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev' -l -e 'foo.txt' "
+ "-t 'main.tmpl' -o 'foo.html' -i");
+ free(rv);
+
rv = bm_exec_build_blogc_cmd("blogc", settings, variables, NULL, false, NULL,
- NULL, true, false);
+ NULL, NULL, true, false);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' -D LOL='HEHE' "
"-D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'");
free(rv);
rv = bm_exec_build_blogc_cmd("blogc", settings, NULL, NULL, false, NULL, NULL,
- true, false);
+ NULL, true, false);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D FOO='BAR' -D BAR='BAZ' "
"-D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'");
@@ -175,22 +190,30 @@ test_build_blogc_cmd_with_settings_and_tags(void **state)
settings->tags = bc_str_split("asd foo bar", ' ', 0);
char *rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true,
- "main.tmpl", "foo.html", true, true);
+ NULL, "main.tmpl", "foo.html", true, true);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' "
"-D BAR='BAZ' -D LOL='HEHE' -D ASD='QWE' -D MAKE_ENV_DEV=1 "
"-D MAKE_ENV='dev' -l -t 'main.tmpl' -o 'foo.html' -i");
free(rv);
+ rv = bm_exec_build_blogc_cmd("blogc", settings, variables, local, true,
+ "foo.txt", "main.tmpl", "foo.html", true, true);
+ assert_string_equal(rv,
+ "LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' "
+ "-D BAR='BAZ' -D LOL='HEHE' -D ASD='QWE' -D MAKE_ENV_DEV=1 "
+ "-D MAKE_ENV='dev' -l -e 'foo.txt' -t 'main.tmpl' -o 'foo.html' -i");
+ free(rv);
+
rv = bm_exec_build_blogc_cmd("blogc", settings, variables, NULL, false, NULL,
- NULL, true, false);
+ NULL, NULL, true, false);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' "
"-D BAR='BAZ' -D LOL='HEHE' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'");
free(rv);
rv = bm_exec_build_blogc_cmd("blogc", settings, NULL, NULL, false, NULL, NULL,
- true, false);
+ NULL, true, false);
assert_string_equal(rv,
"LC_ALL='en_US.utf8' blogc -D MAKE_TAGS='asd foo bar' -D FOO='BAR' "
"-D BAR='BAZ' -D MAKE_ENV_DEV=1 -D MAKE_ENV='dev'");
@@ -214,19 +237,26 @@ test_build_blogc_cmd_without_settings(void **state)
bc_trie_insert(local, "ASD", bc_strdup("QWE"));
char *rv = bm_exec_build_blogc_cmd("blogc", NULL, variables, local, true,
- "main.tmpl", "foo.html", false, true);
+ NULL, "main.tmpl", "foo.html", false, true);
assert_string_equal(rv,
"blogc -D LOL='HEHE' -D ASD='QWE' -l -t 'main.tmpl' -o 'foo.html' -i");
free(rv);
+ rv = bm_exec_build_blogc_cmd("blogc", NULL, variables, local, true,
+ "foo.txt", "main.tmpl", "foo.html", false, true);
+ assert_string_equal(rv,
+ "blogc -D LOL='HEHE' -D ASD='QWE' -l -e 'foo.txt' -t 'main.tmpl' "
+ "-o 'foo.html' -i");
+ free(rv);
+
rv = bm_exec_build_blogc_cmd("blogc", NULL, variables, NULL, false, NULL,
- NULL, false, false);
+ NULL, NULL, false, false);
assert_string_equal(rv,
"blogc -D LOL='HEHE'");
free(rv);
rv = bm_exec_build_blogc_cmd("blogc", NULL, NULL, NULL, false, NULL, NULL,
- false, false);
+ NULL, false, false);
assert_string_equal(rv,
"blogc");
free(rv);