diff options
author | EuAndreh <eu@euandre.org> | 2021-08-22 11:21:07 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-08-22 11:42:34 -0300 |
commit | 3a4b3fa01b6ead1e23434c533302a2a9fddfd89e (patch) | |
tree | 5a4f5b1e9e5d78e057ed2b49d6d94269dd586a98 /tests/integration.sh | |
parent | src/gistatic.c: Remove .logo bogus color attribute (diff) | |
download | gistatic-3a4b3fa01b6ead1e23434c533302a2a9fddfd89e.tar.gz gistatic-3a4b3fa01b6ead1e23434c533302a2a9fddfd89e.tar.xz |
Have a single top-level main for running unit-tests
Instead of each .c file becoming a self-standing .t executable file,
and being run for executing the unit tests local to the file, now each
.c becomes a .to object (akin to a .o object, but one where the -DTEST
flag is given to the compiler). After that, all the .to objects are
linked together in a gistatic-tests executable, in a equivalent way
that all .o files get linked together in a gistatic executable.
This change was necessary in order to allow dependencies between
objects. The next task will be making a tar of a repository tree
checkout, and src/gistatic.{o,to} will start depending on
src/tar.{o,to}. If each file has its own main function when -DTEST is
given, then I wont be able to link them together.
I took the opportunity that I had to change the Makefile, and I
improved the dependency between targets and dependencies greatly. From
what I can tell now, it is correct.
Diffstat (limited to 'tests/integration.sh')
-rwxr-xr-x | tests/integration.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/integration.sh b/tests/integration.sh index 58dde94..8fa13e9 100755 --- a/tests/integration.sh +++ b/tests/integration.sh @@ -20,8 +20,7 @@ test_index_generation() { OUT="$(mkstemp)" ERR="$(mkstemp)" DIR="$(mkdtemp)" - ./src/gistatic -i -o "$DIR" tests/resources/repositories/* \ - 1>"$OUT" 2>"$ERR" + ./gistatic -i -o "$DIR" tests/resources/repositories/* 1>"$OUT" 2>"$ERR" STATUS=$? assert_empty_stdout assert_empty_stderr @@ -40,7 +39,7 @@ test_repo_generation() { OUT="$(mkstemp)" ERR="$(mkstemp)" DIR="$(mkdtemp)" - ./src/gistatic -o "$DIR" -u https://example.com/ \ + ./gistatic -o "$DIR" -u https://example.com/ \ tests/resources/repositories/repo-1 1>"$OUT" 2>"$ERR" STATUS=$? assert_empty_stdout |