Commit Graph

81 Commits

Author SHA1 Message Date
Anna Schumaker fc88f68d6b tests: Build file test with ctest
This changes test output slightly, in that files are now placed under
subdirectories of $XDG_USER_DATA_DIR/ocarina-test/ instead of in this
directory directly.  This should help avoid conflicting files, and lets
me use a single "rm" command to remove everything before testing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-09-23 16:11:02 -04:00
Anna Schumaker 811270a832 build: Don't run gui tests if $DISPLAY is not set
I have tests running on ocarinaproject.net, which is headless and
doesn't run an X server.  Gui tests cann't run without an X server.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-11 15:02:24 -04:00
Anna Schumaker 3bc5b1db9e gui/builder: Add new file for accessing the GtkBuilder
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker f23fb9e0f5 gui/settings: Add new settings file
The settings layer will track various configuration options set by the
user.  This belongs in the gui, and not core, because it controls
settings specific to this gui implementation.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-04-08 12:03:08 -04:00
Anna Schumaker bc0437b3fe tests: Clean up how the sanity test is scheduled
I created a new function for checking if a group of tests is running to
help determine if the sanity test needs to run before anything else.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2016-02-26 11:04:42 -05:00
Anna Schumaker 18311afcfe core/tests: Write a script to generate empty albums
gen_tracks.sh will read a specially configured file and create a
directory containing empty tracks to use for testing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-12-10 16:46:35 -05:00
Anna Schumaker 55a7673983 tests/core: Update version test to the new framework
The version test is fairly simple, since it only tests the values set in
a single header file.  The remaining tests will be more challenging,
since I'll have to modify core code and the test at the same time.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 08:19:45 -04:00
Anna Schumaker 63769c9c0b Convert unit test framework to C
I commented out most of the file and directory modification code while I
was at it.  I'll re-add these as I convert more files to C.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-10-07 08:19:37 -04:00
Anna Schumaker 34a15d58c4 Remove test_env
I want to make the scons files simpler, so I have decided to drop down
to only one test environment.  This patch disables
tests/core/Sconscript, but I'll add this back in as I make other changes
throughout the codebase.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-09-11 09:11:38 -04:00
Anna Schumaker 74a557739d lib: Remove rest of lib/
This is all contained in the gui code now.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-21 08:39:02 -05:00
Anna Schumaker 6cfd0d5c51 tests: Rework much of the testing library
I move the code into a new cpp file, so it is no longer a header-only
library.  I also take the chance to add a for-each function for testing
iterators.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-13 09:35:26 -05:00
Anna Schumaker 0abc562033 build: Remove unused global environment variables
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-02 10:43:44 -05:00
Anna Schumaker a371e832dd build: Remove valgrind support
I never actually used this.  Testing with valgrind should happen
manually if needed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2015-01-02 10:32:16 -05:00
Anna Schumaker 8128e5b5e1 tests: Remove unused testing options
I never really did anything with cppcheck or gcov, so I'm removing these
options.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-01 20:25:56 -04:00
Anna Schumaker 159f6098f3 tests: Reenable valgrind support
This lets me remove the unused OTest class which I was keeping around
for reference.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-01 20:25:56 -04:00
Anna Schumaker 97733aa40a tests: Create common functions for building tests
This continues to simplify my Sconscript files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-11-01 20:25:56 -04:00
Anna Schumaker 77616aa8d2 Merge branch 'master' into Ocarina-next
Conflicts:
	Sconstruct
	tests/Sconscript
2014-06-26 17:04:58 -04:00
Anna Schumaker d74d1ea634 Prepare for a bugfix release
Looks like I'll need to release a 6.1.1 soon

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-22 12:35:08 -04:00
Anna Schumaker 194a09bed4 lib: Initialize the GtkBuilder from the middle layer
This will provide an interface for accessing widgets, and make it easier
to swap out different builder files.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-15 11:31:04 -04:00
Anna Schumaker f2575d9799 tests: Add a test for lib :: init()
This just checks that the deck was initialized.  To really be complete,
it should really check that ALL core libraries are initialized.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-14 20:43:54 -04:00
Anna Schumaker c88746d2da tests: Create a core/ directory
I move all of the core tests into the core/ directory to keep them
together.  Gui unit tests will be put in new directories.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-14 11:15:21 -04:00
Anna Schumaker 95064e4537 Rename lib/ -> core/
I plan to introduce a new lib/ that sits between the gui and the backend
files (similar to how glibc sits between the kernel and userspace).
This gets the rename out of the way before I change my mind again.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-05 10:21:32 -04:00
Anna Schumaker 1bfa299e08 audio: Update the code to match the design
This patch reworks the unit test using the TestDriver audio driver.  I
also recode the audio layer to match the design and drastically clean up
the code.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-06-01 17:53:41 -04:00
Anna Schumaker edc4a2f4ee driver: Create an audio driver class
The driver is used to select between gstreamer playback and a fake
playback mode used only when testing.

Currently the GSTDriver has empty functions.  It will be implemented as
the audio.cpp file is updated.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-31 13:27:20 -04:00
Anna Schumaker a385727206 tests: Move sample files into the Data/ directory
Keeping separate directories for all of these files isn't the most
obvious way to do things.  Instead, move everything into the same
directory.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-26 19:12:14 -04:00
Anna Schumaker 208e53c7e9 library: Update the code and unit test
Lots of changes here!  I switched from using track and library ids to
passing pointers, renamed some functions, and made the code much
cleaner.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-24 12:48:47 -04:00
Anna Schumaker 53f0c2a6aa testing: Add gcov and cppcheck tests
It doesn't hurt to run even more tests on the code!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-20 17:25:03 -04:00
Anna Schumaker 11df56139d playlist: Update the design and unit test
I updated the code to better match how I use playlists and to make sure
that everything is tested.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-18 21:34:14 -04:00
Anna Schumaker 124f275ffd queue: Update the next() function
I also added in code for testing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-18 11:17:32 -04:00
Anna Schumaker 6dc8bf7329 random: Use a different RNG for testing
This RNG is more predictable, which makes it great for testing.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-18 11:10:29 -04:00
Anna Schumaker 7aa5f22777 Add valgrind support to testing
To help find memory leaks!

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-14 17:49:03 -04:00
Anna Schumaker 3fbb4d9735 Clean up test/ directory
Mostly remove files that are no longer used.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-06 23:05:18 -04:00
Anna Schumaker 7332ed1e8f queue: Move unit test up one directory
And modify it a bit to match my recent work.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-06 23:03:42 -04:00
Anna Schumaker 4dafe7270f tags: Update the unit test
While I'm at it, I also fix a refcounting issue with the Library pointer
each track has.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-06 22:57:07 -04:00
Anna Schumaker 34b0c56a70 Move tests out of tests/src/
... and just into the tests/ directory.  I also reworked the Sconscript
to compile everything using only the lib/ files that are needed.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-06 08:37:04 -04:00
Anna Schumaker 1f19987c53 idle: Update test for new system
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-05 09:41:49 -04:00
Anna Schumaker 70067a89cb filter: Update unit test
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-03 19:31:38 -04:00
Anna Schumaker 90bd93b10f index: Update the index test
I switched to the new testing functions, and now everything is cleaner.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-03 19:04:08 -04:00
Anna Schumaker f627f8337d database: Update unit test
As a bonus, I now have a test for manual database saving.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-27 17:09:47 -04:00
Anna Schumaker 55f3f06ded file: More cleanups after removing legacy file support
Looks like I missed updating a few places in the File class.  I do that
now, and I also began updating the unit test to the new system.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-26 14:07:06 -04:00
Anna Schumaker 8aa121f291 tests: Update testing framework and begin reworking everything
Add in several new features like:
- Don't exit until the specific test function completes.
- Make it easier to run named tests from C++.
- Use a macro to find line number when calling test :: equal().
- Use a macro to do basic setup and cleanup between test functions.

Also update the version test while I'm at it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-26 14:06:58 -04:00
Anna Schumaker 30e12bcb68 Allow running single tests
This makes testing easier, since I'll only see the test I need and not
everything that runs before it.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-13 18:40:24 -04:00
Anna Schumaker d939dcab20 queue: Begin code updates
So far I have renamed variables, changed a few functions, and updated
all the code that was affected.

Oh, I also started a new unit test.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-04-13 12:27:15 -04:00
Anna Schumaker 7490b98db6 Combine database and db_entry tests
These tests are designed to verify the database, which should include
the DatabaseEntry class.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 21:10:08 -04:00
Anna Schumaker 134348f253 tags: Begin creating the tag database
This patch adds classes for Artist, Album, Genre and Library.

Signed-off-by: Anna Schumaker <anna@ocarinaproject.net>
2014-04-09 21:10:07 -04:00
Anna Schumaker 14879b03fd idle: Update design and unit test
I didn't have any changes to make to the IdleQueue itself, but I did
need to update the unit test and reword a few things in the design.

Signed-off-by: Anna Schuamker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 58ed47b37c filter: Update design and rewrite the unit test
- filter :: add() now returns the lowercased text
- Don't cache lowercased strings
- Remove functions depending on CONFIG_TEST

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:06 -04:00
Anna Schumaker 1b34a9a8a0 index: Update the index design
I updated the design and rewrote the unit tests.  This creates something
more consistent with how I ended up using the index.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker fc8dc9d55e database: Design and test updates
I add:
- Autosaving option
- Real iterators
- Better accessor functions

The new design and unit test also allows me to remove the 300,000+ line
"database.good" file that the old tests were based on.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00
Anna Schumaker 959cac0fe1 Database: Update design for database entries
I changed primary_key() into a function since it is only called once,
and there is no point in using more mmemory than I need to.  I also
created a basic unit test for everything that database entries are
supposed to do.

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
2014-04-06 19:57:05 -04:00