Commit Graph

139 Commits

Author SHA1 Message Date
Pavel Platto
1a361b629a os_fchown: enable 'change group' unittest on Travis-CI
Add section `before_install` in `.travis.yml` to create test group and
add current user to this group.
It is needed because by default user on Travis-CI belongs only to one
primary group derived from that user. So we have no alternative to
change group of the file.
2014-08-13 09:36:09 +03:00
Pavel Platto
64ea24bc17 os_fchown: add unit tests 2014-08-13 09:13:59 +03:00
Scott Prager
c3b9f863ea Units: Move NULL, OK, and FAIL to helpers.moon. #982 2014-07-30 18:25:43 -04:00
Nicolas Hillegeer
974752c53b test/shell: add tests
- The calls to (partially) initialize logging
  need to go. Blocked on #981.
2014-07-27 14:00:45 -03:00
Nicolas Hillegeer
06ca70b191 test/fs: move tests of path_full_dir_name to path
Move tests of path_full_dir_name to path_spec. It is only defined in path.h.
Not sure why this works most of the time (I can only trigger a failure when
running under lldb).

It's a more logical place to have the test as well.
2014-07-16 19:05:35 +02:00
Pavel Platto
2dc69700ec Use default busted pattern for unittests #943
- Unittest should contain substring '_spec' in filename.
- This is the simplest way to use both lua and moonscript tests.
- This prevents running of non-test scripts from test folder.
2014-07-14 20:08:39 +02:00
Justin M. Keyes
0ceebc2c91 os_open: add unit tests 2014-07-14 09:05:52 -04:00
Stefan Hoffmann
4a22fb06b9 FileID: implement FileID struct
`FileID` should encapsulate `st_dev` and `st_ino`. It is a new abstraction
used to check if two files are the same. `FileID`s will be embeded inside
other struts like `buf_t` or `ff_visited_T`, where a full `FileInfo` would be
to big.
2014-06-27 13:59:28 +02:00
Will Stamper
5b3b3fd3ed spelling fixes #827 2014-06-12 20:26:35 -04:00
Eliseo Martínez
74b9396043 Introduce nvim namespace: Fix unit tests.
Point cimports to new locations.
2014-05-15 20:46:02 +02:00
Stefan Hoffmann
aff9673076 implemented FileInfo struct
This struct is a wrapper around `uv_stat_t` to hide the stat information
inside `src/os/`.
The stat file attribute will be private after all refactorings concerning
file informations are done.
2014-05-09 15:49:33 +02:00
Nicolas Hillegeer
9e04e81ac7 test: no longer define ad-hoc C headers
With the improved cimport helper, we can just load what we want.
2014-04-28 16:17:25 -03:00
Stefan Hoffmann
445f31f076 port vim_mkdir, mch_rmdir and mch_remove to libuv 2014-04-11 13:31:48 -03:00
John Schmidt
ac62041138 Move exe functions back to os/fs.c 2014-04-08 21:56:05 -03:00
John Schmidt
6fb58d1c5c Change prefix from os_* to path_* 2014-04-08 21:56:05 -03:00
John Schmidt
4348d1e6f7 Move functions from os/fs.c into path.c
Move unit tests from os/fs.moon to path.moon
2014-04-08 21:56:05 -03:00
Hinidu
8a2ffb2b01 Use stdbool in os module 2014-04-07 12:15:28 -03:00
Stefan Hoffmann
e76249c813 Moved mch_get_host_name and renamed it to os_get_hostanme 2014-04-05 20:19:38 -03:00
Stefan Hoffmann
a8013f2bb1 Moved mch_get_pid and renamed it to os_get_pid 2014-04-05 20:19:38 -03:00
Hinidu
a3ff83ce7e Replace mch_rename and vim_rename with libuv 2014-04-04 16:03:55 -03:00
Stefan Hoffmann
f762a9e195 move filewritable() into /src/os/fs.c and rename it 2014-04-03 10:30:03 -03:00
Stefan Hoffmann
071d28076f move check_file_readonly() into /src/os/fs.c and rename it 2014-04-03 10:30:03 -03:00
Thomas Wienecke
f9d4b14f25 Delete os_delay unit test. 2014-04-02 18:50:09 -03:00
Thomas Wienecke
4e29a820b6 Address clint warnings and other style issues.
* Add const.
* Fix conditions (move && from end to start of line).
* Use int32_t instead of long.
* Use //-style comments.
2014-03-27 19:57:55 -03:00
Thomas Wienecke
5762c4e528 Rename mch_* functions to os_* in os module. 2014-03-27 19:57:55 -03:00
Stefan Hoffmann
7d413050ba fix mch_delay() unittest 2014-03-25 15:41:15 +01:00
Thiago de Arruda
32f118a47f Implement mch_delay on top of libuv
Needed to temporarily move two static variables from os_unix.c to 'globals.h'
as those are shared by other functions still in os_unix.
2014-03-24 19:25:07 -03:00
Thomas Wienecke
1949acc806 Revive vim_fname (-> os_file_exists); fix misuse of mch_getperm.
* Move vim_fname from misc1 to os/fs:os_file_exists.
* Add unit tests for os_file_exists.
* Replace misuse of mch_getperm with os_file_exists.
2014-03-15 11:50:22 -03:00
Thomas Wienecke
1f578ec5a1 Add unit tests for mch_[gs]etperm.
Use preprocessor trick proposed by @mahkoh to import 'defines' like
S_IRUSR.
2014-03-15 11:50:22 -03:00
Stefan Hoffmann
33eb031c01 refactored part of expand_env_esc() into mch_get_user_directory() 2014-03-13 17:18:44 -03:00
Stefan Hoffmann
ce31410c79 moved mch_get_user_name() and mch_get_uname() into os/users.c 2014-03-13 17:18:44 -03:00
Stefan Hoffmann
6fd9f090fc refactored logic from init_users() into mch_get_usernames() 2014-03-13 17:18:43 -03:00
Thomas Wienecke
ab0c96187c Fix bugs, clean code, add tests.
* Add const specifiers, update comments, add assert.
* Move os_unix.moon tests to os/fs.moon + clean tests.
* Add uv_fs_req_cleanup call.
* Add tests with absolute paths to mch_isdir.
* Add to_cstr to test/unit/helpers.moon and fix respective unit tests.
2014-03-07 17:30:39 -03:00
Stefan Hoffmann
f2433aedc8 cleanup environment variable handling + unit tests
* removed a putenv() implementation which isn't needed anymore
  * mch_getenv() and mch_setenv() are now functions in src/os/env.c
  * removes direct calls to getenv() and setenv() outside of src/os/env.c
  * refactored the logic of get_env_name into mch_getenvname_at_index
  * added unittests for the functions in os/env.c
2014-03-06 13:38:45 -03:00
Thomas Wienecke
fc86866402 Fix style issues.
* Rename mch_full_name to mch_get_absolute_path.
* Rename mch_is_full_name to mch_is_absolute_path.
* Add a lot of missing parentheses.
* Remove yoda-conditions for consistency.
* Remove spaces in function declaration.
2014-03-06 13:10:58 -03:00
Thiago de Arruda
34538a82f3 Apply small refactor to unit tests
Redefine macro constants as enums in the ffi and import those in their
respective test modules.
2014-03-04 11:26:37 -03:00
Thomas Wienecke
0677e0ee9c Correct a few parentheses. 2014-03-04 06:54:08 -03:00
Thomas Wienecke
92a0374d7b Rename and refactor mch_FullName.
* Rename mch_FullName to mch_full_name to match the style guide.
* Add mch_full_dir_name, which saves the absolute path of a given
directory relative to cwd into a given buffer.
* Add function append_path, which glues together two given paths with a
slash.
* Adapt moonscript coding style to the tests.
2014-03-04 06:54:08 -03:00
Thomas Wienecke
fcbfd57d1f Add unit tests for ported filesystem functions. 2014-03-03 08:54:02 -03:00