mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-09 12:24:07 +08:00
Frameworker test more
This commit is contained in:
parent
ae72e78592
commit
5a8a75eb71
32
test/fw.c
32
test/fw.c
@ -8,13 +8,19 @@
|
|||||||
* Last Modified : <2024-12-14>
|
* Last Modified : <2024-12-14>
|
||||||
* ------------------------------------------------------------*/
|
* ------------------------------------------------------------*/
|
||||||
|
|
||||||
#define Chsrc_Version "sid"
|
#define Chsrc_Version "Frameworker"
|
||||||
|
|
||||||
#include "../src/framework/core.c"
|
#include "../src/framework/core.c"
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char const *argv[])
|
main (int argc, char const *argv[])
|
||||||
{
|
{
|
||||||
|
if (argc == 2 && xy_streql (argv[1], "--version"))
|
||||||
|
{
|
||||||
|
say (Chsrc_Version);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
br();
|
br();
|
||||||
chsrc_log ("chsrc_log");
|
chsrc_log ("chsrc_log");
|
||||||
chsrc_succ ("chsrc_succ");
|
chsrc_succ ("chsrc_succ");
|
||||||
@ -32,7 +38,29 @@ main (int argc, char const *argv[])
|
|||||||
chsrc_debug2 ("chsrc_debug2");
|
chsrc_debug2 ("chsrc_debug2");
|
||||||
chsrc_verbose2 ("chsrc_verbose2");
|
chsrc_verbose2 ("chsrc_verbose2");
|
||||||
|
|
||||||
|
|
||||||
|
assert (chsrc_check_program ("./fw"));
|
||||||
|
assert (chsrc_check_program_quietly ("./fw"));
|
||||||
|
assert (chsrc_check_program_quietly_when_exist ("./fw"));
|
||||||
|
chsrc_ensure_program ("./fw");
|
||||||
|
|
||||||
|
#define bkup "README.md.bak"
|
||||||
|
|
||||||
chsrc_backup ("README.md");
|
chsrc_backup ("README.md");
|
||||||
chsrc_succ2 ("Test framework successfully!");
|
assert (chsrc_check_file (bkup));
|
||||||
|
|
||||||
|
chsrc_ensure_dir ("test");
|
||||||
|
|
||||||
|
chsrc_append_to_file ("append", bkup);
|
||||||
|
chsrc_prepend_to_file ("prepend", bkup);
|
||||||
|
chsrc_overwrite_file ("overwrite", bkup);
|
||||||
|
chsrc_view_file (bkup);
|
||||||
|
|
||||||
|
chsrc_log (xy_2strjoin ("CPU arch = ", chsrc_get_cpuarch ()));
|
||||||
|
printf ("chsrc: CPU cores = ");
|
||||||
|
puti (chsrc_get_cpucore ());
|
||||||
|
|
||||||
|
chsrc_run ("rm " bkup, RunOpt_No_Last_New_Line);
|
||||||
|
chsrc_run ("echo " Chsrc_Version " test pass!", RunOpt_Dont_Notify_On_Success);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user