Compare commits

..

No commits in common. "1befa196c44d5e6425cb6415ba72b133ecf11412" and "ebf8b1c901eab09dfaa51e6d5c67500908cda6a3" have entirely different histories.

2 changed files with 7 additions and 40 deletions

View file

@ -78,6 +78,8 @@ tests += extract_file_node
tests += extract_symlink_node
tests += extract_hardlink_node
total != echo $(tests) | wc -w | awk '{ print $$1 }'
.PHONY: test
test: $(tests) runner output
./runner $(tests)
@ -85,9 +87,6 @@ test: $(tests) runner output
output:
@ [-d $@ ] 2>/dev/null || install -d $@
runner: runner.c
$(CC) -o runner runner.c
.PHONY: clean
clean:
rm -rf $(tests) runner output/*

View file

@ -1,35 +1,3 @@
/* _,.---._ .-._ .--.-. ,--.--------.
* _,..---._ ,-.' , - `. /==/ \ .-._/==/ //==/, - , -\
* /==/, - \ /==/_, , - \|==|, \/ /, |==\ -\\==\.-. - ,-./
* |==| _ _\==| .=. |==|- \| | \==\- \`--`\==\- \
* |==| .=. |==|_ : ;=: - |==| , | -| `--`-' \==\_ \
* |==|,| | -|==| , '=' |==| - _ | |==|- |
* |==| '=' /\==\ - ,_ /|==| /\ , | |==|, |
* |==|-, _`/ '.='. - .' /==/, | |- | /==/ -/
* `-.`.____.' `--`--'' `--`./ `--` `--`--`
* _ __ ,---. .-._ .=-.-. _,.----.
* .-`.' ,`..--.' \ /==/ \ .-._ /==/_ /.' .' - \
* /==/, - \==\-/\ \ |==|, \/ /, /==|, |/==/ , ,-'
* |==| _ .=. /==/-|_\ | |==|- \| ||==| ||==|- | .
* |==| , '=',\==\, - \ |==| , | -||==|- ||==|_ `-' \
* |==|- '..'/==/ - ,| |==| - _ ||==| ,||==| _ , |
* |==|, | /==/- /\ - \|==| /\ , ||==|- |\==\. /
* /==/ - | \==\ _.\=\.-'/==/, | |- |/==/. / `-.`.___.-'
* `--`---' `--` `--`./ `--``--`-`
*
* @(#)Copyright (c) 2024, Nathan D. Fisher.
*
* This is free software. It comes with NO WARRANTY.
* Permission to use, modify and distribute this source code
* is granted subject to the following conditions.
* 1/ that the above copyright notice and this notice
* are preserved in all copies and that due credit be given
* to the author.
* 2/ that any changes to this code are clearly commented
* as such so that the author does not get blamed for bugs
* other than his own.
*/
#include <stdio.h>
#include <stdlib.h>
@ -39,10 +7,10 @@ int main(int argc, char *argv[]) {
char cmd[100], output[500];
total = argc-1;
printf("\n\t=== \033[0;33mRunning %i tests\033[0m ===\n\n", total);
printf("\n\t=== \033[0;33mRunning %i tests\033[0m ===\n", total);
for (i = 1; i < argc; i++) {
snprintf(cmd, 100, "./%s", argv[i]);
printf("\033[0;2m[\033[0m%03i\033[0;2m/\033[0m%03i\033[0;2m]\033[0m %-25s", i, total, argv[i]);
printf("%-25s", argv[i]);
pipe = popen(cmd, "w");
read = fread(&output, 1, 500, pipe);
ret = pclose(pipe);
@ -67,11 +35,11 @@ int main(int argc, char *argv[]) {
}
}
if (fail) {
printf("\nResults: \033[0;31mFAILED\033[0m %i succeeded; %i failed; %i skipped\n\n",
printf("\nResults: \033[0;31mFAILED\033[0m %i succeeded; %i failed; %i skipped\n",
pass, fail, skip);
} else {
printf("\nResults: \033[0;32mOk\033[0m %i succeeded; %i failed; %i skipped\n\n",
printf("\nResults: \033[0;32mOk\033[0m %i succeeded; %i failed; %i skipped\n",
pass, fail, skip);
}
return fail;
return 0;
}