Browse Source

place tests compiled by make into 'tests' dir

Anton Lebedevich 12 years ago
parent
commit
3f9098c278
3 changed files with 6 additions and 4 deletions
  1. 4 3
      Makefile
  2. 2 1
      test/pgsql_tests.erl
  3. 0 0
      test_ebin/.empty

+ 4 - 3
Makefile

@@ -28,10 +28,11 @@ release: app
 clean:
 	@rm -f ebin/*.beam
 	@rm -f ebin/$(NAME).app
+	@rm -f test/*.beam
 	@rm -rf $(NAME)-$(VERSION) $(NAME)-*.tar.gz
 
-test: $(TESTS:test/%.erl=test_ebin/%.beam) compile
-	$(ERL) -pa ebin/ -pa test_ebin/ -noshell -s pgsql_tests run_tests -s init stop
+test: $(TESTS:test/%.erl=test/%.beam) compile
+	$(ERL) -pa ebin/ -pa test/ -noshell -s pgsql_tests run_tests -s init stop
 
 # ------------------------------------------------------------------------
 
@@ -44,7 +45,7 @@ ebin/%.beam : src/%.erl
 ebin/%.app : src/%.app.src Makefile
 	sed -e 's|git|\"$(VERSION)\"|g' $< > $@
 
-test_ebin/%.beam : test/%.erl
+test/%.beam : test/%.erl
 	$(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
 
 dialyzer: build.plt compile

+ 2 - 1
test/pgsql_tests.erl

@@ -666,7 +666,8 @@ application_test(_Module) ->
 %% -- run all tests --
 
 run_tests() ->
-    Files = filelib:wildcard("test_ebin/*tests.beam"),
+    Files = filelib:wildcard(filename:dirname(code:which(pgsql_tests))
+                             ++ "/*tests.beam"),
     Mods = [list_to_atom(filename:basename(F, ".beam")) || F <- Files],
     eunit:test(Mods, []).
 

+ 0 - 0
test_ebin/.empty