mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-10 01:51:42 +03:00
tests: set up writable directory to allow create temporary files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
8388de9b50
commit
d6ed25d143
@ -110,14 +110,15 @@ int
|
||||
main (void)
|
||||
{
|
||||
int number_failed;
|
||||
char *cwd, *logname;
|
||||
char *cwd;
|
||||
|
||||
Suite *s = suite_create (TEST_SUITE_NAME);
|
||||
TCase *tc_core = tcase_create ("Core");
|
||||
SRunner *sr;
|
||||
|
||||
/* writable directory where check creates temporary files */
|
||||
cwd = g_get_current_dir ();
|
||||
logname = g_strconcat (cwd, "realpath.log", (char *) NULL);
|
||||
g_setenv ("TEMP", cwd, TRUE);
|
||||
g_free (cwd);
|
||||
|
||||
tcase_add_checked_fixture (tc_core, setup, teardown);
|
||||
@ -128,11 +129,10 @@ main (void)
|
||||
|
||||
suite_add_tcase (s, tc_core);
|
||||
sr = srunner_create (s);
|
||||
srunner_set_log (sr, logname);
|
||||
srunner_set_log (sr, "mc_realpath.log");
|
||||
srunner_run_all (sr, CK_ENV);
|
||||
number_failed = srunner_ntests_failed (sr);
|
||||
srunner_free (sr);
|
||||
g_free (logname);
|
||||
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -196,11 +196,17 @@ int
|
||||
main (void)
|
||||
{
|
||||
int number_failed;
|
||||
char *cwd;
|
||||
|
||||
Suite *s = suite_create (TEST_SUITE_NAME);
|
||||
TCase *tc_core = tcase_create ("Core");
|
||||
SRunner *sr;
|
||||
|
||||
/* writable directory where check creates temporary files */
|
||||
cwd = g_get_current_dir ();
|
||||
g_setenv ("TEMP", cwd, TRUE);
|
||||
g_free (cwd);
|
||||
|
||||
tcase_add_checked_fixture (tc_core, setup, teardown);
|
||||
|
||||
/* Add new tests here: *************** */
|
||||
|
@ -202,11 +202,17 @@ int
|
||||
main (void)
|
||||
{
|
||||
int number_failed;
|
||||
char *cwd;
|
||||
|
||||
Suite *s = suite_create (TEST_SUITE_NAME);
|
||||
TCase *tc_core = tcase_create ("Core");
|
||||
SRunner *sr;
|
||||
|
||||
/* writable directory where check creates temporary files */
|
||||
cwd = g_get_current_dir ();
|
||||
g_setenv ("TEMP", cwd, TRUE);
|
||||
g_free (cwd);
|
||||
|
||||
tcase_add_checked_fixture (tc_core, setup, teardown);
|
||||
|
||||
/* Add new tests here: *************** */
|
||||
|
Loading…
x
Reference in New Issue
Block a user